summaryrefslogtreecommitdiffstats
path: root/src/test/perf_counters.cc
diff options
context:
space:
mode:
authorJianpeng Ma <jianpeng.ma@intel.com>2014-12-03 03:26:26 +0100
committerJianpeng Ma <jianpeng.ma@intel.com>2014-12-03 03:26:26 +0100
commit963b76494b889a253dff7d014c47444e4f4f3b4c (patch)
treebe304c8e79c0e9f3a617e2958e005b43b9156ecc /src/test/perf_counters.cc
parenttest/perf_counters: Add test case for cmd 'perf reset' (diff)
downloadceph-963b76494b889a253dff7d014c47444e4f4f3b4c.tar.xz
ceph-963b76494b889a253dff7d014c47444e4f4f3b4c.zip
test/perf_counters: Replace perfcounters_dump to perf dump.
The func of command perfcounters_dump and 'perf dump' are the same . But from the print 'ceph --admin-daemon help', it only print 'perf dump'. So replace. In order to keep consistent, still keep perfcounters_dump in code for old user. Signed-off-by: Jianpeng Ma <jianpeng.ma@intel.com>
Diffstat (limited to 'src/test/perf_counters.cc')
-rw-r--r--src/test/perf_counters.cc24
1 files changed, 12 insertions, 12 deletions
diff --git a/src/test/perf_counters.cc b/src/test/perf_counters.cc
index edbeed6ff5d..cac6b655817 100644
--- a/src/test/perf_counters.cc
+++ b/src/test/perf_counters.cc
@@ -60,7 +60,7 @@ int main(int argc, char **argv) {
TEST(PerfCounters, SimpleTest) {
AdminSocketClient client(get_rand_socket_path());
std::string message;
- ASSERT_EQ("", client.do_request("{ \"prefix\": \"perfcounters_dump\" }", &message));
+ ASSERT_EQ("", client.do_request("{ \"prefix\": \"perf dump\" }", &message));
ASSERT_EQ("{}", message);
}
@@ -100,24 +100,24 @@ TEST(PerfCounters, SinglePerfCounters) {
coll->add(fake_pf);
AdminSocketClient client(get_rand_socket_path());
std::string msg;
- ASSERT_EQ("", client.do_request("{ \"prefix\": \"perfcounters_dump\", \"format\": \"json\" }", &msg));
+ ASSERT_EQ("", client.do_request("{ \"prefix\": \"perf dump\", \"format\": \"json\" }", &msg));
ASSERT_EQ(sd("{\"test_perfcounter_1\":{\"element1\":0,"
"\"element2\":0.000000000,\"element3\":{\"avgcount\":0,\"sum\":0.000000000}}}"), msg);
fake_pf->inc(TEST_PERFCOUNTERS1_ELEMENT_1);
fake_pf->tset(TEST_PERFCOUNTERS1_ELEMENT_2, utime_t(0, 500000000));
fake_pf->tinc(TEST_PERFCOUNTERS1_ELEMENT_3, utime_t(100, 0));
- ASSERT_EQ("", client.do_request("{ \"prefix\": \"perfcounters_dump\", \"format\": \"json\" }", &msg));
+ ASSERT_EQ("", client.do_request("{ \"prefix\": \"perf dump\", \"format\": \"json\" }", &msg));
ASSERT_EQ(sd("{\"test_perfcounter_1\":{\"element1\":1,"
"\"element2\":0.500000000,\"element3\":{\"avgcount\":1,\"sum\":100.000000000}}}"), msg);
fake_pf->tinc(TEST_PERFCOUNTERS1_ELEMENT_3, utime_t());
fake_pf->tinc(TEST_PERFCOUNTERS1_ELEMENT_3, utime_t(25,0));
- ASSERT_EQ("", client.do_request("{ \"prefix\": \"perfcounters_dump\", \"format\": \"json\" }", &msg));
+ ASSERT_EQ("", client.do_request("{ \"prefix\": \"perf dump\", \"format\": \"json\" }", &msg));
ASSERT_EQ(sd("{\"test_perfcounter_1\":{\"element1\":1,\"element2\":0.500000000,"
"\"element3\":{\"avgcount\":3,\"sum\":125.000000000}}}"), msg);
fake_pf->reset();
msg.clear();
- ASSERT_EQ("", client.do_request("{ \"prefix\": \"perfcounters_dump\", \"format\": \"json\" }", &msg));
+ ASSERT_EQ("", client.do_request("{ \"prefix\": \"perf dump\", \"format\": \"json\" }", &msg));
ASSERT_EQ(sd("{\"test_perfcounter_1\":{\"element1\":1,"
"\"element2\":0.000000000,\"element3\":{\"avgcount\":0,\"sum\":0.000000000}}}"), msg);
@@ -149,35 +149,35 @@ TEST(PerfCounters, MultiplePerfCounters) {
AdminSocketClient client(get_rand_socket_path());
std::string msg;
- ASSERT_EQ("", client.do_request("{ \"prefix\": \"perfcounters_dump\", \"format\": \"json\" }", &msg));
+ ASSERT_EQ("", client.do_request("{ \"prefix\": \"perf dump\", \"format\": \"json\" }", &msg));
ASSERT_EQ(sd("{\"test_perfcounter_1\":{\"element1\":0,\"element2\":0.000000000,\"element3\":"
"{\"avgcount\":0,\"sum\":0.000000000}},\"test_perfcounter_2\":{\"foo\":0,\"bar\":0.000000000}}"), msg);
fake_pf1->inc(TEST_PERFCOUNTERS1_ELEMENT_1);
fake_pf1->inc(TEST_PERFCOUNTERS1_ELEMENT_1, 5);
- ASSERT_EQ("", client.do_request("{ \"prefix\": \"perfcounters_dump\", \"format\": \"json\" }", &msg));
+ ASSERT_EQ("", client.do_request("{ \"prefix\": \"perf dump\", \"format\": \"json\" }", &msg));
ASSERT_EQ(sd("{\"test_perfcounter_1\":{\"element1\":6,\"element2\":0.000000000,\"element3\":"
"{\"avgcount\":0,\"sum\":0.000000000}},\"test_perfcounter_2\":{\"foo\":0,\"bar\":0.000000000}}"), msg);
coll->reset(string("test_perfcounter_1"));
- ASSERT_EQ("", client.do_request("{ \"prefix\": \"perfcounters_dump\", \"format\": \"json\" }", &msg));
+ ASSERT_EQ("", client.do_request("{ \"prefix\": \"perf dump\", \"format\": \"json\" }", &msg));
ASSERT_EQ(sd("{\"test_perfcounter_1\":{\"element1\":6,\"element2\":0.000000000,\"element3\":"
"{\"avgcount\":0,\"sum\":0.000000000}},\"test_perfcounter_2\":{\"foo\":0,\"bar\":0.000000000}}"), msg);
fake_pf1->inc(TEST_PERFCOUNTERS1_ELEMENT_1);
fake_pf1->inc(TEST_PERFCOUNTERS1_ELEMENT_1, 6);
- ASSERT_EQ("", client.do_request("{ \"prefix\": \"perfcounters_dump\", \"format\": \"json\" }", &msg));
+ ASSERT_EQ("", client.do_request("{ \"prefix\": \"perf dump\", \"format\": \"json\" }", &msg));
ASSERT_EQ(sd("{\"test_perfcounter_1\":{\"element1\":13,\"element2\":0.000000000,\"element3\":"
"{\"avgcount\":0,\"sum\":0.000000000}},\"test_perfcounter_2\":{\"foo\":0,\"bar\":0.000000000}}"), msg);
coll->reset(string("all"));
msg.clear();
- ASSERT_EQ("", client.do_request("{ \"prefix\": \"perfcounters_dump\", \"format\": \"json\" }", &msg));
+ ASSERT_EQ("", client.do_request("{ \"prefix\": \"perf dump\", \"format\": \"json\" }", &msg));
ASSERT_EQ(sd("{\"test_perfcounter_1\":{\"element1\":13,\"element2\":0.000000000,\"element3\":"
"{\"avgcount\":0,\"sum\":0.000000000}},\"test_perfcounter_2\":{\"foo\":0,\"bar\":0.000000000}}"), msg);
coll->remove(fake_pf2);
- ASSERT_EQ("", client.do_request("{ \"prefix\": \"perfcounters_dump\", \"format\": \"json\" }", &msg));
+ ASSERT_EQ("", client.do_request("{ \"prefix\": \"perf dump\", \"format\": \"json\" }", &msg));
ASSERT_EQ(sd("{\"test_perfcounter_1\":{\"element1\":13,\"element2\":0.000000000,"
"\"element3\":{\"avgcount\":0,\"sum\":0.000000000}}}"), msg);
ASSERT_EQ("", client.do_request("{ \"prefix\": \"perf schema\", \"format\": \"json\" }", &msg));
@@ -185,6 +185,6 @@ TEST(PerfCounters, MultiplePerfCounters) {
"\"element2\":{\"type\":1},\"element3\":{\"type\":5}}}"), msg);
coll->clear();
- ASSERT_EQ("", client.do_request("{ \"prefix\": \"perfcounters_dump\", \"format\": \"json\" }", &msg));
+ ASSERT_EQ("", client.do_request("{ \"prefix\": \"perf dump\", \"format\": \"json\" }", &msg));
ASSERT_EQ("{}", msg);
}