Beispiel #1
0
    def test_basic_operations(self):
        g = GaugeCell()
        g.set(10)
        self.assertEqual(g.get_cumulative().value, GaugeData(10).value)

        g.set(2)
        self.assertEqual(g.get_cumulative().value, 2)
Beispiel #2
0
    def test_start_time_set(self):
        g1 = GaugeCell()
        g1.set(3)

        name = MetricName('namespace', 'name1')
        mi = g1.to_runner_api_monitoring_info(name, 'transform_id')
        self.assertGreater(mi.start_time.seconds, 0)
Beispiel #3
0
  def test_basic_operations(self):
    g = GaugeCell()
    g.set(10)
    self.assertEqual(g.get_cumulative().value, GaugeData(10).value)

    g.set(2)
    self.assertEqual(g.get_cumulative().value, 2)
Beispiel #4
0
    def test_combine_appropriately(self):
        g1 = GaugeCell()
        g1.set(3)

        g2 = GaugeCell()
        g2.set(1)

        # THe second Gauge, with value 1 was the most recent, so it should be
        # the final result.
        result = g2.combine(g1)
        self.assertEqual(result.data.value, 1)
Beispiel #5
0
  def test_combine_appropriately(self):
    g1 = GaugeCell()
    g1.set(3)

    g2 = GaugeCell()
    g2.set(1)

    # THe second Gauge, with value 1 was the most recent, so it should be
    # the final result.
    result = g2.combine(g1)
    self.assertEqual(result.data.value, 1)
Beispiel #6
0
 def test_integer_only(self):
     g = GaugeCell()
     g.set(3.3)
     self.assertEqual(g.get_cumulative().value, 3)
Beispiel #7
0
 def test_integer_only(self):
   g = GaugeCell()
   g.set(3.3)
   self.assertEqual(g.get_cumulative().value, 3)