Skip to content

Instantly share code, notes, and snippets.

@ramannanda9
Created July 11, 2022 17:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ramannanda9/eaeae4292a959c4b25037d6e52d0816a to your computer and use it in GitHub Desktop.
Save ramannanda9/eaeae4292a959c4b25037d6e52d0816a to your computer and use it in GitHub Desktop.
class MetricsProvider(abc.ABC):
@abc.abstractmethod
def name():
pass
@abc.abstractmethod
def fetch_metrics(tags:Dict[str,str], strategy: Strategy)->Dict[str, Metric]:
#should fetch metrics, combination happens on server side as per strategy i.e. rolling average to reduce load in data transfer
pass
@abc.abstractmethod
def append_metrics(tags: Dict[str, str], values: Union[Any, pd.Series]) -> None:
#provider responsible for storing metrics on the values
pass
class Metric(abc.ABC):
@abc.abstractmethod
def name():
pass
def to_summary()->Dict[str, Any]:
pass
class DistributionMetric(abc.ABC):
.....
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment