Skip to content

Commit

Permalink
#48 listen to connect tim
Browse files Browse the repository at this point in the history
  • Loading branch information
johrstrom committed Mar 15, 2019
1 parent b11788c commit 4f203de
Show file tree
Hide file tree
Showing 8 changed files with 19 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# 0.3.0

* #50 - listening to latency
* #49 - listening to idle time
* #48 - listening to connection time

# 0.2.0

Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ This is a matrix of what metric types can measure what metrics. If you configur
| Response size | x | x | | | |
| Latency | x | x | | | |
| Idle time | x | x | | | |
| Connect time | x | x | | | |
| Count total | | | x | | |
| Failure total | | | x | | |
| Success total | | | x | | |
Expand Down
Binary file modified docs/imgs/listener_full.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ public enum Measurable {
ResponseSize,
Latency,
IdleTime,
ConnectTime,

// for count type updater
SuccessTotal,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,7 @@ protected void makeNewCollectors() {
case ResponseTime:
case Latency:
case IdleTime:
case ConnectTime:
updater = new AggregatedTypeUpdater(config);
break;
default:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ protected long measure(SampleEvent event) {
return result.getLatency();
case IdleTime:
return result.getIdleTime();
case ConnectTime:
return result.getConnectTime();
default:
return 0;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,9 @@ public void updateAllTypes() {
case "test_hist_idle_time":
assertOnHistogram(reg.getOrCreateAndRegister(cfg), idleTime*samplesOccured, samplesOccured, idleTime);
break;
case "test_hist_connect_time":
assertOnHistogram(reg.getOrCreateAndRegister(cfg), connectTime*samplesOccured, samplesOccured, connectTime);
break;

// summaries
case "test_summary_rtime":
Expand All @@ -155,6 +158,9 @@ public void updateAllTypes() {
case "test_summary_idle_time":
assertOnSummary(reg.getOrCreateAndRegister(cfg), idleTime*samplesOccured, samplesOccured, idleTime);
break;
case "test_summary_connect_time":
assertOnSummary(reg.getOrCreateAndRegister(cfg), connectTime*samplesOccured, samplesOccured, connectTime);
break;

default:
Assert.assertTrue( name + " triggered untested switch case", false);
Expand Down
6 changes: 6 additions & 0 deletions src/test/java/com/github/johrstrom/test/TestUtilities.java
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,9 @@ public static List<ListenerCollectorConfig> fullListListener(){

cfg = redoNameAndMeasuring(cfg, "test_hist_idle_time", Measurable.IdleTime);
list.add(cfg);

cfg = redoNameAndMeasuring(cfg, "test_hist_connect_time", Measurable.ConnectTime);
list.add(cfg);

// -------- summaries
cfg = new ListenerCollectorConfig(simpleSummaryCfg());
Expand All @@ -187,6 +190,9 @@ public static List<ListenerCollectorConfig> fullListListener(){
cfg = redoNameAndMeasuring(cfg, "test_summary_idle_time", Measurable.IdleTime);
list.add(cfg);

cfg = redoNameAndMeasuring(cfg, "test_summary_connect_time", Measurable.ConnectTime);
list.add(cfg);

return list;
}

Expand Down

0 comments on commit 4f203de

Please sign in to comment.