Beispiel #1
0
 public AppMetricSource(MetricSourceOptions options) : base(options)
 {
     _rng                = new Random();
     _requests           = AddCounter("request.hits", "requests", "Number of requests to the application, split by route", new MetricTag <string>("route"));
     _errors             = AddCounter("request.errors", "requests", "Number of errors in the application, split by route and status code", new MetricTag <string>("route"), new MetricTag <int>("status_code"));
     _randomNumber       = AddSamplingGauge("random", "number", "A random number");
     _randomNumberByType = AddSamplingGauge("random.by_type", "number", "A random number, split by an enum", new MetricTag <RandomNumberType>("type"));
 }
Beispiel #2
0
 protected override void UpdateMetric(SamplingGauge metric) => metric.Record(42.123d);