Skip to content

Commit d556b90

Browse files
author
Azfaar Qureshi
authored
Renaming Meter to Accumulator in Metrics SDK context (open-telemetry#1372)
1 parent 3923c4d commit d556b90

File tree

5 files changed

+15
-12
lines changed

5 files changed

+15
-12
lines changed

opentelemetry-instrumentation/tests/test_metric.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ def test_init(self):
4141
mixin = MetricMixin()
4242
mixin.init_metrics("test", 1.0)
4343
meter = mixin.meter
44-
self.assertTrue(isinstance(meter, metrics.Meter))
44+
self.assertTrue(isinstance(meter, metrics.Accumulator))
4545
self.assertEqual(meter.instrumentation_info.name, "test")
4646
self.assertEqual(meter.instrumentation_info.version, 1.0)
4747

opentelemetry-sdk/CHANGELOG.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,10 @@
88
([#1314](https://github.com/open-telemetry/opentelemetry-python/pull/1314))
99
- Update exception handling optional parameters, add escaped attribute to record_exception
1010
([#1365](https://github.com/open-telemetry/opentelemetry-python/pull/1365))
11-
- Rename Record in Metrics SDK to Accumulation ([#1373](https://github.com/open-telemetry/opentelemetry-python/pull/1373))
11+
- Rename Record in Metrics SDK to Accumulation
12+
([#1373](https://github.com/open-telemetry/opentelemetry-python/pull/1373))
13+
- Rename Meter class to Accumulator in Metrics SDK
14+
([#1372](https://github.com/open-telemetry/opentelemetry-python/pull/1372))
1215

1316
## Version 0.15b0
1417

opentelemetry-sdk/src/opentelemetry/sdk/metrics/__init__.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ def __init__(
145145
description: str,
146146
unit: str,
147147
value_type: Type[metrics_api.ValueT],
148-
meter: "Meter",
148+
meter: "Accumulator",
149149
enabled: bool = True,
150150
):
151151
self.name = name
@@ -339,7 +339,7 @@ def __init__(
339339
self.aggregator = aggregator
340340

341341

342-
class Meter(metrics_api.Meter):
342+
class Accumulator(metrics_api.Meter):
343343
"""See `opentelemetry.metrics.Meter`.
344344
345345
Args:
@@ -561,7 +561,7 @@ def get_meter(
561561
if not instrumenting_module_name: # Reject empty strings too.
562562
instrumenting_module_name = "ERROR:MISSING MODULE NAME"
563563
logger.error("get_meter called with missing module name.")
564-
return Meter(
564+
return Accumulator(
565565
self,
566566
InstrumentationInfo(
567567
instrumenting_module_name, instrumenting_library_version

opentelemetry-sdk/src/opentelemetry/sdk/metrics/export/controller.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,18 +26,18 @@ class PushController(threading.Thread):
2626
exports them and performs some post-processing.
2727
2828
Args:
29-
meter: The meter used to collect metrics.
29+
accumulator: The meter used to collect metrics.
3030
exporter: The exporter used to export metrics.
3131
interval: The collect/export interval in seconds.
3232
"""
3333

3434
daemon = True
3535

3636
def __init__(
37-
self, meter: Meter, exporter: MetricsExporter, interval: float
37+
self, accumulator: Meter, exporter: MetricsExporter, interval: float
3838
):
3939
super().__init__()
40-
self.meter = meter
40+
self.accumulator = accumulator
4141
self.exporter = exporter
4242
self.interval = interval
4343
self.finished = threading.Event()
@@ -54,10 +54,10 @@ def shutdown(self):
5454

5555
def tick(self):
5656
# Collect all of the meter's metrics to be exported
57-
self.meter.collect()
57+
self.accumulator.collect()
5858
# Export the collected metrics
5959
token = attach(set_value("suppress_instrumentation", True))
60-
self.exporter.export(self.meter.processor.checkpoint_set())
60+
self.exporter.export(self.accumulator.processor.checkpoint_set())
6161
detach(token)
6262
# Perform post-exporting logic
63-
self.meter.processor.finished_collection()
63+
self.accumulator.processor.finished_collection()

opentelemetry-sdk/src/opentelemetry/sdk/metrics/export/processor.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ class Processor:
2323
"""Base class for all processor types.
2424
2525
The processor is responsible for storing the aggregators and aggregated
26-
values received from updates from metrics in the meter. The stored values
26+
values received from updates from metrics in the accumulator. The stored values
2727
will be sent to an exporter for exporting.
2828
"""
2929

0 commit comments

Comments
 (0)