Skip to content

Commit

Permalink
Deprecate methods to retrieve userThreadLatency, and remove it from s…
Browse files Browse the repository at this point in the history
…tandard metrics being published
  • Loading branch information
Matt Jacobs committed Jan 29, 2016
1 parent 20ae3dc commit cf3d12f
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 95 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -339,55 +339,6 @@ public Integer getValue() {
}
});

metricRegistry.register(createMetricName("latencyTotal_mean"), new Gauge<Integer>() {
@Override
public Integer getValue() {
return metrics.getTotalTimeMean();
}
});
metricRegistry.register(createMetricName("latencyTotal_percentile_5"), new Gauge<Integer>() {
@Override
public Integer getValue() {
return metrics.getTotalTimePercentile(5);
}
});
metricRegistry.register(createMetricName("latencyTotal_percentile_25"), new Gauge<Integer>() {
@Override
public Integer getValue() {
return metrics.getTotalTimePercentile(25);
}
});
metricRegistry.register(createMetricName("latencyTotal_percentile_50"), new Gauge<Integer>() {
@Override
public Integer getValue() {
return metrics.getTotalTimePercentile(50);
}
});
metricRegistry.register(createMetricName("latencyTotal_percentile_75"), new Gauge<Integer>() {
@Override
public Integer getValue() {
return metrics.getTotalTimePercentile(75);
}
});
metricRegistry.register(createMetricName("latencyTotal_percentile_90"), new Gauge<Integer>() {
@Override
public Integer getValue() {
return metrics.getTotalTimePercentile(90);
}
});
metricRegistry.register(createMetricName("latencyTotal_percentile_99"), new Gauge<Integer>() {
@Override
public Integer getValue() {
return metrics.getTotalTimePercentile(99);
}
});
metricRegistry.register(createMetricName("latencyTotal_percentile_995"), new Gauge<Integer>() {
@Override
public Integer getValue() {
return metrics.getTotalTimePercentile(99.5);
}
});

// group
metricRegistry.register(createMetricName("commandGroup"), new Gauge<String>() {
@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -337,19 +337,6 @@ public Long call() {
json.writeNumberField("99.5", commandMetrics.getExecutionTimePercentile(99.5));
json.writeNumberField("100", commandMetrics.getExecutionTimePercentile(100));
json.writeEndObject();
//
json.writeNumberField("latencyTotal_mean", commandMetrics.getTotalTimeMean());
json.writeObjectFieldStart("latencyTotal");
json.writeNumberField("0", commandMetrics.getTotalTimePercentile(0));
json.writeNumberField("25", commandMetrics.getTotalTimePercentile(25));
json.writeNumberField("50", commandMetrics.getTotalTimePercentile(50));
json.writeNumberField("75", commandMetrics.getTotalTimePercentile(75));
json.writeNumberField("90", commandMetrics.getTotalTimePercentile(90));
json.writeNumberField("95", commandMetrics.getTotalTimePercentile(95));
json.writeNumberField("99", commandMetrics.getTotalTimePercentile(99));
json.writeNumberField("99.5", commandMetrics.getTotalTimePercentile(99.5));
json.writeNumberField("100", commandMetrics.getTotalTimePercentile(100));
json.writeEndObject();

// property values for reporting what is actually seen by the command rather than what was set somewhere
HystrixCommandProperties commandProperties = commandMetrics.getProperties();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -201,19 +201,6 @@ public Long call() {
json.writeNumberField("99.5", commandMetrics.getExecutionTimePercentile(99.5));
json.writeNumberField("100", commandMetrics.getExecutionTimePercentile(100));
json.writeEndObject();
//
json.writeNumberField("latencyTotal_mean", commandMetrics.getTotalTimeMean());
json.writeObjectFieldStart("latencyTotal");
json.writeNumberField("0", commandMetrics.getTotalTimePercentile(0));
json.writeNumberField("25", commandMetrics.getTotalTimePercentile(25));
json.writeNumberField("50", commandMetrics.getTotalTimePercentile(50));
json.writeNumberField("75", commandMetrics.getTotalTimePercentile(75));
json.writeNumberField("90", commandMetrics.getTotalTimePercentile(90));
json.writeNumberField("95", commandMetrics.getTotalTimePercentile(95));
json.writeNumberField("99", commandMetrics.getTotalTimePercentile(99));
json.writeNumberField("99.5", commandMetrics.getTotalTimePercentile(99.5));
json.writeNumberField("100", commandMetrics.getTotalTimePercentile(100));
json.writeEndObject();

// property values for reporting what is actually seen by the command rather than what was set somewhere
HystrixCommandProperties commandProperties = commandMetrics.getProperties();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -507,16 +507,6 @@ public HystrixEventType call() {
monitors.add(getExecutionLatencyPercentileMonitor("latencyExecute_percentile_99", 99));
monitors.add(getExecutionLatencyPercentileMonitor("latencyExecute_percentile_995", 99.5));

// total latency metrics
monitors.add(getTotalLatencyMeanMonitor("latencyTotal_mean"));
monitors.add(getTotalLatencyPercentileMonitor("latencyTotal_percentile_5", 5));
monitors.add(getTotalLatencyPercentileMonitor("latencyTotal_percentile_25", 25));
monitors.add(getTotalLatencyPercentileMonitor("latencyTotal_percentile_50", 50));
monitors.add(getTotalLatencyPercentileMonitor("latencyTotal_percentile_75", 75));
monitors.add(getTotalLatencyPercentileMonitor("latencyTotal_percentile_90", 90));
monitors.add(getTotalLatencyPercentileMonitor("latencyTotal_percentile_99", 99));
monitors.add(getTotalLatencyPercentileMonitor("latencyTotal_percentile_995", 995));

// group
monitors.add(new InformationalMetric<String>(MonitorConfig.builder("commandGroup").build()) {
@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -280,16 +280,6 @@ public HystrixEventType call() {
createExecutionLatencyPercentileGauge("latencyExecute_percentile_99", 99);
createExecutionLatencyPercentileGauge("latencyExecute_percentile_995", 99.5);

createTotalLatencyMeanGauge("latencyTotal_mean");

createTotalLatencyPercentileGauge("latencyTotal_percentile_5", 5);
createTotalLatencyPercentileGauge("latencyTotal_percentile_25", 25);
createTotalLatencyPercentileGauge("latencyTotal_percentile_50", 50);
createTotalLatencyPercentileGauge("latencyTotal_percentile_75", 75);
createTotalLatencyPercentileGauge("latencyTotal_percentile_90", 90);
createTotalLatencyPercentileGauge("latencyTotal_percentile_99", 99);
createTotalLatencyPercentileGauge("latencyTotal_percentile_995", 99.5);

// group
metricsRegistry.newGauge(createMetricName("commandGroup"), new Gauge<String>() {
@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,13 @@ public ExecutionResult markCollapsed(HystrixCollapserKey collapserKey, int sizeO
failedExecutionException, executionException, executionOccurred, isExecutedInThread, collapserKey);
}

/**
* Sets the user-observed latency on this result
* @param userThreadLatency user-visible latency
* @return updated {@link ExecutionResult}
* @deprecated will eventually go away with no replacement, as execution time is now practically identical to this value
*/
@Deprecated
public ExecutionResult markUserThreadCompletion(long userThreadLatency) {
if (startTimestamp > 0 && !isResponseRejected()) {
/* execution time (must occur before terminal state otherwise a race condition can occur if requested by client) */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,9 @@ public int getExecutionTimeMean() {
* @param percentile
* Percentile such as 50, 99, or 99.5.
* @return int time in milliseconds
* @deprecated since 1.5.0, this metrics is practically identical to {@link #getExecutionTimePercentile(double)}/
*/
@Deprecated
public int getTotalTimePercentile(double percentile) {
return rollingCommandUserLatencyDistributionStream.getLatestPercentile(percentile);
}
Expand All @@ -320,7 +322,9 @@ public int getTotalTimePercentile(double percentile) {
* This uses the same backing data as {@link #getTotalTimePercentile};
*
* @return int time in milliseconds
* @deprecated since 1.5.0, this metrics is practically identical to {@link #getExecutionTimeMean()}/
*/
@Deprecated
public int getTotalTimeMean() {
return rollingCommandUserLatencyDistributionStream.getLatestMean();
}
Expand Down

0 comments on commit cf3d12f

Please sign in to comment.