Exemplo n.º 1
0
    def report(self, batch: metrics.Batch) -> None:
        # gevent events come in on another thread. we're relying on the GIL to
        # keep us from shenanigans here and we swap things out semi-safely to
        # ensure minimal lost data.
        times_blocked = self.times_blocked
        self.times_blocked = []

        for time_blocked in times_blocked:
            batch.timer("hub_blocked").send(time_blocked)
Exemplo n.º 2
0
 def __init__(self,
              batch: metrics.Batch,
              span: Span,
              sample_rate: float = 1.0):
     self.batch = batch
     self.timer = batch.timer(f"{span.component_name}.{span.name}")
     self.sample_rate = sample_rate
Exemplo n.º 3
0
 def __init__(self,
              batch: metrics.Batch,
              span: Span,
              sample_rate: float = 1.0):
     self.batch = batch
     self.base_name = f"clients.{span.name}"
     self.timer = batch.timer(self.base_name)
     self.sample_rate = sample_rate
Exemplo n.º 4
0
 def __init__(self,
              batch: metrics.Batch,
              server_span: Span,
              sample_rate: float = 1.0):
     self.batch = batch
     self.base_name = "server." + server_span.name
     self.timer = batch.timer(self.base_name)
     self.sample_rate = sample_rate
Exemplo n.º 5
0
 def __init__(self,
              batch: metrics.Batch,
              span: Span,
              sample_rate: float = 1.0):
     self.batch = batch
     self.timer = batch.timer(
         typing.cast(str, span.component_name) + "." + span.name)
     self.sample_rate = sample_rate
Exemplo n.º 6
0
 def __init__(
     self, batch: metrics.Batch, span: Span, whitelist: Set[str], sample_rate: float = 1.0
 ):
     self.batch = batch
     self.span = span
     self.tags: Dict[str, Any] = {}
     self.timer = batch.timer("baseplate.local")
     self.whitelist = whitelist
     self.counters: Dict[str, float] = {}
     self.sample_rate = sample_rate
Exemplo n.º 7
0
 def __init__(
     self, batch: metrics.Batch, server_span: Span, allowlist: Set[str], sample_rate: float = 1.0
 ):
     self.batch = batch
     self.span = server_span
     self.base_name = "baseplate.server"
     self.allowlist = allowlist
     self.tags: Dict[str, Any] = {}
     self.timer = batch.timer(f"{self.base_name}.latency")
     self.counters: Dict[str, float] = {}
     self.sample_rate = sample_rate
Exemplo n.º 8
0
 def __init__(self, batch: metrics.Batch, span: Span):
     self.batch = batch
     self.base_name = f"clients.{span.name}"
     self.timer = batch.timer(self.base_name)
Exemplo n.º 9
0
 def __init__(self, batch: metrics.Batch, span: Span):
     self.batch = batch
     self.timer = batch.timer(
         typing.cast(str, span.component_name) + "." + span.name)
Exemplo n.º 10
0
 def __init__(self, batch: metrics.Batch, server_span: Span):
     self.batch = batch
     self.base_name = "server." + server_span.name
     self.timer = batch.timer(self.base_name)
Exemplo n.º 11
0
    def report(self, batch: metrics.Batch) -> None:
        gc_durations = self.gc_durations
        self.gc_durations = []

        for gc_duration in gc_durations:
            batch.timer("gc.elapsed").send(gc_duration)