Exemplo n.º 1
0
        public void Setup()
        {
            _counter      = OurMetricFactory.CreateCounter("testcounter", string.Empty);
            _counterInt64 = OurMetricFactory.CreateCounterInt64("testcounterInt64", string.Empty);

            _theirCounter = TheirMetricFactory.CreateCounter("testcounter", string.Empty);
        }
 public void Counter_SingleLabelsBaseLine()
 {
     for (var i = 0; i < _metricsPerIteration; i++)
     {
         TheirMetricFactory.CreateCounter("testcounter", _help, "foo", "bar", "baz");
     }
 }
 public void Counter_ManyWithLabelsBaseLine()
 {
     for (var i = 0; i < _metricsPerIteration; i++)
     {
         TheirMetricFactory.CreateCounter(_metricNames[i], _help, "foo", "bar", "baz");
     }
 }
 public void Counter_SingleBaseLine()
 {
     for (var i = 0; i < _metricsPerIteration; i++)
     {
         TheirMetricFactory.CreateCounter("testcounter", _help);
     }
 }
 public void Counter_SingleSharedLabelsBaseLine()
 {
     for (var i = 0; i < _metricsPerIteration; i++)
     {
         TheirMetricFactory.CreateCounter("testcounter", _help, _labelNames);
     }
 }
 public void Counter_ManyBaseLine()
 {
     for (var i = 0; i < _metricsPerIteration; i++)
     {
         TheirMetricFactory.CreateCounter(_metricNames[i], _help);
     }
 }
Exemplo n.º 7
0
 public void SingleWithLabels_Baseline()
 {
     for (var i = 0; i < _metricsPerIteration; i++)
     {
         TheirMetricFactory.CreateCounter("testcounter", HelpText, "foo", "bar", "baz");
     }
 }
Exemplo n.º 8
0
 public void Single_Baseline()
 {
     for (var i = 0; i < _metricsPerIteration; i++)
     {
         TheirMetricFactory.CreateCounter("testcounter", HelpText);
     }
 }
Exemplo n.º 9
0
 public void ManyWithLabels_Baseline()
 {
     for (var i = 0; i < _metricsPerIteration; i++)
     {
         TheirMetricFactory.CreateCounter(_metricNames[i], HelpText, "foo", "bar", "baz");
     }
 }
Exemplo n.º 10
0
 public void Many_Baseline()
 {
     for (var i = 0; i < _metricsPerIteration; i++)
     {
         TheirMetricFactory.CreateCounter(_metricNames[i], HelpText);
     }
 }
Exemplo n.º 11
0
 public void SingleWithSharedLabels_Baseline()
 {
     for (var i = 0; i < _metricsPerIteration; i++)
     {
         TheirMetricFactory.CreateCounter("testcounter", HelpText, _labelNames);
     }
 }
Exemplo n.º 12
0
 public void WithLabels_Baseline()
 {
     for (var i = 0; i < _metricsCount; i++)
     {
         var counter = TheirMetricFactory.CreateCounter(_metricNames[i], HelpText, "foo", "bar", "baz");
         counter.Inc();
     }
 }
Exemplo n.º 13
0
 public void WithLabelsAndSamples_Baseline()
 {
     for (var i = 0; i < _metricsCount; i++)
     {
         var counter = TheirMetricFactory.CreateCounter(_metricNames[i], HelpText, "foo", "bar", "baz");
         for (var j = 0; j < _labelValues.Length; j++)
         {
             counter.WithLabels(_labelValues[j][0], _labelValues[j][1], _labelValues[j][2]).Inc();
         }
     }
 }
        public CounterCollectingBenchmarks()
        {
            var labelNames    = GenerateLabelNames(_labelsCount).ToArray();
            var labelVariants = GenerateLabelValues(_variantsCount, _labelsCount);
            var rnd           = new Random();

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

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