public void Many_Baseline() { for (var i = 0; i < _metricsPerIteration; i++) { TheirMetricFactory.CreateSummary(_metricNames[i], HelpText); } }
public void SingleWithSharedLabels_Baseline() { for (var i = 0; i < _metricsPerIteration; i++) { TheirMetricFactory.CreateSummary("testsummary", HelpText, _labelNames); } }
public void SingleLabels_Baseline() { for (var i = 0; i < _metricsPerIteration; i++) { TheirMetricFactory.CreateSummary("testsummary", HelpText, "foo", "bar", "baz"); } }
public void Single_Baseline() { for (var i = 0; i < _metricsPerIteration; i++) { TheirMetricFactory.CreateSummary("testsummary", HelpText); } }
public void ManyWithLabels_Baseline() { for (var i = 0; i < _metricsPerIteration; i++) { TheirMetricFactory.CreateSummary(_metricNames[i], HelpText, "foo", "bar", "baz"); } }
public void WithLabels_Baseline() { for (var i = 0; i < _metricsCount; i++) { var summary = TheirMetricFactory.CreateSummary(_metricNames[i], HelpText, "foo", "bar", "baz"); summary.Observe(i / 100d); } }
public void WithLabelsAndSamples_Baseline() { for (var i = 0; i < _metricsCount; i++) { var summary = TheirMetricFactory.CreateSummary(_metricNames[i], HelpText, "foo", "bar", "baz"); for (var j = 0; j < _samplesCount; j++) { summary.WithLabels(_labelValues[j][0], _labelValues[j][1], _labelValues[j][2]).Observe(i / 100d); } } }
public void Setup() { _summary = OurMetricFactory.CreateSummary("testSummary1", HelpText); _theirSummary = TheirMetricFactory.CreateSummary("testSummary1", HelpText); _dataset = new double[_opIterations]; var rnd = new Random(); for (int i = 0; i < _opIterations; i++) { _dataset[i] = rnd.NextDouble() * 100_000d; } }
public SummaryCollectingBenchmarks() { var labelNames = GenerateLabelNames(_labelsCount).ToArray(); var labelVariants = GenerateLabelValues(_variantsCount, _labelsCount); var rnd = new Random(); foreach (var metric in GenerateMetricNames(_metricsCount, 0)) { var ourMetric = OurMetricFactory.CreateSummary(metric, HelpText, labelNames); var theirMetric = TheirMetricFactory.CreateSummary(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); } } } }