Ejemplo n.º 1
0
 def test_new_counter(self):
     name = 'test'
     self.assertEquals(0, store.get_count(name))
     for i in range(10):
         store.incr_count(name)
     self.assertEquals(10, store.get_count(name))
     for i in range(10):
         store.incr_count(name, 100)
     self.assertEquals(1010, store.get_count(name))
Ejemplo n.º 2
0
 def test_new_counter(self):
     name = 'test'
     self.assertEquals(0, store.get_count(name))
     for i in range(10):
         store.incr_count(name)
     self.assertEquals(10, store.get_count(name))
     for i in range(10):
         store.incr_count(name, 100)
     self.assertEquals(1010, store.get_count(name))
Ejemplo n.º 3
0
 def test_incr_shards(self):
     name = 'incr'
     self.assertEquals(0, store.get_count(name))
     for i in range(10):
         store.incr_count(name)
     store.incr_counter_shards(name, 100)
     self.assertEquals(10, store.get_count(name))
     for i in range(10):
         store.incr_count(name, 100)
     self.assertEquals(1010, store.get_count(name))
Ejemplo n.º 4
0
 def test_incr_shards(self):
     name = 'incr'
     self.assertEquals(0, store.get_count(name))
     for i in range(10):
         store.incr_count(name)
     store.incr_counter_shards(name, 100)
     self.assertEquals(10, store.get_count(name))
     for i in range(10):
         store.incr_count(name, 100)
     self.assertEquals(1010, store.get_count(name))
Ejemplo n.º 5
0
 def run(self):
     store.incr_count(self.name, self.delta)
Ejemplo n.º 6
0
 def run(self):
     store.incr_count(self.name, self.delta)