[master] 99cff3e Add two stats counters, counting number of gzip and gunzip operations.
Poul-Henning Kamp
phk at varnish-cache.org
Mon Jan 31 10:38:31 CET 2011
commit 99cff3e9b7685c3361e467f14c013b8595cf0c3f
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date: Mon Jan 31 09:37:38 2011 +0000
Add two stats counters, counting number of gzip and gunzip operations.
(fix a typo in previous commit)
diff --git a/bin/varnishd/cache_gzip.c b/bin/varnishd/cache_gzip.c
index 7ff3895..4522afd 100644
--- a/bin/varnishd/cache_gzip.c
+++ b/bin/varnishd/cache_gzip.c
@@ -160,6 +160,7 @@ VGZ_NewUngzip(struct sess *sp, const char *id)
CHECK_OBJ_NOTNULL(sp, SESS_MAGIC);
vg = vgz_alloc_vgz(sp, id);
+ VSC_main->n_gunzip++;
/*
* Max memory usage according to zonf.h:
@@ -179,6 +180,7 @@ VGZ_NewGzip(struct sess *sp, const char *id)
CHECK_OBJ_NOTNULL(sp, SESS_MAGIC);
vg = vgz_alloc_vgz(sp, id);
+ VSC_main->n_gzip++;
/*
* From zconf.h:
diff --git a/bin/varnishd/cache_response.c b/bin/varnishd/cache_response.c
index 94f2dd4..96ff344 100644
--- a/bin/varnishd/cache_response.c
+++ b/bin/varnishd/cache_response.c
@@ -253,7 +253,7 @@ res_WriteGunzipObj(struct sess *sp)
CHECK_OBJ_NOTNULL(sp, SESS_MAGIC);
- vg = VGZ_NewUngzip(sp, "U R -");
+ vg = VGZ_NewUngzip(sp, "U D -");
VTAILQ_FOREACH(st, &sp->obj->store, list) {
CHECK_OBJ_NOTNULL(sp, SESS_MAGIC);
diff --git a/include/vsc_fields.h b/include/vsc_fields.h
index dd68151..ffb56db 100644
--- a/include/vsc_fields.h
+++ b/include/vsc_fields.h
@@ -154,9 +154,11 @@ VSC_F(dir_dns_failed, uint64_t, 0, 'a', "DNS director failed lookups")
VSC_F(dir_dns_hit, uint64_t, 0, 'a', "DNS director cached lookups hit")
VSC_F(dir_dns_cache_full, uint64_t, 0, 'a', "DNS director full dnscache")
-
VSC_F(vmods, uint64_t, 0, 'i', "Loaded VMODs")
+VSC_F(n_gzip, uint64_t, 0, 'a', "Gzip operations")
+VSC_F(n_gunzip, uint64_t, 0, 'a', "Gunzip operations")
+
#endif
/**********************************************************************/
More information about the varnish-commit
mailing list