Browse Source

[2225_statistics] rename _incrementer() to inc() and change its interface

Naoki Kambe 12 years ago
parent
commit
b53ecd7c25
1 changed files with 8 additions and 4 deletions
  1. 8 4
      src/lib/python/isc/statistics/counter.py

+ 8 - 4
src/lib/python/isc/statistics/counter.py

@@ -217,10 +217,14 @@ class _Counter():
         """enables incrementing/decrementing counters"""
         """enables incrementing/decrementing counters"""
         self._disabled = False
         self._disabled = False
 
 
-    def _incrementer(self, identifier, step=1):
-        """A per-zone incrementer for counter_name. Locks the
-        thread because it is considered to be invoked by a
-        multi-threading caller."""
+    def inc(self, *args):
+        """A incrementer for per-zone counter. Locks the thread
+        because it is considered to be invoked by a multi-threading
+        caller. isc.cc.data.DataNotFoundError is raised when
+        incrementing the counter of the item undefined in the spec
+        file."""
+        identifier = '/'.join(args)
+        step = 1
         if self._disabled: return
         if self._disabled: return
         with self._rlock:
         with self._rlock:
             _inc_counter(self._statistics_data,
             _inc_counter(self._statistics_data,