def __init__(self, logger): self._sample_store = {} self._counters = {} self.logger = logger try: self.logger.addFilter(LaconicFilter()) except Exception: self.logger.exception( "Trying to install laconic log filter and failed")
def __init__(self, logger): # where to store samples, indexed by metric_name # metric_name: {("sorted", "tags"): [(ts, value), (ts, value)], # tuple(tags) are stored as a key since lists are not hashable # None: [(ts, value), (ts, value)]} # untagged values are indexed by None self._sample_store = {} self._counters = {} # metric_name: bool self.logger = logger try: self.logger.addFilter(LaconicFilter()) except Exception: self.logger.exception("Trying to install laconic log filter and failed")