From: Naoki Kambe Date: Mon, 11 Mar 2013 11:22:13 +0000 (+0900) Subject: [2252] rename the item name and update descriptions X-Git-Tag: bind10-1.2.0beta1-release~474^2~4^2~75 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=75445a1c6e208d27ab8d85166ebd079be947f98b;p=thirdparty%2Fkea.git [2252] rename the item name and update descriptions rename the item name "time_to_xxxx" to "latest_xxxx_duration", and update descriptions of them. This is for addressing the reviewer's comment. --- diff --git a/src/bin/xfrin/b10-xfrin.xml b/src/bin/xfrin/b10-xfrin.xml index b29cbbd928..ccec3f6b20 100644 --- a/src/bin/xfrin/b10-xfrin.xml +++ b/src/bin/xfrin/b10-xfrin.xml @@ -295,16 +295,16 @@ operation - time_to_ixfr + latest_ixfr_duration - Elapsed time in second to do the last IXFR + Duration of the latest IXFR - time_to_axfr + latest_axfr_duration - Elapsed time in second to do the last AXFR + Duration of the latest AXFR diff --git a/src/bin/xfrin/tests/xfrin_test.py b/src/bin/xfrin/tests/xfrin_test.py index c149cc20b0..505aed7c38 100644 --- a/src/bin/xfrin/tests/xfrin_test.py +++ b/src/bin/xfrin/tests/xfrin_test.py @@ -1479,7 +1479,7 @@ class TestAXFR(TestXfrinConnection): TEST_ZONE_NAME_STR, 'xfrsuccess') self.assertRaises(isc.cc.data.DataNotFoundError, self.conn._counters.get, 'zones', - TEST_ZONE_NAME_STR, 'time_to_axfr') + TEST_ZONE_NAME_STR, 'latest_axfr_duration') self.assertEqual(self.conn.do_xfrin(False), XFRIN_OK) self.assertFalse(self.conn._datasrc_client._journaling_enabled) @@ -1512,7 +1512,7 @@ class TestAXFR(TestXfrinConnection): 'xfrsuccess')) self.assertGreaterEqual(self.conn._counters.get('zones', TEST_ZONE_NAME_STR, - 'time_to_axfr'), + 'latest_axfr_duration'), 0.0) def test_do_xfrin_with_tsig(self): diff --git a/src/bin/xfrin/xfrin.py.in b/src/bin/xfrin/xfrin.py.in index 39e81c590b..d13c89f2a6 100755 --- a/src/bin/xfrin/xfrin.py.in +++ b/src/bin/xfrin/xfrin.py.in @@ -955,7 +955,7 @@ class XfrinConnection(asyncore.dispatcher): # start statistics timer self._counters.start_timer('zones', self._zone_name.to_text(), - 'time_to_' + req_str.lower()) + 'latest_' + req_str.lower() + '_duration') logger.info(XFRIN_XFR_TRANSFER_STARTED, req_str, self.zone_str()) self._send_query(self._request_type) # count (A|X)IXFR requests for statistics @@ -989,7 +989,7 @@ class XfrinConnection(asyncore.dispatcher): ) # stop statistics timer self._counters.stop_timer('zones', self._zone_name.to_text(), - 'time_to_' + req_str.lower()) + 'latest_' + req_str.lower() + '_duration') except XfrinZoneUptodate: # Eventually we'll probably have to treat this case as a trigger diff --git a/src/bin/xfrin/xfrin.spec b/src/bin/xfrin/xfrin.spec index 547f0723bb..00c519b5a4 100644 --- a/src/bin/xfrin/xfrin.spec +++ b/src/bin/xfrin/xfrin.spec @@ -110,8 +110,8 @@ "ixfrreqv6": 0, "xfrsuccess": 0, "xfrfail": 0, - "time_to_ixfr": 0.0, - "time_to_axfr": 0.0 + "latest_ixfr_duration": 0.0, + "latest_axfr_duration": 0.0 } }, "item_title": "Zone names", @@ -189,20 +189,20 @@ "item_description": "Number of zone transfer requests failed" }, { - "item_name": "time_to_ixfr", + "item_name": "latest_ixfr_duration", "item_type": "real", "item_optional": false, "item_default": 0.0, - "item_title": "Time to IXFR", - "item_description": "Elapsed time in seconds to do the last IXFR" + "item_title": "Latest IXFR duration", + "item_description": "Duration of the latest IXFR" }, { - "item_name": "time_to_axfr", + "item_name": "latest_axfr_duration", "item_type": "real", "item_optional": false, "item_default": 0.0, - "item_title": "Time to AXFR", - "item_description": "Elapsed time in seconds to do the last AXFR" + "item_title": "Latest AXFR duration", + "item_description": "Duration of the latest AXFR" } ] } diff --git a/src/lib/python/isc/statistics/counters.py b/src/lib/python/isc/statistics/counters.py index 8138ab6172..c8a14746c1 100644 --- a/src/lib/python/isc/statistics/counters.py +++ b/src/lib/python/isc/statistics/counters.py @@ -217,8 +217,8 @@ class Counters(): zones/example.com./ixfrreqv6 zones/example.com./xfrsuccess zones/example.com./xfrfail - zones/example.com./time_to_ixfr - zones/example.com./time_to_axfr + zones/example.com./latest_ixfr_duration + zones/example.com./latest_axfr_duration ixfr_running axfr_running socket/unixdomain/open diff --git a/src/lib/python/isc/statistics/tests/counters_test.py b/src/lib/python/isc/statistics/tests/counters_test.py index 395a959a17..6616ec3c62 100644 --- a/src/lib/python/isc/statistics/tests/counters_test.py +++ b/src/lib/python/isc/statistics/tests/counters_test.py @@ -197,7 +197,7 @@ class BaseTestCounters(): # for per-zone counters for name in self.counters._zones_item_list: args = (self._perzone_prefix, TEST_ZONE_NAME_STR, name) - if name.find('time_to_') == 0: + if name.find('latest_') == 0 and name.endswith('_duration'): self.counters.start_timer(*args) self.counters.stop_timer(*args) self.assertGreaterEqual(self.counters.get(*args), 0.0) @@ -278,7 +278,7 @@ class BaseTestCounters(): # 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: + if name.find('latest_') == 0 and name.endswith('_duration'): zero = 0.0 else: zero = 0 diff --git a/src/lib/python/isc/statistics/tests/testdata/test_spec3.spec b/src/lib/python/isc/statistics/tests/testdata/test_spec3.spec index c97a09a5c2..da01c4f7d3 100644 --- a/src/lib/python/isc/statistics/tests/testdata/test_spec3.spec +++ b/src/lib/python/isc/statistics/tests/testdata/test_spec3.spec @@ -19,8 +19,8 @@ "ixfrreqv6": 0, "xfrsuccess": 0, "xfrfail": 0, - "time_to_ixfr": 0.0, - "time_to_axfr": 0.0 + "latest_ixfr_duration": 0.0, + "latest_axfr_duration": 0.0 } }, "item_title": "Zone names", @@ -98,20 +98,20 @@ "item_description": "Number of zone transfer requests failed" }, { - "item_name": "time_to_ixfr", + "item_name": "latest_ixfr_duration", "item_type": "real", "item_optional": false, "item_default": 0.0, - "item_title": "Time to IXFR", - "item_description": "Elapsed time in seconds to do the last IXFR" + "item_title": "Latest IXFR duration", + "item_description": "Duration of the latest IXFR" }, { - "item_name": "time_to_axfr", + "item_name": "latest_axfr_duration", "item_type": "real", "item_optional": false, "item_default": 0.0, - "item_title": "Time to AXFR", - "item_description": "Elapsed time in seconds to do the last AXFR" + "item_title": "Latest AXFR duration", + "item_description": "Duration of the latest AXFR" } ] } diff --git a/tests/lettuce/features/xfrin_notify_handling.feature b/tests/lettuce/features/xfrin_notify_handling.feature index 9d1ec12acf..f16ad8b38d 100644 --- a/tests/lettuce/features/xfrin_notify_handling.feature +++ b/tests/lettuce/features/xfrin_notify_handling.feature @@ -63,8 +63,8 @@ Feature: Xfrin incoming notify handling Then the statistics counter ixfrreqv6 for the zone _SERVER_ should be 0 Then the statistics counter xfrsuccess for the zone _SERVER_ should be 0 Then the statistics counter xfrfail for the zone _SERVER_ should be 0 - Then the statistics counter time_to_ixfr for the zone _SERVER_ should be 0.0 - Then the statistics counter time_to_axfr for the zone _SERVER_ should be 0.0 + Then the statistics counter latest_ixfr_duration for the zone _SERVER_ should be 0.0 + Then the statistics counter latest_axfr_duration for the zone _SERVER_ should be 0.0 When I send bind10 with cmdctl port 47804 the command Xfrout notify example.org IN Then wait for new master stderr message XFROUT_NOTIFY_COMMAND @@ -137,10 +137,10 @@ Feature: Xfrin incoming notify handling Then the statistics counter xfrsuccess for the zone example.org. should be 1 Then the statistics counter xfrfail for the zone _SERVER_ should be 0 Then the statistics counter xfrfail for the zone example.org. should be 0 - Then the statistics counter time_to_ixfr for the zone _SERVER_ should be 0.0 - Then the statistics counter time_to_ixfr for the zone example.org. should be 0.0 - Then the statistics counter time_to_axfr for the zone _SERVER_ should be greater than 0.0 - Then the statistics counter time_to_axfr for the zone example.org. should be greater than 0.0 + Then the statistics counter latest_ixfr_duration for the zone _SERVER_ should be 0.0 + Then the statistics counter latest_ixfr_duration for the zone example.org. should be 0.0 + Then the statistics counter latest_axfr_duration for the zone _SERVER_ should be greater than 0.0 + Then the statistics counter latest_axfr_duration for the zone example.org. should be greater than 0.0 # # Test for Xfr request rejected @@ -207,8 +207,8 @@ Feature: Xfrin incoming notify handling Then the statistics counter ixfrreqv6 for the zone _SERVER_ should be 0 Then the statistics counter xfrsuccess for the zone _SERVER_ should be 0 Then the statistics counter xfrfail for the zone _SERVER_ should be 0 - Then the statistics counter time_to_ixfr for the zone _SERVER_ should be 0.0 - Then the statistics counter time_to_axfr for the zone _SERVER_ should be 0.0 + Then the statistics counter latest_ixfr_duration for the zone _SERVER_ should be 0.0 + Then the statistics counter latest_axfr_duration for the zone _SERVER_ should be 0.0 # # set transfer_acl rejection @@ -294,10 +294,10 @@ Feature: Xfrin incoming notify handling Then the statistics counter xfrsuccess for the zone example.org. should be 0 Then the statistics counter xfrfail for the zone _SERVER_ should be greater than 0 Then the statistics counter xfrfail for the zone example.org. should be greater than 0 - Then the statistics counter time_to_ixfr for the zone _SERVER_ should be 0.0 - Then the statistics counter time_to_ixfr for the zone example.org. should be 0.0 - Then the statistics counter time_to_axfr for the zone _SERVER_ should be 0.0 - Then the statistics counter time_to_axfr for the zone example.org. should be 0.0 + Then the statistics counter latest_ixfr_duration for the zone _SERVER_ should be 0.0 + Then the statistics counter latest_ixfr_duration for the zone example.org. should be 0.0 + Then the statistics counter latest_axfr_duration for the zone _SERVER_ should be 0.0 + Then the statistics counter latest_axfr_duration for the zone example.org. should be 0.0 # # Test for unreachable slave