]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
renamed commands
authorRazvan Becheriu <razvan@isc.org>
Mon, 5 Aug 2019 15:17:48 +0000 (18:17 +0300)
committerRazvan Becheriu <razvan@isc.org>
Mon, 5 Aug 2019 17:34:27 +0000 (20:34 +0300)
12 files changed:
doc/sphinx/api/cmds-list
doc/sphinx/api/statistic-sample-age-set-all.json [moved from doc/sphinx/api/statistic-set-max-sample-age-all.json with 57% similarity]
doc/sphinx/api/statistic-sample-age-set.json [moved from doc/sphinx/api/statistic-set-max-sample-age.json with 60% similarity]
doc/sphinx/api/statistic-sample-count-set-all.json [moved from doc/sphinx/api/statistic-set-max-sample-count-all.json with 56% similarity]
doc/sphinx/api/statistic-sample-count-set.json [moved from doc/sphinx/api/statistic-set-max-sample-count.json with 59% similarity]
doc/sphinx/arm/stats.rst
src/bin/dhcp4/ctrl_dhcp4_srv.cc
src/bin/dhcp4/tests/ctrl_dhcp4_srv_unittest.cc
src/bin/dhcp6/ctrl_dhcp6_srv.cc
src/bin/dhcp6/tests/ctrl_dhcp6_srv_unittest.cc
src/lib/stats/stats_mgr.h
src/lib/stats/tests/stats_mgr_unittest.cc

index b781e6c91b5b37b5ccd70f4a1d772d39178e60ab..bcfaf87c3779a66f484e69c5e094b5cba0fad29f 100644 (file)
@@ -117,10 +117,10 @@ statistic-remove
 statistic-remove-all
 statistic-reset
 statistic-reset-all
-statistic-set-max-sample-age
-statistic-set-max-sample-age-all
-statistic-set-max-sample-count
-statistic-set-max-sample-count-all
+statistic-sample-age-set
+statistic-sample-age-set-all
+statistic-sample-count-set
+statistic-sample-count-set-all
 subnet4-add
 subnet4-del
 subnet4-get
similarity index 57%
rename from doc/sphinx/api/statistic-set-max-sample-age-all.json
rename to doc/sphinx/api/statistic-sample-age-set-all.json
index 5394aba21871235e88d21d4eb6797a6744494a1e..09f172b07410dd7f49212fe8db140682b10acd79 100644 (file)
@@ -1,11 +1,11 @@
 {
-    "name": "statistic-set-max-sample-age-all",
-    "brief": "The statistic-set-max-sample-age-all command sets time based limit for all statistics. It takes a single integer parameter called duration.",
-    "description": "See <xref linkend=\"command-statistic-set-max-sample-age-all\"/>",
+    "name": "statistic-sample-age-set-all",
+    "brief": "The statistic-sample-age-set-all command sets time based limit for all statistics. It takes a single integer parameter called duration.",
+    "description": "See <xref linkend=\"command-statistic-sample-age-set-all\"/>",
     "support": [ "kea-dhcp4", "kea-dhcp6" ],
     "avail": "1.6.0",
     "cmd-syntax": "{
-    \"command\": \"statistic-set-max-sample-age-all\",
+    \"command\": \"statistic-sample-age-set-all\",
     \"arguments\": {
         \"duration\": 1245
     }
similarity index 60%
rename from doc/sphinx/api/statistic-set-max-sample-age.json
rename to doc/sphinx/api/statistic-sample-age-set.json
index 20b53ffb816eb35d483d9c2e2bebe5f0d30c20c4..42d22bdd3cb179d8257b5745cc5be665caa48222 100644 (file)
@@ -1,11 +1,11 @@
 {
-    "name": "statistic-set-max-sample-age",
-    "brief": "The statistic-set-max-sample-age command sets time based limit for single statistic. It takes two parameters: a string called name and an integer value called duration.",
-    "description": "See <xref linkend=\"command-statistic-set-max-sample-age\"/>",
+    "name": "statistic-sample-age-set",
+    "brief": "The statistic-sample-age-set command sets time based limit for single statistic. It takes two parameters: a string called name and an integer value called duration.",
+    "description": "See <xref linkend=\"command-statistic-sample-age-set\"/>",
     "support": [ "kea-dhcp4", "kea-dhcp6" ],
     "avail": "1.6.0",
     "cmd-syntax": "{
-    \"command\": \"statistic-set-max-sample-age\",
+    \"command\": \"statistic-sample-age-set\",
     \"arguments\": {
         \"name\": \"pkt4-received\",
         \"duration\": 1245
similarity index 56%
rename from doc/sphinx/api/statistic-set-max-sample-count-all.json
rename to doc/sphinx/api/statistic-sample-count-set-all.json
index 0c8df9e13062a12ad5a45a1613948bdb19394acb..ef7ba348097803c6ff230fdb7dcf0fd1b2c853fb 100644 (file)
@@ -1,11 +1,11 @@
 {
-    "name": "statistic-set-max-sample-count-all",
-    "brief": "The statistic-set-max-sample-count-all command sets size based limit for all statistics. It takes a single integer parameter called max-samples.",
-    "description": "See <xref linkend=\"command-statistic-set-max-sample-count-all\"/>",
+    "name": "statistic-sample-count-set-all",
+    "brief": "The statistic-sample-count-set-all command sets size based limit for all statistics. It takes a single integer parameter called max-samples.",
+    "description": "See <xref linkend=\"command-statistic-sample-count-set-all\"/>",
     "support": [ "kea-dhcp4", "kea-dhcp6" ],
     "avail": "1.6.0",
     "cmd-syntax": "{
-    \"command\": \"statistic-set-max-sample-count-all\",
+    \"command\": \"statistic-sample-count-set-all\",
     \"arguments\": {
         \"max-samples\": 100
     }
similarity index 59%
rename from doc/sphinx/api/statistic-set-max-sample-count.json
rename to doc/sphinx/api/statistic-sample-count-set.json
index 3bffccacab1819e3ffb9cc85ac95a052f355623e..7f9ad07103dda1f66cbb88c3f745d34740ed3a81 100644 (file)
@@ -1,11 +1,11 @@
 {
-    "name": "statistic-set-max-sample-count",
-    "brief": "The statistic-set-max-sample-count command sets size based limit for single statistic. It takes two parameters: a string called name and an integer value called max-samples.",
-    "description": "See <xref linkend=\"command-statistic-set-max-sample-count\"/>",
+    "name": "statistic-sample-count-set",
+    "brief": "The statistic-sample-count-set command sets size based limit for single statistic. It takes two parameters: a string called name and an integer value called max-samples.",
+    "description": "See <xref linkend=\"command-statistic-sample-count-set\"/>",
     "support": [ "kea-dhcp4", "kea-dhcp6" ],
     "avail": "1.6.0",
     "cmd-syntax": "{
-    \"command\": \"statistic-set-max-sample-count\",
+    \"command\": \"statistic-sample-count-set\",
     \"arguments\": {
         \"name\": \"pkt4-received\",
         \"max-samples\": 100
index ac53fd15cb0a6de89d8bcbef89610d4fd684677c..88e5d2d81cfe3b0f6a5e5a8679b4aad059457c67 100644 (file)
@@ -234,19 +234,19 @@ a status of 0, indicating success, and an empty parameters field. If an
 error is encountered, the server returns a status code of 1 (error) and
 the text field contains the error description.
 
-.. _command-statistic-set-max-sample-age:
+.. _command-statistic-sample-age-set:
 
-The statistic-set-max-sample-age Command
+The statistic-sample-age-set Command
 ----------------------------------------
 
-The ``statistic-set-max-sample-age`` command sets time based limit
+The ``statistic-sample-age-set`` command sets time based limit
 for collecting samples for given statistic. An example command may look
 like this:
 
 ::
 
    {
-       "command": "statistic-set-max-sample-age",
+       "command": "statistic-sample-age-set",
        "arguments": {
            "name": "pkt4-received",
            "duration": 1245
@@ -260,19 +260,19 @@ and an empty parameters field. If an error is encountered (e.g. the
 requested statistic was not found), the server returns a status code
 of 1 (error) and the text field contains the error description.
 
-.. _command-statistic-set-max-sample-age-all:
+.. _command-statistic-sample-age-set-all:
 
-The statistic-set-max-sample-age-all Command
+The statistic-sample-age-set-all Command
 --------------------------------------------
 
-The ``statistic-set-max-sample-age-all`` command sets time based limits
+The ``statistic-sample-age-set-all`` command sets time based limits
 for collecting samples for all statistics. An example command may look
 like this:
 
 ::
 
    {
-       "command": "statistic-set-max-sample-age-all",
+       "command": "statistic-sample-age-set-all",
        "arguments": {
            "duration": 1245
        }
@@ -284,19 +284,19 @@ for all statistics, with a result set to 0 indicating success
 and an empty parameters field. If an error is encountered, the server returns
 a status code of 1 (error) and the text field contains the error description.
 
-.. _command-statistic-set-max-sample-count:
+.. _command-statistic-sample-count-set:
 
-The statistic-set-max-sample-count Command
+The statistic-sample-count-set Command
 ------------------------------------------
 
-The ``statistic-set-max-sample-count`` command sets size based limit
+The ``statistic-sample-count-set`` command sets size based limit
 for collecting samples for given statistic. An example command may look
 like this:
 
 ::
 
    {
-       "command": "statistic-set-max-sample-count",
+       "command": "statistic-sample-count-set",
        "arguments": {
            "name": "pkt4-received",
            "max-samples": 100
@@ -310,19 +310,19 @@ and an empty parameters field. If an error is encountered (e.g. the
 requested statistic was not found), the server returns a status code
 of 1 (error) and the text field contains the error description.
 
-.. _command-statistic-set-max-sample-count-all:
+.. _command-statistic-sample-count-set-all:
 
-The statistic-set-max-sample-count-all Command
+The statistic-sample-count-set-all Command
 ----------------------------------------------
 
-The ``statistic-set-max-sample-count-all`` command sets size based limits
+The ``statistic-sample-count-set-all`` command sets size based limits
 for collecting samples for all statistics. An example command may look
 like this:
 
 ::
 
    {
-       "command": "statistic-set-max-sample-count-all",
+       "command": "statistic-sample-count-set-all",
        "arguments": {
            "max-samples": 100
        }
@@ -353,10 +353,10 @@ Since Kea 1.6, by default, each statistic holds 20 data points. Setting such
 limit prevent unlimited memory consumption growth.
 There are two ways to define the limts: time based (e.g. keep samples from
 the last 5 minutes) and size based. It's possible to change the size based
-limit by using one of two commands: ``statistic-set-max-sample-count``,
-to set size limit for single statistic and ``statistic-set-max-sample-count-all``
+limit by using one of two commands: ``statistic-sample-count-set``,
+to set size limit for single statistic and ``statistic-sample-count-set-all``
 for setting size based limits for all statistics. To set time based
-limit for single statistic use ``statistic-set-max-sample-age``,
-and ``statistic-set-max-sample-age-all`` to set time based limits for all statistics.
-For given statistic only one type of limit can be active. It means that
-storage is limited only by time based limit or size based, never by both of them.
+limit for single statistic use ``statistic-sample-age-set``, and
+``statistic-sample-age-set-all`` to set time based limits for all statistics.
+For given statistic only one type of limit can be active. It means that storage
+is limited only by time based limit or size based, never by both of them.
index 8c2589b108d066179bc7666ffecd9efbde2ad597..4987613534b02ad50388f2f137a2f9660b7c7990 100644 (file)
@@ -864,16 +864,16 @@ ControlledDhcpv4Srv::ControlledDhcpv4Srv(uint16_t server_port /*= DHCP4_SERVER_P
     CommandMgr::instance().registerCommand("statistic-remove-all",
         boost::bind(&StatsMgr::statisticRemoveAllHandler, _1, _2));
 
-    CommandMgr::instance().registerCommand("statistic-set-max-sample-age",
+    CommandMgr::instance().registerCommand("statistic-sample-age-set",
         boost::bind(&StatsMgr::statisticSetMaxSampleAgeHandler, _1, _2));
 
-    CommandMgr::instance().registerCommand("statistic-set-max-sample-count",
-        boost::bind(&StatsMgr::statisticSetMaxSampleCountHandler, _1, _2));
-
-    CommandMgr::instance().registerCommand("statistic-set-max-sample-age-all",
+    CommandMgr::instance().registerCommand("statistic-sample-age-set-all",
         boost::bind(&StatsMgr::statisticSetMaxSampleAgeAllHandler, _1, _2));
 
-    CommandMgr::instance().registerCommand("statistic-set-max-sample-count-all",
+    CommandMgr::instance().registerCommand("statistic-sample-count-set",
+        boost::bind(&StatsMgr::statisticSetMaxSampleCountHandler, _1, _2));
+
+    CommandMgr::instance().registerCommand("statistic-sample-count-set-all",
         boost::bind(&StatsMgr::statisticSetMaxSampleCountAllHandler, _1, _2));
 }
 
@@ -914,10 +914,10 @@ ControlledDhcpv4Srv::~ControlledDhcpv4Srv() {
         CommandMgr::instance().deregisterCommand("statistic-remove-all");
         CommandMgr::instance().deregisterCommand("statistic-reset");
         CommandMgr::instance().deregisterCommand("statistic-reset-all");
-        CommandMgr::instance().deregisterCommand("statistic-set-max-sample-age");
-        CommandMgr::instance().deregisterCommand("statistic-set-max-sample-count");
-        CommandMgr::instance().deregisterCommand("statistic-set-max-sample-age-all");
-        CommandMgr::instance().deregisterCommand("statistic-set-max-sample-count-all");
+        CommandMgr::instance().deregisterCommand("statistic-sample-age-set");
+        CommandMgr::instance().deregisterCommand("statistic-sample-age-set-all");
+        CommandMgr::instance().deregisterCommand("statistic-sample-count-set");
+        CommandMgr::instance().deregisterCommand("statistic-sample-count-set-all");
         CommandMgr::instance().deregisterCommand("version-get");
 
     } catch (...) {
index 9aed6c614739cb951cb11524e98d738ea5058e4f..14439e52a21dcad48e407374d090a70d9a4e035b 100644 (file)
@@ -491,10 +491,10 @@ TEST_F(CtrlChannelDhcpv4SrvTest, commandsRegistration) {
     EXPECT_TRUE(command_list.find("\"statistic-remove-all\"") != string::npos);
     EXPECT_TRUE(command_list.find("\"statistic-reset\"") != string::npos);
     EXPECT_TRUE(command_list.find("\"statistic-reset-all\"") != string::npos);
-    EXPECT_TRUE(command_list.find("\"statistic-set-max-sample-age\"") != string::npos);
-    EXPECT_TRUE(command_list.find("\"statistic-set-max-sample-age-all\"") != string::npos);
-    EXPECT_TRUE(command_list.find("\"statistic-set-max-sample-count\"") != string::npos);
-    EXPECT_TRUE(command_list.find("\"statistic-set-max-sample-count-all\"") != string::npos);
+    EXPECT_TRUE(command_list.find("\"statistic-sample-age-set\"") != string::npos);
+    EXPECT_TRUE(command_list.find("\"statistic-sample-age-set-all\"") != string::npos);
+    EXPECT_TRUE(command_list.find("\"statistic-sample-count-set\"") != string::npos);
+    EXPECT_TRUE(command_list.find("\"statistic-sample-count-set-all\"") != string::npos);
     EXPECT_TRUE(command_list.find("\"version-get\"") != string::npos);
 
     // Ok, and now delete the server. It should deregister its commands.
@@ -714,29 +714,29 @@ TEST_F(CtrlChannelDhcpv4SrvTest, controlChannelStats) {
     EXPECT_EQ("{ \"result\": 0, \"text\": \"All statistics removed.\" }",
               response);
 
-    // Check statistic-set-max-sample-age
-    sendUnixCommand("{ \"command\" : \"statistic-set-max-sample-age\", "
+    // Check statistic-sample-age-set
+    sendUnixCommand("{ \"command\" : \"statistic-sample-age-set\", "
                     "  \"arguments\": {"
                     "  \"name\":\"bogus\", \"duration\": 1245 }}", response);
     EXPECT_EQ("{ \"result\": 1, \"text\": \"No 'bogus' statistic found\" }",
               response);
 
-    // Check statistic-set-max-sample-age-all
-    sendUnixCommand("{ \"command\" : \"statistic-set-max-sample-age-all\", "
+    // Check statistic-sample-age-set-all
+    sendUnixCommand("{ \"command\" : \"statistic-sample-age-set-all\", "
                     "  \"arguments\": {"
                     "  \"duration\": 1245 }}", response);
     EXPECT_EQ("{ \"result\": 0, \"text\": \"All statistics duration limit are set.\" }",
               response);
 
-    // Check statistic-set-max-sample-count
-    sendUnixCommand("{ \"command\" : \"statistic-set-max-sample-count\", "
+    // Check statistic-sample-count-set
+    sendUnixCommand("{ \"command\" : \"statistic-sample-count-set\", "
                     "  \"arguments\": {"
                     "  \"name\":\"bogus\", \"max-samples\": 100 }}", response);
     EXPECT_EQ("{ \"result\": 1, \"text\": \"No 'bogus' statistic found\" }",
               response);
 
-    // Check statistic-set-max-sample-count-all
-    sendUnixCommand("{ \"command\" : \"statistic-set-max-sample-count-all\", "
+    // Check statistic-sample-count-set-all
+    sendUnixCommand("{ \"command\" : \"statistic-sample-count-set-all\", "
                     "  \"arguments\": {"
                     "  \"max-samples\": 100 }}", response);
     EXPECT_EQ("{ \"result\": 0, \"text\": \"All statistics count limit are set.\" }",
@@ -915,10 +915,10 @@ TEST_F(CtrlChannelDhcpv4SrvTest, listCommands) {
     checkListCommands(rsp, "statistic-remove-all");
     checkListCommands(rsp, "statistic-reset");
     checkListCommands(rsp, "statistic-reset-all");
-    checkListCommands(rsp, "statistic-set-max-sample-age");
-    checkListCommands(rsp, "statistic-set-max-sample-age-all");
-    checkListCommands(rsp, "statistic-set-max-sample-count");
-    checkListCommands(rsp, "statistic-set-max-sample-count-all");
+    checkListCommands(rsp, "statistic-sample-age-set");
+    checkListCommands(rsp, "statistic-sample-age-set-all");
+    checkListCommands(rsp, "statistic-sample-count-set");
+    checkListCommands(rsp, "statistic-sample-count-set-all");
     checkListCommands(rsp, "version-get");
 }
 
index 3552f7eedff24563e1c9df41d85d07689ad22b7d..9e5947606cf24426de9b0ef140d366524d3fc9a0 100644 (file)
@@ -888,16 +888,16 @@ ControlledDhcpv6Srv::ControlledDhcpv6Srv(uint16_t server_port,
     CommandMgr::instance().registerCommand("statistic-remove-all",
         boost::bind(&StatsMgr::statisticRemoveAllHandler, _1, _2));
 
-    CommandMgr::instance().registerCommand("statistic-set-max-sample-age",
+    CommandMgr::instance().registerCommand("statistic-sample-age-set",
         boost::bind(&StatsMgr::statisticSetMaxSampleAgeHandler, _1, _2));
 
-    CommandMgr::instance().registerCommand("statistic-set-max-sample-count",
-        boost::bind(&StatsMgr::statisticSetMaxSampleCountHandler, _1, _2));
-
-    CommandMgr::instance().registerCommand("statistic-set-max-sample-age-all",
+    CommandMgr::instance().registerCommand("statistic-sample-age-set-all",
         boost::bind(&StatsMgr::statisticSetMaxSampleAgeAllHandler, _1, _2));
 
-    CommandMgr::instance().registerCommand("statistic-set-max-sample-count-all",
+    CommandMgr::instance().registerCommand("statistic-sample-count-set",
+        boost::bind(&StatsMgr::statisticSetMaxSampleCountHandler, _1, _2));
+
+    CommandMgr::instance().registerCommand("statistic-sample-count-set-all",
         boost::bind(&StatsMgr::statisticSetMaxSampleCountAllHandler, _1, _2));
 }
 
@@ -938,10 +938,10 @@ ControlledDhcpv6Srv::~ControlledDhcpv6Srv() {
         CommandMgr::instance().deregisterCommand("statistic-remove-all");
         CommandMgr::instance().deregisterCommand("statistic-reset");
         CommandMgr::instance().deregisterCommand("statistic-reset-all");
-        CommandMgr::instance().deregisterCommand("statistic-set-max-sample-age");
-        CommandMgr::instance().deregisterCommand("statistic-set-max-sample-count");
-        CommandMgr::instance().deregisterCommand("statistic-set-max-sample-age-all");
-        CommandMgr::instance().deregisterCommand("statistic-set-max-sample-count-all");
+        CommandMgr::instance().deregisterCommand("statistic-sample-age-set");
+        CommandMgr::instance().deregisterCommand("statistic-sample-age-set-all");
+        CommandMgr::instance().deregisterCommand("statistic-sample-count-set");
+        CommandMgr::instance().deregisterCommand("statistic-sample-count-set-all");
         CommandMgr::instance().deregisterCommand("version-get");
 
     } catch (...) {
index 77f2640bfaf0d18e4003ba63523c9822b8ed5f32..ee821e37a4e9f2399f8168b5ccb50bf91ed7eb16 100644 (file)
@@ -798,10 +798,10 @@ TEST_F(CtrlDhcpv6SrvTest, commandsRegistration) {
     EXPECT_TRUE(command_list.find("\"statistic-remove-all\"") != string::npos);
     EXPECT_TRUE(command_list.find("\"statistic-reset\"") != string::npos);
     EXPECT_TRUE(command_list.find("\"statistic-reset-all\"") != string::npos);
-    EXPECT_TRUE(command_list.find("\"statistic-set-max-sample-age\"") != string::npos);
-    EXPECT_TRUE(command_list.find("\"statistic-set-max-sample-age-all\"") != string::npos);
-    EXPECT_TRUE(command_list.find("\"statistic-set-max-sample-count\"") != string::npos);
-    EXPECT_TRUE(command_list.find("\"statistic-set-max-sample-count-all\"") != string::npos);
+    EXPECT_TRUE(command_list.find("\"statistic-sample-age-set\"") != string::npos);
+    EXPECT_TRUE(command_list.find("\"statistic-sample-age-set-all\"") != string::npos);
+    EXPECT_TRUE(command_list.find("\"statistic-sample-count-set\"") != string::npos);
+    EXPECT_TRUE(command_list.find("\"statistic-sample-count-set-all\"") != string::npos);
     EXPECT_TRUE(command_list.find("\"version-get\"") != string::npos);
 
     // Ok, and now delete the server. It should deregister its commands.
@@ -1028,29 +1028,29 @@ TEST_F(CtrlChannelDhcpv6SrvTest, controlChannelStats) {
     EXPECT_EQ("{ \"result\": 0, \"text\": \"All statistics removed.\" }",
               response);
 
-    // Check statistic-set-max-sample-age
-    sendUnixCommand("{ \"command\" : \"statistic-set-max-sample-age\", "
+    // Check statistic-sample-age-set
+    sendUnixCommand("{ \"command\" : \"statistic-sample-age-set\", "
                     "  \"arguments\": {"
                     "  \"name\":\"bogus\", \"duration\": 1245 }}", response);
     EXPECT_EQ("{ \"result\": 1, \"text\": \"No 'bogus' statistic found\" }",
               response);
 
-    // Check statistic-set-max-sample-age-all
-    sendUnixCommand("{ \"command\" : \"statistic-set-max-sample-age-all\", "
+    // Check statistic-sample-age-set-all
+    sendUnixCommand("{ \"command\" : \"statistic-sample-age-set-all\", "
                     "  \"arguments\": {"
                     "  \"duration\": 1245 }}", response);
     EXPECT_EQ("{ \"result\": 0, \"text\": \"All statistics duration limit are set.\" }",
               response);
 
-    // Check statistic-set-max-sample-count
-    sendUnixCommand("{ \"command\" : \"statistic-set-max-sample-count\", "
+    // Check statistic-sample-count-set
+    sendUnixCommand("{ \"command\" : \"statistic-sample-count-set\", "
                     "  \"arguments\": {"
                     "  \"name\":\"bogus\", \"max-samples\": 100 }}", response);
     EXPECT_EQ("{ \"result\": 1, \"text\": \"No 'bogus' statistic found\" }",
               response);
 
-    // Check statistic-set-max-sample-count-all
-    sendUnixCommand("{ \"command\" : \"statistic-set-max-sample-count-all\", "
+    // Check statistic-sample-count-set-all
+    sendUnixCommand("{ \"command\" : \"statistic-sample-count-set-all\", "
                     "  \"arguments\": {"
                     "  \"max-samples\": 100 }}", response);
     EXPECT_EQ("{ \"result\": 0, \"text\": \"All statistics count limit are set.\" }",
@@ -1086,10 +1086,10 @@ TEST_F(CtrlChannelDhcpv6SrvTest, commandsList) {
     checkListCommands(rsp, "statistic-remove-all");
     checkListCommands(rsp, "statistic-reset");
     checkListCommands(rsp, "statistic-reset-all");
-    checkListCommands(rsp, "statistic-set-max-sample-age");
-    checkListCommands(rsp, "statistic-set-max-sample-age-all");
-    checkListCommands(rsp, "statistic-set-max-sample-count");
-    checkListCommands(rsp, "statistic-set-max-sample-count-all");
+    checkListCommands(rsp, "statistic-sample-age-set");
+    checkListCommands(rsp, "statistic-sample-age-set-all");
+    checkListCommands(rsp, "statistic-sample-count-set");
+    checkListCommands(rsp, "statistic-sample-count-set-all");
 }
 
 // Tests if the server returns its configuration using config-get.
index 11dc2d5abf635a33633b65cf2bfe8520c1188614..b4a9664e55adfd42735ab466cb7783b2bff78355 100644 (file)
@@ -306,9 +306,9 @@ class StatsMgr : public boost::noncopyable {
     statisticRemoveHandler(const std::string& name,
                            const isc::data::ConstElementPtr& params);
 
-    /// @brief Handles statistic-set-max-sample-age command
+    /// @brief Handles statistic-sample-age-set command
     ///
-    /// This method handles statistic-set-max-sample-age command,
+    /// This method handles statistic-sample-age-set command,
     /// which set max_sample_age_ limit of a given statistic
     /// and leaves max_sample_count_ disabled.
     /// It expects two parameters stored in params map:
@@ -321,16 +321,16 @@ class StatsMgr : public boost::noncopyable {
     ///     "duration": 1245
     /// }
     ///
-    /// @param name name of the command (ignored, should be "statistic-set-max-sample-age")
+    /// @param name name of the command (ignored, should be "statistic-sample-age-set")
     /// @param params structure containing a map that contains "name" and "duration"
     /// @return answer containing information about successfully setup limit of statistic
     static isc::data::ConstElementPtr
     statisticSetMaxSampleAgeHandler(const std::string& name,
                                     const isc::data::ConstElementPtr& params);
 
-    /// @brief Handles statistic-set-max-sample-count command
+    /// @brief Handles statistic-sample-count-set command
     ///
-    /// This method handles statistic-set-max-sample-count command,
+    /// This method handles statistic-sample-count-set command,
     /// which set max_sample_count_ limit of a given statistic
     /// and leaves max_sample_age_ disabled.
     /// It expects two parameters stored in params map:
@@ -343,7 +343,7 @@ class StatsMgr : public boost::noncopyable {
     ///     "max-samples": 15
     /// }
     ///
-    /// @param name name of the command (ignored, should be "statistic-set-max-sample-count")
+    /// @param name name of the command (ignored, should be "statistic-sample-count-set")
     /// @param params structure containing a map that contains "name" and "max-samples"
     /// @return answer containing information about successfully setup limit of statistic
     static isc::data::ConstElementPtr
@@ -386,9 +386,9 @@ class StatsMgr : public boost::noncopyable {
     statisticRemoveAllHandler(const std::string& name,
                               const isc::data::ConstElementPtr& params);
 
-    /// @brief Handles statistic-set-max-sample-age-all command
+    /// @brief Handles statistic-sample-age-set-all command
     ///
-    /// This method handles statistic-set-max-sample-age-all command,
+    /// This method handles statistic-sample-age-set-all command,
     /// which set max_sample_age_ limit to all statistics.
     /// It expects one parameter stored in params map:
     /// duration: limit expressed as a number of seconds
@@ -398,16 +398,16 @@ class StatsMgr : public boost::noncopyable {
     ///     "duration": 1245
     /// }
     ///
-    /// @param name name of the command (ignored, should be "statistic-set-max-sample-age-all")
+    /// @param name name of the command (ignored, should be "statistic-sample-age-set-all")
     /// @param params structure containing a map that contains "duration"
     /// @return answer confirming success of this operation
     static isc::data::ConstElementPtr
     statisticSetMaxSampleAgeAllHandler(const std::string& name,
                                        const isc::data::ConstElementPtr& params);
 
-    /// @brief Handles statistic-set-max-sample-count-all command
+    /// @brief Handles statistic-sample-count-set-all command
     ///
-    /// This method handles statistic-set-max-sample-count-all command,
+    /// This method handles statistic-sample-count-set-all command,
     /// which set max_sample_count_ limit of a given statistic
     /// and leaves max_sample_age_ disabled.
     /// It expects one parameter stored in params map:
@@ -418,7 +418,7 @@ class StatsMgr : public boost::noncopyable {
     ///     "max-samples": 15
     /// }
     ///
-    /// @param name name of the command (ignored, should be "statistic-set-max-sample-count-all")
+    /// @param name name of the command (ignored, should be "statistic-sample-count-set-all")
     /// @param params structure containing a map that contains "max-samples"
     /// @return answer confirming success of this operation
     static isc::data::ConstElementPtr
index b662e5fb4fc43387afb555d4af2773821b48b13e..bf2114f5439a19715f81c34a52ade1cb709738e1 100644 (file)
@@ -772,7 +772,7 @@ TEST_F(StatsMgrTest, commandRemoveAll) {
     EXPECT_EQ(0, StatsMgr::instance().count());
 }
 
-// This test checks whether statistic-set-max-sample-age command really set
+// This test checks whether statistic-sample-age-set command really set
 // max_sample_age_ limit correctly.
 TEST_F(StatsMgrTest, commandSetMaxSampleAge) {
     StatsMgr::instance().setValue("alpha", static_cast<int64_t>(1234));
@@ -782,7 +782,7 @@ TEST_F(StatsMgrTest, commandSetMaxSampleAge) {
     params->set("duration", Element::create(1245)); // time_duration(0, 20, 45, 0)
 
     ConstElementPtr rsp =
-        StatsMgr::instance().statisticSetMaxSampleAgeHandler("statistic-set-max-sample-age", params);
+        StatsMgr::instance().statisticSetMaxSampleAgeHandler("statistic-sample-age-set", params);
     int status_code;
     ASSERT_NO_THROW(parseAnswer(status_code, rsp));
     EXPECT_EQ(CONTROL_RESULT_SUCCESS, status_code);
@@ -794,7 +794,7 @@ TEST_F(StatsMgrTest, commandSetMaxSampleAge) {
     EXPECT_EQ(StatsMgr::instance().getObservation("alpha")->getMaxSampleCount().first, false);
 }
 
-// Test checks if statistic-set-max-sample-age is able to handle:
+// Test checks if statistic-sample-age-set is able to handle:
 // - a request without parameters
 // - a request without duration parameter
 // - a request with missing statistic name
@@ -802,7 +802,7 @@ TEST_F(StatsMgrTest, commandSetMaxSampleAge) {
 TEST_F(StatsMgrTest, commandSetMaxSampleAgeNegative) {
     // Case 1: a request without parameters
     ConstElementPtr rsp =
-        StatsMgr::instance().statisticSetMaxSampleAgeHandler("statistic-set-max-sample-age", ElementPtr());
+        StatsMgr::instance().statisticSetMaxSampleAgeHandler("statistic-sample-age-set", ElementPtr());
     int status_code;
     ASSERT_NO_THROW(parseAnswer(status_code, rsp));
     EXPECT_EQ(status_code, CONTROL_RESULT_ERROR);
@@ -810,20 +810,20 @@ TEST_F(StatsMgrTest, commandSetMaxSampleAgeNegative) {
     // Case 2: a request without duration parameter
     ElementPtr params = Element::createMap();
     params->set("name", Element::create("alpha"));
-    rsp = StatsMgr::instance().statisticSetMaxSampleAgeHandler("statistic-set-max-sample-age", params);
+    rsp = StatsMgr::instance().statisticSetMaxSampleAgeHandler("statistic-sample-age-set", params);
     ASSERT_NO_THROW(parseAnswer(status_code, rsp));
     EXPECT_EQ(status_code, CONTROL_RESULT_ERROR);
 
     // Case 3: a request with missing statistic name
     params = Element::createMap();
     params->set("duration", Element::create(100));
-    rsp = StatsMgr::instance().statisticSetMaxSampleAgeHandler("statistic-set-max-sample-age", params);
+    rsp = StatsMgr::instance().statisticSetMaxSampleAgeHandler("statistic-sample-age-set", params);
     ASSERT_NO_THROW(parseAnswer(status_code, rsp));
     EXPECT_EQ(status_code, CONTROL_RESULT_ERROR);
 
     // Case 4: a request for non-existing statistic
     params->set("name", Element::create("alpha"));
-    rsp = StatsMgr::instance().statisticSetMaxSampleAgeHandler("statistic-set-max-sample-age", params);
+    rsp = StatsMgr::instance().statisticSetMaxSampleAgeHandler("statistic-sample-age-set", params);
     EXPECT_EQ("{ \"result\": 1, \"text\": \"No 'alpha' statistic found\" }",
               rsp->str());
 }
@@ -839,7 +839,7 @@ TEST_F(StatsMgrTest, commandSetMaxSampleAgeAll) {
     params->set("duration", Element::create(3765)); // time_duration(1, 2, 45, 0)
 
     ConstElementPtr rsp =
-        StatsMgr::instance().statisticSetMaxSampleAgeAllHandler("statistic-set-max-sample-age-all", params);
+        StatsMgr::instance().statisticSetMaxSampleAgeAllHandler("statistic-sample-age-set-all", params);
     int status_code;
     ASSERT_NO_THROW(parseAnswer(status_code, rsp));
     EXPECT_EQ(CONTROL_RESULT_SUCCESS, status_code);
@@ -866,7 +866,7 @@ TEST_F(StatsMgrTest, commandSetMaxSampleAgeAll) {
     EXPECT_EQ(StatsMgr::instance().getObservation("delta")->getMaxSampleCount().first, false);
 }
 
-// This test checks whether statistic-set-max-sample-count command really set
+// This test checks whether statistic-sample-count-set command really set
 // max_sample_count_ limit correctly.
 TEST_F(StatsMgrTest, commandSetMaxSampleCount) {
     StatsMgr::instance().setValue("alpha", static_cast<int64_t>(1234));
@@ -876,7 +876,7 @@ TEST_F(StatsMgrTest, commandSetMaxSampleCount) {
     params->set("max-samples", Element::create(15));
 
     ConstElementPtr rsp =
-        StatsMgr::instance().statisticSetMaxSampleCountHandler("statistic-set-max-sample-count", params);
+        StatsMgr::instance().statisticSetMaxSampleCountHandler("statistic-sample-count-set", params);
     int status_code;
     ASSERT_NO_THROW(parseAnswer(status_code, rsp));
     EXPECT_EQ(CONTROL_RESULT_SUCCESS, status_code);
@@ -887,7 +887,7 @@ TEST_F(StatsMgrTest, commandSetMaxSampleCount) {
     EXPECT_EQ(StatsMgr::instance().getObservation("alpha")->getMaxSampleAge().first, false);
 }
 
-// Test checks if statistic-set-max-sample-count is able to handle:
+// Test checks if statistic-sample-count-set is able to handle:
 // - a request without parameters
 // - a request without max-samples parameter
 // - a request with missing statistic name
@@ -895,7 +895,7 @@ TEST_F(StatsMgrTest, commandSetMaxSampleCount) {
 TEST_F(StatsMgrTest, commandSetMaxSampleCountNegative) {
     // Case 1: a request without parameters
     ConstElementPtr rsp =
-        StatsMgr::instance().statisticSetMaxSampleCountHandler("statistic-set-max-sample-count", ElementPtr());
+        StatsMgr::instance().statisticSetMaxSampleCountHandler("statistic-sample-count-set", ElementPtr());
     int status_code;
     ASSERT_NO_THROW(parseAnswer(status_code, rsp));
     EXPECT_EQ(status_code, CONTROL_RESULT_ERROR);
@@ -903,20 +903,20 @@ TEST_F(StatsMgrTest, commandSetMaxSampleCountNegative) {
     // Case 2: a request without max-samples parameter
     ElementPtr params = Element::createMap();
     params->set("name", Element::create("alpha"));
-    rsp = StatsMgr::instance().statisticSetMaxSampleCountHandler("statistic-set-max-sample-count", params);
+    rsp = StatsMgr::instance().statisticSetMaxSampleCountHandler("statistic-sample-count-set", params);
     ASSERT_NO_THROW(parseAnswer(status_code, rsp));
     EXPECT_EQ(status_code, CONTROL_RESULT_ERROR);
 
     // Case 3: a request with missing statistic name
     params = Element::createMap();
     params->set("max-samples", Element::create(10));
-    rsp = StatsMgr::instance().statisticSetMaxSampleCountHandler("statistic-set-max-sample-count", params);
+    rsp = StatsMgr::instance().statisticSetMaxSampleCountHandler("statistic-sample-count-set", params);
     ASSERT_NO_THROW(parseAnswer(status_code, rsp));
     EXPECT_EQ(status_code, CONTROL_RESULT_ERROR);
 
     // Case 4: a request for non-existing statistic
     params->set("name", Element::create("alpha"));
-    rsp = StatsMgr::instance().statisticSetMaxSampleCountHandler("statistic-set-max-sample-count", params);
+    rsp = StatsMgr::instance().statisticSetMaxSampleCountHandler("statistic-sample-count-set", params);
     EXPECT_EQ("{ \"result\": 1, \"text\": \"No 'alpha' statistic found\" }",
               rsp->str());
 }
@@ -932,7 +932,7 @@ TEST_F(StatsMgrTest, commandSetMaxSampleCountAll) {
     params->set("max-samples", Element::create(200));
 
     ConstElementPtr rsp =
-        StatsMgr::instance().statisticSetMaxSampleCountAllHandler("statistic-set-max-sample-count-all", params);
+        StatsMgr::instance().statisticSetMaxSampleCountAllHandler("statistic-sample-count-set-all", params);
     int status_code;
     ASSERT_NO_THROW(parseAnswer(status_code, rsp));
     EXPECT_EQ(CONTROL_RESULT_SUCCESS, status_code);