Commit 252722ca authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

Add stats counters for tracking the number of vcls loaded.



git-svn-id: http://www.varnish-cache.org/svn/trunk/varnish-cache@2913 d4fa192b-c00b-0410-8231-f00ffab90ce4
parent 00c14511
......@@ -172,6 +172,8 @@ VCL_Load(const char *fn, const char *name, struct cli *cli)
UNLOCK(&vcl_mtx);
cli_out(cli, "Loaded \"%s\" as \"%s\"\n", fn , name);
vcl->conf->init_func(cli);
VSL_stats->n_vcl++;
VSL_stats->n_vcl_avail++;
return (0);
}
......@@ -193,6 +195,8 @@ VCL_Nuke(struct vcls *vcl)
free(vcl->name);
(void)dlclose(vcl->dlh);
FREE_OBJ(vcl);
VSL_stats->n_vcl--;
VSL_stats->n_vcl_discard--;
}
/*--------------------------------------------------------------------*/
......@@ -266,6 +270,8 @@ ccf_config_discard(struct cli *cli, const char * const *av, void *priv)
cli_out(cli, "VCL %s is the active VCL", av[2]);
return;
}
VSL_stats->n_vcl_discard++;
VSL_stats->n_vcl_avail--;
vcl->conf->discard = 1;
UNLOCK(&vcl_mtx);
if (vcl->conf->busy == 0)
......
......@@ -105,3 +105,7 @@ MAC_STAT(sma_balloc, uint64_t, 'i', "SMA bytes allocated")
MAC_STAT(sma_bfree, uint64_t, 'i', "SMA bytes free")
MAC_STAT(backend_req, uint64_t, 'a', "Backend requests made")
MAC_STAT(n_vcl, uint64_t, 'a', "N vcl total")
MAC_STAT(n_vcl_avail, uint64_t, 'a', "N vcl available")
MAC_STAT(n_vcl_discard, uint64_t, 'a', "N vcl discarded")
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment