Browse Source

[2225_statistics] rename dump_statistics() to get_statistics()

It's due to the review comment.
Naoki Kambe 12 years ago
parent
commit
a9f2470217

+ 1 - 1
src/lib/python/isc/statistics/counter.py

@@ -358,7 +358,7 @@ class Counters():
             # map.
             # map.
             del branch_map[leaf]
             del branch_map[leaf]
 
 
-    def dump_statistics(self):
+    def get_statistics(self):
         """Calculates an entire server counts, and returns statistics
         """Calculates an entire server counts, and returns statistics
         data format to send out the stats module including each
         data format to send out the stats module including each
         counter. If there is no counts, then it returns an empty
         counter. If there is no counts, then it returns an empty

+ 7 - 7
src/lib/python/isc/statistics/tests/counter_test.py

@@ -169,16 +169,16 @@ class BaseTestCounters():
     def tearDown(self):
     def tearDown(self):
         self.counters.clear_all()
         self.counters.clear_all()
 
 
-    def check_dump_statistics(self):
+    def check_get_statistics(self):
         """Checks no differences between the value returned from
         """Checks no differences between the value returned from
-        dump_statistics() and locally collected statistics data. Also
+        get_statistics() and locally collected statistics data. Also
         checks the result isn't changed even after the method is
         checks the result isn't changed even after the method is
         invoked twice. Finally checks it is valid for the the
         invoked twice. Finally checks it is valid for the the
         statistics spec."""
         statistics spec."""
-        self.assertEqual(self.counters.dump_statistics(),
+        self.assertEqual(self.counters.get_statistics(),
                          self._statistics_data)
                          self._statistics_data)
         # Idempotency check
         # Idempotency check
-        self.assertEqual(self.counters.dump_statistics(),
+        self.assertEqual(self.counters.get_statistics(),
                          self._statistics_data)
                          self._statistics_data)
         if self.TEST_SPECFILE_LOCATION:
         if self.TEST_SPECFILE_LOCATION:
             self.assertTrue(isc.config.module_spec_from_file(
             self.assertTrue(isc.config.module_spec_from_file(
@@ -219,7 +219,7 @@ class BaseTestCounters():
                 for zone_str in (self._entire_server, TEST_ZONE_NAME_STR):
                 for zone_str in (self._entire_server, TEST_ZONE_NAME_STR):
                     isc.cc.data.set(self._statistics_data,
                     isc.cc.data.set(self._statistics_data,
                                     '%s/%s/%s' % (args[0], zone_str, name), 2)
                                     '%s/%s/%s' % (args[0], zone_str, name), 2)
-        self.check_dump_statistics()
+        self.check_get_statistics()
 
 
     def test_xfrrunning_counters(self):
     def test_xfrrunning_counters(self):
         # for counters of xfer running
         # for counters of xfer running
@@ -248,7 +248,7 @@ class BaseTestCounters():
             self.counters.dec(*args)
             self.counters.dec(*args)
             self.assertEqual(self.counters.get(*args), 0)
             self.assertEqual(self.counters.get(*args), 0)
             self._statistics_data[name] = 0
             self._statistics_data[name] = 0
-        self.check_dump_statistics()
+        self.check_get_statistics()
 
 
     def test_socket_counters(self):
     def test_socket_counters(self):
         # for ipsocket/unixsocket counters
         # for ipsocket/unixsocket counters
@@ -270,7 +270,7 @@ class BaseTestCounters():
             self.assertEqual(self.counters.get(*args), 2)
             self.assertEqual(self.counters.get(*args), 2)
             isc.cc.data.set(
             isc.cc.data.set(
                 self._statistics_data, '/'.join(args), 2)
                 self._statistics_data, '/'.join(args), 2)
-        self.check_dump_statistics()
+        self.check_get_statistics()
 
 
     def test_undefined_item(self):
     def test_undefined_item(self):
         # test DataNotFoundError raising when specifying item defined
         # test DataNotFoundError raising when specifying item defined