Search in sources :

Example 1 with MeasureMap

use of io.opencensus.stats.MeasureMap in project instrumentation-java by census-instrumentation.

the class RecordBatchedBenchmark method recordBatchedLongCount.

/**
 * Record batched long count measures.
 */
@Benchmark
@BenchmarkMode(Mode.AverageTime)
@OutputTimeUnit(TimeUnit.NANOSECONDS)
public MeasureMap recordBatchedLongCount(Data data) {
    MeasureMap map = data.recorder.newMeasureMap();
    for (int i = 0; i < data.numValues; i++) {
        map.put(StatsBenchmarksUtil.LONG_COUNT_MEASURES[i], i);
    }
    map.record(data.tags);
    return map;
}
Also used : MeasureMap(io.opencensus.stats.MeasureMap) BenchmarkMode(org.openjdk.jmh.annotations.BenchmarkMode) Benchmark(org.openjdk.jmh.annotations.Benchmark) OutputTimeUnit(org.openjdk.jmh.annotations.OutputTimeUnit)

Example 2 with MeasureMap

use of io.opencensus.stats.MeasureMap in project instrumentation-java by census-instrumentation.

the class RecordBatchedBenchmark method recordBatchedDoubleSum.

/**
 * Record batched double sum measures.
 */
@Benchmark
@BenchmarkMode(Mode.AverageTime)
@OutputTimeUnit(TimeUnit.NANOSECONDS)
public MeasureMap recordBatchedDoubleSum(Data data) {
    MeasureMap map = data.recorder.newMeasureMap();
    for (int i = 0; i < data.numValues; i++) {
        map.put(StatsBenchmarksUtil.DOUBLE_SUM_MEASURES[i], (double) i);
    }
    map.record(data.tags);
    return map;
}
Also used : MeasureMap(io.opencensus.stats.MeasureMap) BenchmarkMode(org.openjdk.jmh.annotations.BenchmarkMode) Benchmark(org.openjdk.jmh.annotations.Benchmark) OutputTimeUnit(org.openjdk.jmh.annotations.OutputTimeUnit)

Example 3 with MeasureMap

use of io.opencensus.stats.MeasureMap in project instrumentation-java by census-instrumentation.

the class RecordBatchedBenchmark method recordBatchedDoubleCount.

/**
 * Record batched double count measures.
 */
@Benchmark
@BenchmarkMode(Mode.AverageTime)
@OutputTimeUnit(TimeUnit.NANOSECONDS)
public MeasureMap recordBatchedDoubleCount(Data data) {
    MeasureMap map = data.recorder.newMeasureMap();
    for (int i = 0; i < data.numValues; i++) {
        map.put(StatsBenchmarksUtil.DOUBLE_COUNT_MEASURES[i], (double) i);
    }
    map.record(data.tags);
    return map;
}
Also used : MeasureMap(io.opencensus.stats.MeasureMap) BenchmarkMode(org.openjdk.jmh.annotations.BenchmarkMode) Benchmark(org.openjdk.jmh.annotations.Benchmark) OutputTimeUnit(org.openjdk.jmh.annotations.OutputTimeUnit)

Example 4 with MeasureMap

use of io.opencensus.stats.MeasureMap in project instrumentation-java by census-instrumentation.

the class RecordBatchedBenchmark method recordBatchedDoubleDistribution.

/**
 * Record batched double distribution measures.
 */
@Benchmark
@BenchmarkMode(Mode.AverageTime)
@OutputTimeUnit(TimeUnit.NANOSECONDS)
public MeasureMap recordBatchedDoubleDistribution(Data data) {
    MeasureMap map = data.recorder.newMeasureMap();
    for (int i = 0; i < data.numValues; i++) {
        map.put(StatsBenchmarksUtil.DOUBLE_DISTRIBUTION_MEASURES[i], (double) i);
    }
    map.record(data.tags);
    return map;
}
Also used : MeasureMap(io.opencensus.stats.MeasureMap) BenchmarkMode(org.openjdk.jmh.annotations.BenchmarkMode) Benchmark(org.openjdk.jmh.annotations.Benchmark) OutputTimeUnit(org.openjdk.jmh.annotations.OutputTimeUnit)

Example 5 with MeasureMap

use of io.opencensus.stats.MeasureMap in project instrumentation-java by census-instrumentation.

the class RecordBatchedBenchmark method recordBatchedDoubleLastValue.

/**
 * Record batched double last value measures.
 */
@Benchmark
@BenchmarkMode(Mode.AverageTime)
@OutputTimeUnit(TimeUnit.NANOSECONDS)
public MeasureMap recordBatchedDoubleLastValue(Data data) {
    MeasureMap map = data.recorder.newMeasureMap();
    for (int i = 0; i < data.numValues; i++) {
        map.put(StatsBenchmarksUtil.DOUBLE_LASTVALUE_MEASURES[i], (double) i);
    }
    map.record(data.tags);
    return map;
}
Also used : MeasureMap(io.opencensus.stats.MeasureMap) BenchmarkMode(org.openjdk.jmh.annotations.BenchmarkMode) Benchmark(org.openjdk.jmh.annotations.Benchmark) OutputTimeUnit(org.openjdk.jmh.annotations.OutputTimeUnit)

Aggregations

MeasureMap (io.opencensus.stats.MeasureMap)19 Benchmark (org.openjdk.jmh.annotations.Benchmark)8 BenchmarkMode (org.openjdk.jmh.annotations.BenchmarkMode)8 OutputTimeUnit (org.openjdk.jmh.annotations.OutputTimeUnit)8 View (io.opencensus.stats.View)4 StatsTestUtil.createEmptyViewData (io.opencensus.implcore.stats.StatsTestUtil.createEmptyViewData)3 ViewData (io.opencensus.stats.ViewData)3 TagContext (io.opencensus.tags.TagContext)3 Scope (io.opencensus.common.Scope)2 SimpleTagContext (io.opencensus.implcore.stats.StatsTestUtil.SimpleTagContext)2 Test (org.junit.Test)2 LastValue (io.opencensus.stats.Aggregation.LastValue)1 Measure (io.opencensus.stats.Measure)1 MeasureDouble (io.opencensus.stats.Measure.MeasureDouble)1 MeasureLong (io.opencensus.stats.Measure.MeasureLong)1 Stats (io.opencensus.stats.Stats)1 StatsRecorder (io.opencensus.stats.StatsRecorder)1 Name (io.opencensus.stats.View.Name)1 TagContextBuilder (io.opencensus.tags.TagContextBuilder)1 TagKey (io.opencensus.tags.TagKey)1