]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[2225_statistics] make Counter class hidden(rename Counter to _Counter), add Counter...
authorNaoki Kambe <kambe@jprs.co.jp>
Mon, 26 Nov 2012 04:59:57 +0000 (13:59 +0900)
committerNaoki Kambe <kambe@jprs.co.jp>
Mon, 26 Nov 2012 04:59:57 +0000 (13:59 +0900)
src/lib/python/isc/statistics/counter.py

index 54db3cfb218b69a3ca17fc7af7f43ea9584835b3..a0862b24039e719902b1ed8309f8cb19a4ef11b0 100644 (file)
@@ -84,7 +84,7 @@ def init(spec_file_name):
     module_spec = isc.config.module_spec_from_file(spec_file_name)
     class_name = '%sCounter' % module_spec.get_module_name()
     global _COUNTER
-    if issubclass(_COUNTER.__class__, Counter):
+    if issubclass(_COUNTER.__class__, _Counter):
         # already loaded
         return _COUNTER
     # create an instance once
@@ -93,15 +93,6 @@ def init(spec_file_name):
     globals().update(_COUNTER._to_global)
     return _COUNTER
 
-# These method are dummies for notify_out in case XfroutCounter is not
-# loaded.
-def inc_notifyoutv4(self, arg):
-    """An empty method to be disclosed"""
-    pass
-def inc_notifyoutv6(self, arg):
-    """An empty method to be disclosed"""
-    pass
-
 # static internal functions
 def _add_counter(element, spec, identifier):
     """Returns value of the identifier if the identifier is in the
@@ -169,6 +160,16 @@ def _stop_timer(start_time, element, spec, identifier):
     _set_counter(element, spec, identifier, sec)
 
 class Counter():
+    # These method are dummies for notify_out in case XfroutCounter is not
+    # loaded.
+    def inc_notifyoutv4(arg):
+        """An empty method to be disclosed"""
+        pass
+    def inc_notifyoutv6(arg):
+        """An empty method to be disclosed"""
+        pass
+
+class _Counter():
     """A basic counter class for concrete classes"""
 
     # '_SERVER_' is a special zone name representing an entire