[master] 24d9048 Remove the CLI::stats command.

Poul-Henning Kamp phk at varnish-cache.org
Fri May 27 11:55:24 CEST 2011


commit 24d904838e3b8d0426d3347d2f3bbef07d98d135
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date:   Fri May 27 09:49:23 2011 +0000

    Remove the CLI::stats command.
    
    This was added as a quick-ish hack back in 1.0 days, but it was never
    meant to be a primary interface for getting stats information, and
    using it as such leads to problems.
    
    The CLI is single-threaded and any kind of TCP trouble from a client
    polling stats information would cause the CLI to get stuck, preventing
    any other kind of management from happening.
    
    The trigger for this removal is that the stats implementation has
    never learned to handle dynamic stats counters, and since this
    as added a lot of new stats, the next thing you need filtering
    facilites, paging etc.
    
    All of that belongs in varnishstat, where it is already implemented,
    and were its operation does not negatively impact the primary task
    of varnish: service HTTP clients.
    
    For reference we never made the mistake of showing the varnish-log
    from the CLI.
    
    See also ticket #925.

diff --git a/bin/varnishd/mgt_cli.c b/bin/varnishd/mgt_cli.c
index 4390866..66ee1b4 100644
--- a/bin/varnishd/mgt_cli.c
+++ b/bin/varnishd/mgt_cli.c
@@ -71,25 +71,6 @@ static const char	*secret_file;
 /*--------------------------------------------------------------------*/
 
 static void
-mcf_stats(struct cli *cli, const char * const *av, void *priv)
-{
-
-	(void)av;
-	(void)priv;
-
-	AN(VSC_main);
-#define VSC_DO_MAIN
-#define VSC_F(n, t, l, f, d) \
-	if (VSC_main->n != 0) \
-	    cli_out(cli, "%12ju  %s\n", (VSC_main->n), d);
-#include "vsc_fields.h"
-#undef VSC_F
-#undef VSC_DO_MAIN
-}
-
-/*--------------------------------------------------------------------*/
-
-static void
 mcf_banner(struct cli *cli, const char *const *av, void *priv)
 {
 
@@ -115,7 +96,6 @@ static struct cli_proto cli_proto[] = {
 	{ CLI_SERVER_STATUS,	"", mcf_server_status, NULL },
 	{ CLI_SERVER_START,	"", mcf_server_startstop, NULL },
 	{ CLI_SERVER_STOP,	"", mcf_server_startstop, cli_proto },
-	{ CLI_STATS,		"", mcf_stats, NULL },
 	{ CLI_VCL_LOAD,		"", mcf_config_load, NULL },
 	{ CLI_VCL_INLINE,	"", mcf_config_inline, NULL },
 	{ CLI_VCL_USE,		"", mcf_config_use, NULL },
diff --git a/bin/varnishtest/tests/b00008.vtc b/bin/varnishtest/tests/b00008.vtc
index 3d0c7e5..1e9aa9d 100644
--- a/bin/varnishtest/tests/b00008.vtc
+++ b/bin/varnishtest/tests/b00008.vtc
@@ -30,8 +30,6 @@ varnish v1 -start
 
 varnish v1 -cliok "help"
 
-varnish v1 -cliok "stats"
-
 varnish v1 -cliok "param.set waiter default"
 
 varnish v1 -clierr 106 "param.set waiter HASH(0x8839c4c)"
diff --git a/bin/varnishtest/tests/c00002.vtc b/bin/varnishtest/tests/c00002.vtc
index 6e633e0..62eaf17 100644
--- a/bin/varnishtest/tests/c00002.vtc
+++ b/bin/varnishtest/tests/c00002.vtc
@@ -16,5 +16,4 @@ client c1 {
 	expect resp.status == 200
 } -run
 
-varnish v1 -cliok stats
 varnish v1 -expect n_wrk == 8



More information about the varnish-commit mailing list