mirror of
https://github.com/google/nomulus
synced 2026-01-10 07:57:58 +00:00
Enforce monotonicity for IncrementableMetrics
This change enforces that IncrementableMetrics should only monotonically increase in value, and adds a new increment() method to increment by one, which is slightly faster than incrementBy (due to a lack of non-negative checking) in the common case that the counter should only be incremented by one. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=130578421
This commit is contained in:
@@ -195,7 +195,7 @@ public class StackdriverWriter implements MetricWriter {
|
||||
monitoringClient.projects().timeSeries().create(projectResource, request).execute();
|
||||
|
||||
for (TimeSeries timeSeries : timeSeriesList) {
|
||||
pushedPoints.incrementBy(1, timeSeries.getMetricKind(), timeSeries.getValueType());
|
||||
pushedPoints.increment(timeSeries.getMetricKind(), timeSeries.getValueType());
|
||||
}
|
||||
logger.info(String.format("Flushed %d metrics to Stackdriver", timeSeriesList.size()));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user