Exemplo n.º 1
0
 public void SingleWithLabels_Tuple()
 {
     for (var i = 0; i < _metricsPerIteration; i++)
     {
         OurMetricFactory.CreateGauge("testgauge", HelpText, ("foo", "bar", "baz"));
     }
 }
Exemplo n.º 2
0
        public void Setup()
        {
            _gauge      = OurMetricFactory.CreateGauge("testgauge", HelpText);
            _gaugeInt64 = OurMetricFactory.CreateGaugeInt64("testgaugeInt64", HelpText);

            _theirGauge = TheirMetricFactory.CreateGauge("testgauge", HelpText);
        }
Exemplo n.º 3
0
 public void ManyWithLabels_Tuple()
 {
     for (var i = 0; i < _metricsPerIteration; i++)
     {
         OurMetricFactory.CreateGauge(_metricNames[i], HelpText, ("foo", "bar", "baz"));
     }
 }
Exemplo n.º 4
0
 public void Single()
 {
     for (var i = 0; i < _metricsPerIteration; i++)
     {
         OurMetricFactory.CreateGauge("testgauge", HelpText, ValueTuple.Create());
     }
 }
Exemplo n.º 5
0
 public void SingleWithSharedLabels_Array()
 {
     for (var i = 0; i < _metricsPerIteration; i++)
     {
         OurMetricFactory.CreateGauge("testgauge", HelpText, false, _labelNames);
     }
 }
Exemplo n.º 6
0
 public void Many()
 {
     for (var i = 0; i < _metricsPerIteration; i++)
     {
         OurMetricFactory.CreateGauge(_metricNames[i], HelpText, ValueTuple.Create());
     }
 }
 public void Gauge_ManyTuple()
 {
     for (var i = 0; i < _metricsPerIteration; i++)
     {
         OurMetricFactory.CreateGauge(_metricNames[i], _help);
     }
 }
 public void Gauge_ManyWithLabels()
 {
     for (var i = 0; i < _metricsPerIteration; i++)
     {
         OurMetricFactory.CreateGauge(_metricNames[i], _help, MetricFlags.Default, "foo", "bar", "baz");
     }
 }
 public void Gauge_SingleSharedLabels()
 {
     for (var i = 0; i < _metricsPerIteration; i++)
     {
         OurMetricFactory.CreateGauge("testgauge", _help, MetricFlags.Default, _labelNames);
     }
 }
 public void Gauge_SingleLabelsTuple()
 {
     for (var i = 0; i < _metricsPerIteration; i++)
     {
         OurMetricFactory.CreateGauge("testgauge", _help, ("foo", "bar", "baz"));
     }
 }
 public void Gauge_SingleLabels()
 {
     for (var i = 0; i < _metricsPerIteration; i++)
     {
         OurMetricFactory.CreateGauge("testgauge", _help, MetricFlags.Default, "foo", "bar", "baz");
     }
 }
 public void Gauge_Single()
 {
     for (var i = 0; i < _metricsPerIteration; i++)
     {
         OurMetricFactory.CreateGauge("testgauge", _help);
     }
 }
Exemplo n.º 13
0
 public void WithLabels_Tuple()
 {
     for (var i = 0; i < _metricsCount; i++)
     {
         var gauge = OurMetricFactory.CreateGauge(_metricNames[i], HelpText, ("foo", "bar", "baz"));
         gauge.Inc();
     }
 }
Exemplo n.º 14
0
 public void NoLabels()
 {
     for (var i = 0; i < _metricsCount; i++)
     {
         var gauge = OurMetricFactory.CreateGauge(_metricNames[i], HelpText);
         gauge.Inc();
     }
 }
Exemplo n.º 15
0
 public void WithLabelsAndSamples_Tuple()
 {
     for (var i = 0; i < _metricsCount; i++)
     {
         var gauge = OurMetricFactory.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);
                }
            }
        }