X-Git-Url: https://git.m6w6.name/?p=m6w6%2Flibmemcached;a=blobdiff_plain;f=src%2Fbin%2Fmemstat.cc;h=638297ac23b733caacc67d7a7ce79605327f5f88;hp=5208fb4da16d26d3fa4f8cd903fbb5367c6b2f60;hb=e1ba5b9e4eb179295274026ad8fd40a68eb6c67f;hpb=af58c4c6067fa41da3b4c8f01200065226070e37 diff --git a/src/bin/memstat.cc b/src/bin/memstat.cc index 5208fb4d..638297ac 100644 --- a/src/bin/memstat.cc +++ b/src/bin/memstat.cc @@ -19,12 +19,14 @@ #define PROGRAM_DESCRIPTION "Print stats/version of or analyze a memcached cluster." #define PROGRAM_VERSION "1.1" +#define DEFAULT_LATENCY_ITERATIONS 100 // update help string, if changed + #include "common/options.hpp" #include "common/checks.hpp" +#include "common/time.hpp" #include "common/utilities.h" #include -#include #include static memcached_return_t print_server_version(const memcached_st *, @@ -83,11 +85,6 @@ static bool analyze_stat(const client_options &opt, memcached_st *memc, memcache return true; } -using time_clock = std::chrono::high_resolution_clock; -using time_point = std::chrono::time_point; -using time_format = std::chrono::duration>; -using time_format_ms = std::chrono::duration>; - static void latency_test(uint32_t iterations, std::vector &servers) { const char *test_key = "libmemcached_test_key"; size_t test_key_len = strlen(test_key); @@ -146,7 +143,7 @@ static void latency_test(uint32_t iterations, std::vector &servers } static bool analyze_latency(client_options &opt, memcached_st *root) { - uint32_t num_of_tests = 100; + uint32_t num_of_tests = DEFAULT_LATENCY_ITERATIONS; if (auto iter_str = opt.argof("iterations")) { num_of_tests = std::stoul(iter_str);