use of com.linkedin.cruisecontrol.monitor.sampling.MetricSample in project cruise-control by linkedin.
the class CruiseControlUnitTestUtils method populateSampleAggregator.
public static <G, E extends Entity<G>> void populateSampleAggregator(int numWindows, int numSamplesPerWindow, MetricSampleAggregator<G, E> metricSampleAggregator, E entity, int startingWindow, long windowMs, MetricDef metricDef) {
for (int i = startingWindow; i < numWindows + startingWindow; i++) {
for (int j = 0; j < numSamplesPerWindow; j++) {
MetricSample<G, E> sample = new MetricSample<>(entity);
for (MetricInfo metricInfo : metricDef.all()) {
sample.record(metricInfo, i * 10 + j);
}
sample.close(i * windowMs + 1);
metricSampleAggregator.addSample(sample);
}
}
}
use of com.linkedin.cruisecontrol.monitor.sampling.MetricSample in project cruise-control by linkedin.
the class RawMetricValuesTest method getMetricSample.
private MetricSample<String, IntegerEntity> getMetricSample(float v1, float v2, float v3) {
MetricSample<String, IntegerEntity> metricSample = new MetricSample<>(new IntegerEntity("group", 0));
metricSample.record(_metricDef.metricInfo("metric1"), v1);
metricSample.record(_metricDef.metricInfo("metric2"), v2);
metricSample.record(_metricDef.metricInfo("metric3"), v3);
metricSample.close(0);
return metricSample;
}
Aggregations