INT-3641: JMX: Lazy Stats

JIRA: https://jira.spring.io/browse/INT-3641

Instead of maintaining a moving average on each event, store the events
for offline analysis.

Retain 5*window samples - this means that the earlies retained sample
contributes just 0.5% to the sum. E.g. with a window of 10, the earliest
sample is 0.9**50 (0.005).

Also, defer the conversion from nanoseconds to milliseconds to the
retrieval side.

Experimentation shows this increases perfomance by approximately 2x.

Sending 1B messages to nullChannel.

With Proxy: 1.2M/sec
Afer proxy removed: 2.4M/sec
With this change: 5.3M/sec

INT-3641: Polishing - PR Comments

JavaDocs polishing
This commit is contained in:
Gary Russell
2015-02-25 14:28:02 +02:00
committed by Artem Bilan
parent 49c231e547
commit 3a114ec83a
10 changed files with 431 additions and 145 deletions

View File

@@ -27,6 +27,7 @@ import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.integration.channel.NullChannel;
import org.springframework.integration.support.MessageBuilder;
import org.springframework.messaging.MessageChannel;
import org.springframework.messaging.PollableChannel;
@@ -66,7 +67,7 @@ public class DynamicRouterTests {
private PollableChannel processCChannel;
@Autowired
private MessageChannel nullChannel;
private NullChannel nullChannel;
@Test @DirtiesContext
@@ -116,10 +117,11 @@ public class DynamicRouterTests {
@Test @DirtiesContext @Ignore
public void testPerf() throws Exception {
for (int i = 0; i < 10000000; i++) {
// this.nullChannel.enableStats(false);
for (int i = 0; i < 1000000000; i++) {
this.nullChannel.send(null);
}
System.out.println("done");
System.out.println(this.nullChannel.getSendRate());
}
}