X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=clients%2Fmemstat.c;h=c8769d52059e0a601723b00770ca6f936a9780a8;hb=7f9bc55d79a4e7133fdeaaa1150451717c103b28;hp=817b9f6d1191d30cf2f2ae72aa65366b6a02e228;hpb=34fc4157bda6f458cc603cf32c93507dab9c4f8a;p=awesomized%2Flibmemcached diff --git a/clients/memstat.c b/clients/memstat.c index 817b9f6d..c8769d52 100644 --- a/clients/memstat.c +++ b/clients/memstat.c @@ -1,3 +1,17 @@ +/* LibMemcached + * Copyright (C) 2006-2009 Brian Aker + * All rights reserved. + * + * Use and distribution licensed under the BSD license. See + * the COPYING file in the parent directory for full text. + * + * Summary: + * + * Authors: + * Brian Aker + * Toru Maesaka + */ + #include "libmemcached/common.h" #include #include @@ -19,9 +33,9 @@ /* Prototypes */ static void options_parse(int argc, char *argv[]); -static void run_analyzer(memcached_st *memc, memcached_stat_st *stat, +static void run_analyzer(memcached_st *memc, memcached_stat_st *memc_stat, memcached_server_st *server_list); -static void print_server_listing(memcached_st *memc, memcached_stat_st *stat, +static void print_server_listing(memcached_st *memc, memcached_stat_st *memc_stat, memcached_server_st *server_list); static void print_analysis_report(memcached_st *memc, memcached_analysis_st *report, @@ -35,19 +49,19 @@ static char *analyze_mode= NULL; static struct option long_options[]= { - {"version", no_argument, NULL, OPT_VERSION}, - {"help", no_argument, NULL, OPT_HELP}, - {"verbose", no_argument, &opt_verbose, OPT_VERBOSE}, - {"debug", no_argument, &opt_verbose, OPT_DEBUG}, - {"servers", required_argument, NULL, OPT_SERVERS}, - {"flag", no_argument, &opt_displayflag, OPT_FLAG}, - {"analyze", optional_argument, NULL, OPT_ANALYZE}, + {(OPTIONSTRING)"version", no_argument, NULL, OPT_VERSION}, + {(OPTIONSTRING)"help", no_argument, NULL, OPT_HELP}, + {(OPTIONSTRING)"verbose", no_argument, &opt_verbose, OPT_VERBOSE}, + {(OPTIONSTRING)"debug", no_argument, &opt_verbose, OPT_DEBUG}, + {(OPTIONSTRING)"servers", required_argument, NULL, OPT_SERVERS}, + {(OPTIONSTRING)"flag", no_argument, &opt_displayflag, OPT_FLAG}, + {(OPTIONSTRING)"analyze", optional_argument, NULL, OPT_ANALYZE}, {0, 0, 0, 0}, }; int main(int argc, char *argv[]) { - memcached_return rc; + memcached_return_t rc; memcached_st *memc; memcached_stat_st *memc_stat; memcached_server_st *servers; @@ -102,7 +116,7 @@ int main(int argc, char *argv[]) static void run_analyzer(memcached_st *memc, memcached_stat_st *memc_stat, memcached_server_st *server_list) { - memcached_return rc; + memcached_return_t rc; if (analyze_mode == NULL) { @@ -168,12 +182,12 @@ static void run_analyzer(memcached_st *memc, memcached_stat_st *memc_stat, } gettimeofday(&end_time, NULL); - elapsed_time= timedif(end_time, start_time); - elapsed_time /= num_of_tests; + elapsed_time= (long) timedif(end_time, start_time); + elapsed_time /= (long) num_of_tests; if (elapsed_time > slowest_time) { - slowest_server= x; + slowest_server= (long)x; slowest_time= elapsed_time; } @@ -219,7 +233,7 @@ static void print_server_listing(memcached_st *memc, memcached_stat_st *memc_sta memcached_server_st *server_list) { unsigned int x; - memcached_return rc; + memcached_return_t rc; printf("Listing %u Server\n\n", memcached_server_count(memc)); for (x= 0; x < memcached_server_count(memc); x++)