From: Naoki Kambe Date: Thu, 6 Dec 2012 02:49:34 +0000 (+0900) Subject: [2225_statistics] rename _Counter() to Counter() and change its interface X-Git-Tag: bind10-1.1.0beta1-release~72^2~40^2~48 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f5dc6575c10281b39320167809689df16ae913cf;p=thirdparty%2Fkea.git [2225_statistics] rename _Counter() to Counter() and change its interface --- diff --git a/src/lib/python/isc/statistics/counter.py b/src/lib/python/isc/statistics/counter.py index 03cd7e0800..3c0a9345b8 100644 --- a/src/lib/python/isc/statistics/counter.py +++ b/src/lib/python/isc/statistics/counter.py @@ -139,7 +139,7 @@ def _stop_timer(start_time, element, spec, identifier): delta.microseconds * 1E-6, 6) _set_counter(element, spec, identifier, sec) -class _Counter(): +class Counter(): """A module for holding all statistics counters of modules. The counter numbers can be accessed by the accesseers defined according to a spec file. In this class, the structure of per-zone @@ -192,11 +192,12 @@ class _Counter(): # zone names are contained under this dirname in the spec file. _perzone_prefix = 'zones' - def __init__(self, spec_file_name): + def __init__(self, spec_file_name=None): self._zones_item_list = [] self._start_time = {} self._disabled = False self._rlock = threading.RLock() + if not spec_file_name: return if self._perzone_prefix in \ isc.config.spec_name_list(self._statistics_spec): self._zones_item_list = isc.config.spec_name_list(