Author: timfox
Date: 2009-11-26 09:01:04 -0500 (Thu, 26 Nov 2009)
New Revision: 8414
Modified:
branches/20-optimisation/src/main/org/hornetq/core/journal/impl/TimedBuffer.java
branches/20-optimisation/tests/src/org/hornetq/tests/opt/SendTest.java
branches/20-optimisation/tests/src/org/hornetq/tests/unit/core/journal/impl/TimedBufferTest.java
Log:
fixed timedbuffertest
Modified:
branches/20-optimisation/src/main/org/hornetq/core/journal/impl/TimedBuffer.java
===================================================================
---
branches/20-optimisation/src/main/org/hornetq/core/journal/impl/TimedBuffer.java 2009-11-26
13:30:41 UTC (rev 8413)
+++
branches/20-optimisation/src/main/org/hornetq/core/journal/impl/TimedBuffer.java 2009-11-26
14:01:04 UTC (rev 8414)
@@ -96,7 +96,7 @@
public TimedBuffer(final int size, final long timeout, final boolean flushOnSync,
final boolean logRates)
{
- bufferSize = 490 * 1024;
+ this.bufferSize = size;
this.logRates = logRates;
if (logRates)
{
Modified: branches/20-optimisation/tests/src/org/hornetq/tests/opt/SendTest.java
===================================================================
--- branches/20-optimisation/tests/src/org/hornetq/tests/opt/SendTest.java 2009-11-26
13:30:41 UTC (rev 8413)
+++ branches/20-optimisation/tests/src/org/hornetq/tests/opt/SendTest.java 2009-11-26
14:01:04 UTC (rev 8414)
@@ -60,7 +60,7 @@
{
try
{
- new SendTest().runConsume();
+ new SendTest().runTextMessage();
}
catch (Exception e)
{
@@ -74,9 +74,9 @@
{
log.info("*** Starting server");
- //System.setProperty("org.hornetq.opt.dontadd", "true");
+ System.setProperty("org.hornetq.opt.dontadd", "true");
// System.setProperty("org.hornetq.opt.routeblast", "true");
- System.setProperty("org.hornetq.opt.generatemessages",
"true");
+ //System.setProperty("org.hornetq.opt.generatemessages",
"true");
Configuration configuration = new ConfigurationImpl();
configuration.setSecurityEnabled(false);
@@ -285,25 +285,20 @@
prod.setDeliveryMode(DeliveryMode.NON_PERSISTENT);
- byte[] bytes1 = new byte[] { (byte)'A',
(byte)'B',(byte)'C',(byte)'D'};
-
- String s = new String(bytes1);
-
- System.out.println("Str is " + s);
-
- byte[] bytes = RandomUtil.randomBytes(512);
+ byte[] bytes = RandomUtil.randomBytes(1024);
String str = new String(bytes);
log.info("Warming up");
- TextMessage tm = sess.createTextMessage();
-
- tm.setText(str);
-
+
for (int i = 0; i < warmup; i++)
{
+ TextMessage tm = sess.createTextMessage();
+
+ tm.setText(str);
+
prod.send(tm);
if (i % 10000 == 0)
@@ -314,14 +309,15 @@
log.info("** WARMUP DONE");
- tm = sess.createTextMessage();
-
- tm.setText(str);
+
long start = System.currentTimeMillis();
for (int i = 0; i < numMessages; i++)
{
+ TextMessage tm = sess.createTextMessage();
+
+ tm.setText(str);
prod.send(tm);
if (i % 10000 == 0)
Modified:
branches/20-optimisation/tests/src/org/hornetq/tests/unit/core/journal/impl/TimedBufferTest.java
===================================================================
---
branches/20-optimisation/tests/src/org/hornetq/tests/unit/core/journal/impl/TimedBufferTest.java 2009-11-26
13:30:41 UTC (rev 8413)
+++
branches/20-optimisation/tests/src/org/hornetq/tests/unit/core/journal/impl/TimedBufferTest.java 2009-11-26
14:01:04 UTC (rev 8414)
@@ -38,6 +38,7 @@
// Attributes ----------------------------------------------------
// Static --------------------------------------------------------
+
// Constructors --------------------------------------------------
// Public --------------------------------------------------------