X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=src%2Fbin%2Fmemstat.cc;h=407a7c967a4ecae80fede179ac7d39914935f14a;hb=c0f50dec5334f54cf060b1f9c4250c72649b4ff2;hp=5208fb4da16d26d3fa4f8cd903fbb5367c6b2f60;hpb=f9c4c047caf6847f06e8059e11aff90e1ccdd84b;p=m6w6%2Flibmemcached diff --git a/src/bin/memstat.cc b/src/bin/memstat.cc index 5208fb4d..407a7c96 100644 --- a/src/bin/memstat.cc +++ b/src/bin/memstat.cc @@ -19,12 +19,13 @@ #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/utilities.h" +#include "common/time.hpp" #include -#include #include static memcached_return_t print_server_version(const memcached_st *, @@ -83,11 +84,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 +142,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);