public void Single()
 {
     for (var i = 0; i < _metricsPerIteration; i++)
     {
         OurMetricFactory.CreateSummary("testsummary", HelpText, ValueTuple.Create());
     }
 }
 public void ManyWithLabels_Tuple()
 {
     for (var i = 0; i < _metricsPerIteration; i++)
     {
         OurMetricFactory.CreateSummary(_metricNames[i], HelpText, ("foo", "bar", "baz"));
     }
 }
 public void Many()
 {
     for (var i = 0; i < _metricsPerIteration; i++)
     {
         OurMetricFactory.CreateSummary(_metricNames[i], HelpText, ValueTuple.Create());
     }
 }
 public void WithLabels_Tuple()
 {
     for (var i = 0; i < _metricsCount; i++)
     {
         var summary = OurMetricFactory.CreateSummary(_metricNames[i], HelpText, ("foo", "bar", "baz"));
         summary.Observe(i / 100d);
     }
 }
 public void NoLabels()
 {
     for (var i = 0; i < _metricsCount; i++)
     {
         var summary = OurMetricFactory.CreateSummary(_metricNames[i], HelpText);
         summary.Observe(i / 100d);
     }
 }
 public void WithLabelsAndSamples_Array()
 {
     for (var i = 0; i < _metricsCount; i++)
     {
         var summary = OurMetricFactory.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;
            }
        }
Beispiel #8
0
        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);
                    }
                }
            }
        }