示例#1
0
        public void Setup()
        {
            _gauge      = OurMetricFactory.CreateGauge("testgauge", HelpText);
            _gaugeInt64 = OurMetricFactory.CreateGaugeInt64("testgaugeInt64", HelpText);

            _theirGauge = TheirMetricFactory.CreateGauge("testgauge", HelpText);
        }
示例#2
0
 public void Single_Baseline()
 {
     for (var i = 0; i < _metricsPerIteration; i++)
     {
         TheirMetricFactory.CreateGauge("testgauge", HelpText);
     }
 }
示例#3
0
 public void SingleWithLabels_Baseline()
 {
     for (var i = 0; i < _metricsPerIteration; i++)
     {
         TheirMetricFactory.CreateGauge("testgauge", HelpText, "foo", "bar", "baz");
     }
 }
示例#4
0
 public void Many_Baseline()
 {
     for (var i = 0; i < _metricsPerIteration; i++)
     {
         TheirMetricFactory.CreateGauge(_metricNames[i], HelpText);
     }
 }
示例#5
0
 public void ManyWithLabels_Baseline()
 {
     for (var i = 0; i < _metricsPerIteration; i++)
     {
         TheirMetricFactory.CreateGauge(_metricNames[i], HelpText, "foo", "bar", "baz");
     }
 }
 public void Gauge_ManyWithLabelsBaseLine()
 {
     for (var i = 0; i < _metricsPerIteration; i++)
     {
         TheirMetricFactory.CreateGauge(_metricNames[i], _help, "foo", "bar", "baz");
     }
 }
示例#7
0
 public void SingleWithSharedLabels_Baseline()
 {
     for (var i = 0; i < _metricsPerIteration; i++)
     {
         TheirMetricFactory.CreateGauge("testgauge", HelpText, _labelNames);
     }
 }
 public void Gauge_ManyBaseLine()
 {
     for (var i = 0; i < _metricsPerIteration; i++)
     {
         TheirMetricFactory.CreateGauge(_metricNames[i], _help);
     }
 }
 public void Gauge_SingleSharedLabelsBaseLine()
 {
     for (var i = 0; i < _metricsPerIteration; i++)
     {
         TheirMetricFactory.CreateGauge("testgauge", _help, _labelNames);
     }
 }
 public void Gauge_SingleLabelsBaseLine()
 {
     for (var i = 0; i < _metricsPerIteration; i++)
     {
         TheirMetricFactory.CreateGauge("testgauge", _help, "foo", "bar", "baz");
     }
 }
 public void Gauge_SingleBaseLine()
 {
     for (var i = 0; i < _metricsPerIteration; i++)
     {
         TheirMetricFactory.CreateGauge("testgauge", _help);
     }
 }
示例#12
0
 public void WithLabels_Baseline()
 {
     for (var i = 0; i < _metricsCount; i++)
     {
         var gauge = TheirMetricFactory.CreateGauge(_metricNames[i], HelpText, "foo", "bar", "baz");
         gauge.Inc();
     }
 }
示例#13
0
 public void WithLabelsAndSamples_Baseline()
 {
     for (var i = 0; i < _metricsCount; i++)
     {
         var gauge = TheirMetricFactory.CreateGauge(_metricNames[i], HelpText, "foo", "bar", "baz");
         for (var j = 0; j < _samplesCount; j++)
         {
             gauge.WithLabels(_labelValues[j][0], _labelValues[j][1], _labelValues[j][2]).Inc();
         }
     }
 }
        public GaugeCollectingBenchmarks()
        {
            var labelNames    = GenerateLabelNames(_labelsCount);
            var labelVariants = GenerateLabelValues(_variantsCount, _labelsCount);
            var rnd           = new Random();

            foreach (var metric in GenerateMetricNames(_metricsCount))
            {
                var ourMetric   = OurMetricFactory.CreateGauge(metric, _helpText, labelNames);
                var theirMetric = TheirMetricFactory.CreateGauge(metric, _helpText, labelNames);

                foreach (var labels in labelVariants)
                {
                    var val = rnd.Next(10000);
                    ourMetric.WithLabels(labels).Inc(val);
                    theirMetric.WithLabels(labels).Inc(val);
                }
            }
        }