Skip to content

Commit

Permalink
Consistency between work being performance-tested in metrics-read JMH…
Browse files Browse the repository at this point in the history
… test
  • Loading branch information
Matt Jacobs committed Jan 12, 2016
1 parent aa43d68 commit bf81634
Showing 1 changed file with 16 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,15 @@ public Integer writeHeavyCommandExecution(CommandState state) {
@GroupThreads(1)
@BenchmarkMode({Mode.Throughput})
@OutputTimeUnit(TimeUnit.MILLISECONDS)
public Integer writeHeavyReadMetrics(CommandState state) {
public long writeHeavyReadMetrics(CommandState state) {
HystrixCommandMetrics metrics = state.command.getMetrics();
return metrics.getExecutionTimeMean() + metrics.getExecutionTimePercentile(50) + metrics.getExecutionTimePercentile(75) + metrics.getExecutionTimePercentile(99);
return metrics.getExecutionTimeMean()
+ metrics.getExecutionTimePercentile(50)
+ metrics.getExecutionTimePercentile(75)
+ metrics.getExecutionTimePercentile(99)
+ metrics.getCumulativeCount(HystrixEventType.SUCCESS)
+ metrics.getRollingCount(HystrixEventType.FAILURE)
+ metrics.getRollingMaxConcurrentExecutions();
}

@Benchmark
Expand All @@ -107,9 +113,15 @@ public Integer evenSplitOfWritesAndReadsCommandExecution(CommandState state) {
@GroupThreads(4)
@BenchmarkMode({Mode.Throughput})
@OutputTimeUnit(TimeUnit.MILLISECONDS)
public Integer evenSplitOfWritesAndReadsReadMetrics(CommandState state) {
public long evenSplitOfWritesAndReadsReadMetrics(CommandState state) {
HystrixCommandMetrics metrics = state.command.getMetrics();
return metrics.getExecutionTimeMean() + metrics.getExecutionTimePercentile(50) + metrics.getExecutionTimePercentile(75) + metrics.getExecutionTimePercentile(99);
return metrics.getExecutionTimeMean()
+ metrics.getExecutionTimePercentile(50)
+ metrics.getExecutionTimePercentile(75)
+ metrics.getExecutionTimePercentile(99)
+ metrics.getCumulativeCount(HystrixEventType.SUCCESS)
+ metrics.getRollingCount(HystrixEventType.FAILURE)
+ metrics.getRollingMaxConcurrentExecutions();
}

@Benchmark
Expand Down

0 comments on commit bf81634

Please sign in to comment.