Parcourir la source

[2252] change to better names; s/lastest/last/i

Naoki Kambe il y a 12 ans
Parent
commit
678965be5a

+ 4 - 4
src/bin/xfrin/b10-xfrin.xml

@@ -295,16 +295,16 @@ operation
                   </varlistentry>
 
                   <varlistentry>
-                    <term>latest_ixfr_duration</term>
+                    <term>last_ixfr_duration</term>
                     <listitem><simpara>
-                      Duration of the latest IXFR. 0.0 means no successful IXFR done.
+                      Duration of the last IXFR. 0.0 means no successful IXFR done.
                     </simpara></listitem>
                   </varlistentry>
 
                   <varlistentry>
-                    <term>latest_axfr_duration</term>
+                    <term>last_axfr_duration</term>
                     <listitem><simpara>
-                      Duration of the latest AXFR. 0.0 means no successful AXFR done.
+                      Duration of the last AXFR. 0.0 means no successful AXFR done.
                     </simpara></listitem>
                   </varlistentry>
 

+ 6 - 6
src/bin/xfrin/tests/xfrin_test.py

@@ -2129,8 +2129,8 @@ class TestStatisticsXfrinConn(TestXfrinConnection):
                        ('axfrreqv6', 0),
                        ('ixfrreqv4', 0),
                        ('ixfrreqv6', 0),
-                       ('latest_axfr_duration', 0.0),
-                       ('latest_ixfr_duration', 0.0),
+                       ('last_axfr_duration', 0.0),
+                       ('last_ixfr_duration', 0.0),
                        ('soaoutv4', 0),
                        ('soaoutv6', 0),
                        ('xfrfail', 0),
@@ -2174,8 +2174,8 @@ class TestStatisticsXfrinConn(TestXfrinConnection):
                                           TEST_ZONE_NAME_STR,
                                           name)
             msg = '%s is expected %s but actually %s' % (name, exp, act)
-            if name == 'latest_axfr_duration' \
-                    or name == 'latest_ixfr_duration':
+            if name == 'last_axfr_duration' \
+                    or name == 'last_ixfr_duration':
                 # compare at 3 decimal places
                 self.assertAlmostEqual(exp, act, places=3, msg=msg)
             else:
@@ -2197,7 +2197,7 @@ class TestStatisticsXfrinAXFRv4(TestStatisticsXfrinConn):
         self.assertEqual(self.conn.do_xfrin(False), XFRIN_OK)
         self._check_updated_statistics({'axfrreq' + self.ipver: 1,
                                         'xfrsuccess': 1,
-                                        'latest_axfr_duration':
+                                        'last_axfr_duration':
                                             self._get_dur_time()})
 
     def test_do_soacheck_uptodate(self):
@@ -2223,7 +2223,7 @@ class TestStatisticsXfrinIXFRv4(TestStatisticsXfrinConn):
         self.assertEqual(XFRIN_OK, self.conn.do_xfrin(False, RRType.IXFR))
         self._check_updated_statistics({'ixfrreq' + self.ipver: 1,
                                         'xfrsuccess': 1,
-                                        'latest_ixfr_duration':
+                                        'last_ixfr_duration':
                                             self._get_dur_time()})
 
     def test_do_xfrin_fail(self):

+ 2 - 2
src/bin/xfrin/xfrin.py.in

@@ -962,7 +962,7 @@ class XfrinConnection(asyncore.dispatcher):
             # not yet stopped due to some error, the last start time
             # is overwritten at this point.
             self._counters.start_timer('zones', self._zone_name.to_text(),
-                                       'latest_' + req_str.lower() + '_duration')
+                                       'last_' + req_str.lower() + '_duration')
             logger.info(XFRIN_XFR_TRANSFER_STARTED, req_str, self.zone_str())
             self._send_query(self._request_type)
             # count AXFR/IXFR requests for statistics
@@ -996,7 +996,7 @@ class XfrinConnection(asyncore.dispatcher):
                            )
             # stop statistics timer
             self._counters.stop_timer('zones', self._zone_name.to_text(),
-                                      'latest_' + req_str.lower() + '_duration')
+                                      'last_' + req_str.lower() + '_duration')
 
         except XfrinZoneUptodate:
             # Eventually we'll probably have to treat this case as a trigger

+ 8 - 8
src/bin/xfrin/xfrin.spec

@@ -110,8 +110,8 @@
 	    "ixfrreqv6": 0,
 	    "xfrsuccess": 0,
 	    "xfrfail": 0,
-	    "latest_ixfr_duration": 0.0,
-	    "latest_axfr_duration": 0.0
+	    "last_ixfr_duration": 0.0,
+	    "last_axfr_duration": 0.0
           }
         },
         "item_title": "Zone names",
@@ -189,20 +189,20 @@
               "item_description": "Number of zone transfer requests failed"
             },
             {
-              "item_name": "latest_ixfr_duration",
+              "item_name": "last_ixfr_duration",
               "item_type": "real",
               "item_optional": false,
               "item_default": 0.0,
-              "item_title": "Latest IXFR duration",
-              "item_description": "Duration of the latest IXFR. 0.0 means no successful IXFR done."
+              "item_title": "Last IXFR duration",
+              "item_description": "Duration of the last IXFR. 0.0 means no successful IXFR done."
             },
             {
-              "item_name": "latest_axfr_duration",
+              "item_name": "last_axfr_duration",
               "item_type": "real",
               "item_optional": false,
               "item_default": 0.0,
-              "item_title": "Latest AXFR duration",
-              "item_description": "Duration of the latest AXFR. 0.0 means no successful AXFR done."
+              "item_title": "Last AXFR duration",
+              "item_description": "Duration of the last AXFR. 0.0 means no successful AXFR done."
             }
           ]
         }

+ 2 - 2
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./latest_ixfr_duration
-        zones/example.com./latest_axfr_duration
+        zones/example.com./last_ixfr_duration
+        zones/example.com./last_axfr_duration
         ixfr_running
         axfr_running
         socket/unixdomain/open

+ 2 - 2
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('latest_') == 0 and name.endswith('_duration'):
+            if name.find('last_') == 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('latest_') == 0 and name.endswith('_duration'):
+            if name.find('last_') == 0 and name.endswith('_duration'):
                 zero = 0.0
             else:
                 zero = 0

+ 8 - 8
src/lib/python/isc/statistics/tests/testdata/test_spec3.spec

@@ -19,8 +19,8 @@
 	    "ixfrreqv6": 0,
 	    "xfrsuccess": 0,
 	    "xfrfail": 0,
-	    "latest_ixfr_duration": 0.0,
-	    "latest_axfr_duration": 0.0
+	    "last_ixfr_duration": 0.0,
+	    "last_axfr_duration": 0.0
           }
         },
         "item_title": "Zone names",
@@ -98,20 +98,20 @@
               "item_description": "Number of zone transfer requests failed"
             },
             {
-              "item_name": "latest_ixfr_duration",
+              "item_name": "last_ixfr_duration",
               "item_type": "real",
               "item_optional": false,
               "item_default": 0.0,
-              "item_title": "Latest IXFR duration",
-              "item_description": "Duration of the latest IXFR. 0.0 means no successful IXFR done."
+              "item_title": "Last IXFR duration",
+              "item_description": "Duration of the last IXFR. 0.0 means no successful IXFR done."
             },
             {
-              "item_name": "latest_axfr_duration",
+              "item_name": "last_axfr_duration",
               "item_type": "real",
               "item_optional": false,
               "item_default": 0.0,
-              "item_title": "Latest AXFR duration",
-              "item_description": "Duration of the latest AXFR. 0.0 means no successful AXFR done."
+              "item_title": "Last AXFR duration",
+              "item_description": "Duration of the last AXFR. 0.0 means no successful AXFR done."
             }
           ]
         }

+ 18 - 18
tests/lettuce/features/xfrin_notify_handling.feature

@@ -86,15 +86,15 @@ Feature: Xfrin incoming notify handling
 
     When I query statistics zones of bind10 module Xfrin with cmdctl
     The statistics counters are 0 in category .Xfrin.zones except for the following items
-      | item_name                         | item_value | min_value |
-      | _SERVER_.soaoutv6                 |          1 |           |
-      | _SERVER_.axfrreqv6                |          1 |           |
-      | _SERVER_.xfrsuccess               |          1 |           |
-      | _SERVER_.latest_axfr_duration     |            |       0.0 |
-      | example.org..soaoutv6             |          1 |           |
-      | example.org..axfrreqv6            |          1 |           |
-      | example.org..xfrsuccess           |          1 |           |
-      | example.org..latest_axfr_duration |            |       0.0 |
+      | item_name                       | item_value | min_value |
+      | _SERVER_.soaoutv6               |          1 |           |
+      | _SERVER_.axfrreqv6              |          1 |           |
+      | _SERVER_.xfrsuccess             |          1 |           |
+      | _SERVER_.last_axfr_duration     |            |       0.0 |
+      | example.org..soaoutv6           |          1 |           |
+      | example.org..axfrreqv6          |          1 |           |
+      | example.org..xfrsuccess         |          1 |           |
+      | example.org..last_axfr_duration |            |       0.0 |
 
     #
     # Test for handling incoming notify only in IPv4
@@ -185,15 +185,15 @@ Feature: Xfrin incoming notify handling
 
     When I query statistics zones of bind10 module Xfrin with cmdctl
     The statistics counters are 0 in category .Xfrin.zones except for the following items
-      | item_name                         | item_value | min_value |
-      | _SERVER_.soaoutv4                 |          1 |           |
-      | _SERVER_.axfrreqv4                |          1 |           |
-      | _SERVER_.xfrsuccess               |          1 |           |
-      | _SERVER_.latest_axfr_duration     |            |       0.0 |
-      | example.org..soaoutv4             |          1 |           |
-      | example.org..axfrreqv4            |          1 |           |
-      | example.org..xfrsuccess           |          1 |           |
-      | example.org..latest_axfr_duration |            |       0.0 |
+      | item_name                       | item_value | min_value |
+      | _SERVER_.soaoutv4               |          1 |           |
+      | _SERVER_.axfrreqv4              |          1 |           |
+      | _SERVER_.xfrsuccess             |          1 |           |
+      | _SERVER_.last_axfr_duration     |            |       0.0 |
+      | example.org..soaoutv4           |          1 |           |
+      | example.org..axfrreqv4          |          1 |           |
+      | example.org..xfrsuccess         |          1 |           |
+      | example.org..last_axfr_duration |            |       0.0 |
 
     #
     # Test for Xfr request rejected