From 2da3f49d7496d38cf606dde2e068cd23608ef4c9 Mon Sep 17 00:00:00 2001 From: dengliming Date: Sat, 15 Aug 2020 10:55:30 +0800 Subject: [PATCH 1/2] Fix typo in document. --- doc/batcher-api.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/batcher-api.md b/doc/batcher-api.md index 7c9092ff156..9ea5154be7e 100644 --- a/doc/batcher-api.md +++ b/doc/batcher-api.md @@ -56,7 +56,7 @@ import { export class CustomBatcher extends UngroupedBatcher { aggregatorFor (metricDescriptor: MetricDescriptor) { - if (metricDescriptor.labels === 'metricToBeAveraged') { + if (metricDescriptor.name === 'requests') { return new AverageAggregator(10); } // this is exactly what the "UngroupedBatcher" does, we will re-use it From bd00de793a0a527003ebcc7136ec496453d340b9 Mon Sep 17 00:00:00 2001 From: dengliming Date: Mon, 17 Aug 2020 20:22:05 +0800 Subject: [PATCH 2/2] Rename the createMeasure to createValueRecorder --- doc/batcher-api.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/batcher-api.md b/doc/batcher-api.md index 9ea5154be7e..7cb7c9c0360 100644 --- a/doc/batcher-api.md +++ b/doc/batcher-api.md @@ -138,7 +138,7 @@ const meter = new MeterProvider({ interval: 1000, }).getMeter('example-custom-batcher'); -const requestsLatency = meter.createMeasure('requests', { +const requestsLatency = meter.createValueRecorder('requests', { monotonic: true, description: 'Average latency' });