Ejemplo n.º 1
0
        public void should_retain_the_min_updated_value()
        {
            var gauge = new MinGauge(new MetricConfig("min1"));

            gauge.Update(42L);

            Measure measure = Testing.Sync <Measure>(gauge, gauge.GetMeasure, gauge.context_);

            Assert.That(measure.Value, Is.EqualTo(42.0));

            gauge = new MinGauge(new MetricConfig("min1"));
            gauge.Update(42L);
            gauge.Update(420L);

            measure = Testing.Sync <Measure>(gauge, gauge.GetMeasure, gauge.context_);
            Assert.That(measure.Value, Is.EqualTo(42.0));

            gauge = new MinGauge(new MetricConfig("min1"));
            gauge.Update(42L);
            gauge.Update(420L);
            gauge.Update(1L);

            measure = Testing.Sync <Measure>(gauge, gauge.GetMeasure, gauge.context_);
            Assert.That(measure.Value, Is.EqualTo(1.0));
        }
Ejemplo n.º 2
0
    public void should_reset_the_gauge() {
      var min = new MinGauge(new MetricConfig("min2"));
      min.Update(42L);

      Measure measure = Testing.Sync<Measure>(min, min.GetMeasure, min.context_);
      Assert.That(measure.Value, Is.EqualTo(42L));

      min.Reset();
      min.Update(50L);
      measure = Testing.Sync<Measure>(min, min.GetMeasure, min.context_);
      Assert.That(measure.Value, Is.EqualTo(50D));
    }
Ejemplo n.º 3
0
        public void should_reset_the_gauge()
        {
            var min = new MinGauge(new MetricConfig("min2"));

            min.Update(42L);

            Measure measure = Testing.Sync <Measure>(min, min.GetMeasure, min.context_);

            Assert.That(measure.Value, Is.EqualTo(42L));

            min.Reset();
            min.Update(50L);
            measure = Testing.Sync <Measure>(min, min.GetMeasure, min.context_);
            Assert.That(measure.Value, Is.EqualTo(50D));
        }
Ejemplo n.º 4
0
    public void should_retain_the_min_updated_value() {
      var gauge = new MinGauge(new MetricConfig("min1"));
      gauge.Update(42L);

      Measure measure = Testing.Sync<Measure>(gauge, gauge.GetMeasure, gauge.context_);
      Assert.That(measure.Value, Is.EqualTo(42.0));

      gauge = new MinGauge(new MetricConfig("min1"));
      gauge.Update(42L);
      gauge.Update(420L);

      measure = Testing.Sync<Measure>(gauge, gauge.GetMeasure, gauge.context_);
      Assert.That(measure.Value, Is.EqualTo(42.0));

      gauge = new MinGauge(new MetricConfig("min1"));
      gauge.Update(42L);
      gauge.Update(420L);
      gauge.Update(1L);

      measure = Testing.Sync<Measure>(gauge, gauge.GetMeasure, gauge.context_);
      Assert.That(measure.Value, Is.EqualTo(1.0));
    }