public void SingleWithSharedLabels() { for (var i = 0; i < _metricsPerIteration; i++) { OurMetricFactory.CreateHistogram("testhistogram", HelpText, false, null, _labelNames); } }
public void SingleWithLabels_Array() { for (var i = 0; i < _metricsPerIteration; i++) { OurMetricFactory.CreateHistogram("testhistogram", HelpText, false, null, "foo", "bar", "baz"); } }
public void SingleWithLabels_Tuple() { for (var i = 0; i < _metricsPerIteration; i++) { OurMetricFactory.CreateHistogram("testhistogram", HelpText, ("foo", "bar", "baz")); } }
public void ManyWithLabels_Tuple() { for (var i = 0; i < _metricsPerIteration; i++) { OurMetricFactory.CreateHistogram(_metricNames[i], HelpText, ("foo", "bar", "baz")); } }
public void Single() { for (var i = 0; i < _metricsPerIteration; i++) { OurMetricFactory.CreateHistogram("testhistogram", HelpText, ValueTuple.Create()); } }
public void Many() { for (var i = 0; i < _metricsPerIteration; i++) { OurMetricFactory.CreateHistogram(_metricNames[i], HelpText, ValueTuple.Create()); } }
public void ManyWithLabels_Array() { for (var i = 0; i < _metricsPerIteration; i++) { OurMetricFactory.CreateHistogram(_metricNames[i], HelpText, false, null, "foo", "bar", "baz"); } }
public void WithLabels_Tuple() { for (var i = 0; i < _metricsCount; i++) { var histogram = OurMetricFactory.CreateHistogram(_metricNames[i], HelpText, ("foo", "bar", "baz")); histogram.Observe(i / 100d); } }
public void NoLabels() { for (var i = 0; i < _metricsCount; i++) { var histogram = OurMetricFactory.CreateHistogram(_metricNames[i], HelpText); histogram.Observe(i / 100d); } }
public void Setup() { _histogramDefaultBuckets = OurMetricFactory.CreateHistogram("testhistogram1", HelpText); _histogramManyBuckets = OurMetricFactory.CreateHistogram("testhistogram2", HelpText, false, _bucketsMany); _theirHistogramDefaultBuckets = TheirMetricFactory.CreateHistogram("testhistogram1", HelpText); _theirHistogramManyBuckets = TheirMetricFactory.CreateHistogram("testhistogram2", HelpText, new Their.Prometheus.HistogramConfiguration() { Buckets = _bucketsMany }); }
public void WithLabelsAndSamples_Array() { for (var i = 0; i < _metricsCount; i++) { var histogram = OurMetricFactory.CreateHistogram(_metricNames[i], HelpText, "foo", "bar", "baz"); for (var j = 0; j < _samplesCount; j++) { histogram.WithLabels(_labelValues[j][0], _labelValues[j][1], _labelValues[j][2]).Observe(i / 100d); } } }
public HistogramCollectingBenchmarks() { var labelNames = GenerateLabelNames(_labelsCount).ToArray(); var labelVariants = GenerateLabelValues(_variantsCount, _labelsCount); var rnd = new Random(); foreach (var metric in GenerateMetricNames(_metricsCount)) { var ourMetric = OurMetricFactory.CreateHistogram(metric, HelpText, labelNames); var theirMetric = TheirMetricFactory.CreateHistogram(metric, HelpText, labelNames); foreach (var labels in labelVariants) { for (var i = 0; i < _observationsCount; i++) { var val = rnd.Next(10); ourMetric.WithLabels(labels).Observe(val); theirMetric.WithLabels(labels).Observe(val); } } } }