diff options
| author | Marko Kreen | 2008-04-16 09:55:41 +0000 |
|---|---|---|
| committer | Marko Kreen | 2008-04-16 09:55:41 +0000 |
| commit | 2e10c0cdeba86ade288e9fc4a0eaf8b0141f898e (patch) | |
| tree | e2b443348eb762cbf76a5af3f84366c35d0c6928 /python/pgq | |
| parent | 8277ba5546ced7a745d47ffc310964b761a98144 (diff) | |
fix more bugs - stats, trigger type
Diffstat (limited to 'python/pgq')
| -rw-r--r-- | python/pgq/consumer.py | 4 | ||||
| -rw-r--r-- | python/pgq/maint.py | 2 | ||||
| -rw-r--r-- | python/pgq/setconsumer.py | 2 | ||||
| -rw-r--r-- | python/pgq/ticker.py | 2 |
4 files changed, 5 insertions, 5 deletions
diff --git a/python/pgq/consumer.py b/python/pgq/consumer.py index c44ba236..af02e4fd 100644 --- a/python/pgq/consumer.py +++ b/python/pgq/consumer.py @@ -295,8 +295,8 @@ class Consumer(skytools.DBScript): def stat_end(self, count): t = time.time() - self.stat_add('count', count) - self.stat_add('duration', t - self.stat_batch_start) + self.stat_put('count', count) + self.stat_put('duration', t - self.stat_batch_start) class RemoteConsumer(Consumer): diff --git a/python/pgq/maint.py b/python/pgq/maint.py index c6486f49..396f9c0a 100644 --- a/python/pgq/maint.py +++ b/python/pgq/maint.py @@ -59,7 +59,7 @@ class MaintenanceJob(skytools.DBScript): self.last_time = t duration = time.time() - t - self.stat_add('maint_duration', duration) + self.stat_put('maint_duration', duration) def do_maintenance(self): """Helper function for running maintenance.""" diff --git a/python/pgq/setconsumer.py b/python/pgq/setconsumer.py index 3b87cbfd..76b8dbe6 100644 --- a/python/pgq/setconsumer.py +++ b/python/pgq/setconsumer.py @@ -183,7 +183,7 @@ class SetConsumer(skytools.DBScript): self.process_set_event(dst_curs, ev) if self.dst_queue: self.dst_queue.bulk_insert(dst_curs, ev) - self.stat_add('count', len(ev_list)) + self.stat_increase('count', len(ev_list)) def process_set_event(self, dst_curs, ev): if ev.type == 'set-tick': diff --git a/python/pgq/ticker.py b/python/pgq/ticker.py index bff59214..327864d5 100644 --- a/python/pgq/ticker.py +++ b/python/pgq/ticker.py @@ -170,6 +170,6 @@ class SmartTicker(skytools.DBScript): if cur_time > self.ticker_log_time + self.ticker_log_delay: self.ticker_log_time = cur_time - self.stat_add('ticks', self.tick_count) + self.stat_increase('ticks', self.tick_count) self.tick_count = 0 |
