Skip to content

Commit

Permalink
Add args again
Browse files Browse the repository at this point in the history
This reverts commit 7eb6134.
  • Loading branch information
ocelotl committed May 4, 2022
1 parent 7eb6134 commit e45c7c3
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -169,9 +169,9 @@ def _translate_data(
)

def export(
self, metrics: Sequence[Metric], **kwargs
self, metrics: Sequence[Metric], *args, **kwargs
) -> MetricExportResult:
return self._export(metrics)

def shutdown(self, **kwargs):
def shutdown(self, *args, **kwargs):
pass
Original file line number Diff line number Diff line change
Expand Up @@ -110,12 +110,14 @@ def __init__(self, prefix: str = "") -> None:
REGISTRY.register(self._collector)
self._collector._callback = self.collect

def _receive_metrics(self, metrics: Iterable[Metric], **kwargs) -> None:
def _receive_metrics(
self, metrics: Iterable[Metric], *args, **kwargs
) -> None:
if metrics is None:
return
self._collector.add_metrics_data(metrics)

def shutdown(self, **kwargs) -> bool:
def shutdown(self, *args, **kwargs) -> bool:
REGISTRY.unregister(self._collector)
return True

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,21 +32,18 @@

class MeasurementConsumer(ABC):
@abstractmethod
def consume_measurement(self, measurement: Measurement, **kwargs) -> None:
def consume_measurement(self, measurement: Measurement) -> None:
pass

@abstractmethod
def register_asynchronous_instrument(
self, instrument: "_Asynchronous", **kwargs
):
def register_asynchronous_instrument(self, instrument: "_Asynchronous"):
pass

@abstractmethod
def collect(
self,
metric_reader: MetricReader,
instrument_type_temporality: Dict[type, AggregationTemporality],
**kwargs
) -> Iterable[Metric]:
pass

Expand All @@ -64,12 +61,12 @@ def __init__(self, sdk_config: SdkConfiguration) -> None:
}
self._async_instruments: List["_Asynchronous"] = []

def consume_measurement(self, measurement: Measurement, **kwargs) -> None:
def consume_measurement(self, measurement: Measurement) -> None:
for reader_storage in self._reader_storages.values():
reader_storage.consume_measurement(measurement)

def register_asynchronous_instrument(
self, instrument: "_Asynchronous", **kwargs
self, instrument: "_Asynchronous"
) -> None:
with self._lock:
self._async_instruments.append(instrument)
Expand All @@ -78,7 +75,6 @@ def collect(
self,
metric_reader: MetricReader,
instrument_type_temporality: Dict[type, AggregationTemporality],
**kwargs
) -> Iterable[Metric]:
with self._lock:
metric_reader_storage = self._reader_storages[metric_reader]
Expand Down

0 comments on commit e45c7c3

Please sign in to comment.