2
0
mirror of https://gitlab.isc.org/isc-projects/kea synced 2025-08-30 05:27:55 +00:00

[master] Merge branch 'trac2225_statistics_4'

This commit is contained in:
Naoki Kambe 2013-02-18 16:39:23 +09:00
commit a5db81cca2
2 changed files with 19 additions and 3 deletions

View File

@ -393,9 +393,7 @@ class Counters():
for name in zones:
if attr in zones[name]:
sum_ += zones[name][attr]
if sum_ > 0:
_set_counter(zones_data, zones_spec,
id_str, sum_)
_set_counter(zones_data, zones_spec, id_str, sum_)
# insert entire-server counts
statistics_data[self._perzone_prefix] = dict(
statistics_data[self._perzone_prefix],

View File

@ -274,6 +274,24 @@ class BaseTestCounters():
self._statistics_data, '/'.join(args), 2)
self.check_get_statistics()
def test_perzone_zero_counters(self):
# setting all counters to zero
for name in self.counters._zones_item_list:
args = (self._perzone_prefix, TEST_ZONE_NAME_STR, name)
if name.find('time_to_') == 0:
# set zero
self.counters._incdec(*args, step=0.0)
for zone_str in (self._entire_server, TEST_ZONE_NAME_STR):
isc.cc.data.set(self._statistics_data,
'%s/%s/%s' % (args[0], zone_str, name), 0.0)
else:
# set zero
self.counters._incdec(*args, step=0)
for zone_str in (self._entire_server, TEST_ZONE_NAME_STR):
isc.cc.data.set(self._statistics_data,
'%s/%s/%s' % (args[0], zone_str, name), 0)
self.check_get_statistics()
def test_undefined_item(self):
# test DataNotFoundError raising when specifying item defined
# in the specfile