From: Naoki Kambe Date: Fri, 14 Dec 2012 09:29:02 +0000 (+0900) Subject: [2225_statistics] add helpful comments to the complicated expression X-Git-Tag: bind10-1.1.0beta1-release~72^2~40^2~18 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f098bc21fd0c528fdd55bdbd8f99f6fec36c9222;p=thirdparty%2Fkea.git [2225_statistics] add helpful comments to the complicated expression Also rsplit() is used instead of split() to be simplified. It's due to the review comment. --- diff --git a/src/lib/python/isc/statistics/counter.py b/src/lib/python/isc/statistics/counter.py index 2ba4b36472..a0eb67746b 100644 --- a/src/lib/python/isc/statistics/counter.py +++ b/src/lib/python/isc/statistics/counter.py @@ -344,11 +344,19 @@ class Counters(): self._statistics._data, self._statistics._spec, identifier) - # delete the started timer - del isc.cc.data.find( - self._start_time, - _concat(*identifier.split('/')[0:-1]))\ - [identifier.split('/')[-1]] + # A datetime value of once used timer should be deleted + # for a future use. + # Here, names of branch and leaf are obtained from a + # string of identifier. The branch name is equivalent to + # the position of datetime to be deleted and the leaf name + # is equivalent to the value of datetime to be deleted. + (branch, leaf) = identifier.rsplit('/', 1) + # Then map of branch is obtained from self._start_time by + # using isc.cc.data.find(). + branch_map = isc.cc.data.find(self._start_time, branch) + # Finally a value of the leaf name is deleted from the + # map. + del branch_map[leaf] def dump_statistics(self): """Calculates an entire server counts, and returns statistics