Skip to content

Commit 48b1e05

Browse files
committed
Adding docs
1 parent 8edd955 commit 48b1e05

File tree

4 files changed

+46
-8
lines changed

4 files changed

+46
-8
lines changed

docs/conf.py

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,16 @@
2121
# DJANGO_SETTINGS_MODULE or call settings.configure() before accessing settings.
2222
from django.conf import settings
2323

24+
from opentelemetry.sdk.metrics.instrument import (
25+
_Instrument,
26+
_Synchronous,
27+
_Asynchronous,
28+
_Adding,
29+
_Grouping,
30+
_Monotonic,
31+
_NonMonotonic,
32+
)
33+
2434
settings.configure()
2535

2636
exp = "../exporter"
@@ -177,3 +187,21 @@
177187
"scm_raw_web": (scm_raw_web + "/%s", "scm_raw_web"),
178188
"scm_web": (scm_web + "/%s", "scm_web"),
179189
}
190+
191+
192+
def skip_private_sdk_instrument_classes(app, what, name, obj, skip, options):
193+
194+
return obj in [
195+
_Instrument,
196+
_Synchronous,
197+
_Asynchronous,
198+
_Adding,
199+
_Grouping,
200+
_Monotonic,
201+
_NonMonotonic,
202+
] or None
203+
204+
205+
def setup(app):
206+
# app.connect("autodoc-skip-member", skip_private_sdk_instrument_classes)
207+
pass

docs/sdk/metrics.instrument.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@ opentelemetry.sdk.metrics.instrument
55
:members:
66
:undoc-members:
77
:show-inheritance:
8+
:private-members:

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

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,15 @@
2121

2222

2323
class Aggregator(ABC):
24+
"""Aggregator.
25+
26+
sdfsd
27+
"""
28+
2429
@classmethod
2530
@abstractmethod
2631
def _get_value_name(cls):
32+
"""_get_value_name."""
2733
pass
2834

2935
@abstractmethod
@@ -40,6 +46,10 @@ def aggregate(self, value):
4046

4147
@abstractmethod
4248
def _aggregate(self, new_value):
49+
"""_aggregate.
50+
51+
:param new_value:
52+
"""
4353
pass
4454

4555

@@ -63,7 +73,13 @@ def _get_value_name(cls):
6373
def _get_initial_value(self):
6474
return inf
6575

66-
def _aggregate(self, value):
76+
def _aggregate(self, value: int) -> int:
77+
"""_aggregate.
78+
79+
:param value:
80+
:type value: int
81+
:rtype: int
82+
"""
6783

6884
return min(self._value, value)
6985

@@ -169,9 +185,6 @@ def _aggregate(self, value):
169185

170186

171187
class HistogramAggregator(Aggregator):
172-
"""
173-
The rightmost bin is [], the other ones are [[.
174-
"""
175188

176189
def __init__(self, buckets, *args, **kwargs):
177190

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

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -97,10 +97,6 @@ def shutdown(self):
9797

9898
class MemoryExporter(Exporter):
9999
"""Implementation of `Exporter` that stores metrics in memory.
100-
101-
This class can be used for testing purposes. It stores exported metrics
102-
in a list in memory that can be retrieved using the
103-
:func:`.exported_metrics` property.
104100
"""
105101

106102
def __init__(self):

0 commit comments

Comments
 (0)