Major fixes and new features
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2025-09-25 15:51:48 +09:00
parent dd7349bb4c
commit ddce9f5125
5586 changed files with 1470941 additions and 0 deletions

View File

@@ -0,0 +1,29 @@
from __future__ import absolute_import
import abc
class AbstractMeasurable(object):
"""A measurable quantity that can be registered as a metric"""
@abc.abstractmethod
def measure(self, config, now):
"""
Measure this quantity and return the result
Arguments:
config (MetricConfig): The configuration for this metric
now (int): The POSIX time in milliseconds the measurement
is being taken
Returns:
The measured value
"""
raise NotImplementedError
class AnonMeasurable(AbstractMeasurable):
def __init__(self, measure_fn):
self._measure_fn = measure_fn
def measure(self, config, now):
return float(self._measure_fn(config, now))