[master] 0fe58fb Remote variables not necessary to calculate the hit-rate
Arianna Aondio
arianna.aondio at varnish-software.com
Wed Sep 14 10:57:13 CEST 2016
commit 0fe58fb3a80e20f9152f575e36fe1c6c930532b0
Author: Arianna Aondio <arianna.aondio at varnish-software.com>
Date: Tue Aug 2 14:13:00 2016 +0000
Remote variables not necessary to calculate the hit-rate
diff --git a/bin/varnishstat/varnishstat_curses.c b/bin/varnishstat/varnishstat_curses.c
index ef3e1d3..b96101d 100644
--- a/bin/varnishstat/varnishstat_curses.c
+++ b/bin/varnishstat/varnishstat_curses.c
@@ -95,7 +95,6 @@ struct pt {
};
struct hitrate {
- double lt;
uint64_t lhit, lmiss;
struct ma hr_10;
struct ma hr_100;
@@ -411,21 +410,16 @@ sample_points(void)
static void
sample_hitrate(void)
{
- double tv,dt;
double hr, mr, ratio;
uint64_t hit, miss;
if (VSC_C_main == NULL)
return;
- tv = VTIM_mono();
- dt = tv - hitrate.lt;
- hitrate.lt= tv;
-
hit = VSC_C_main->cache_hit;
miss = VSC_C_main->cache_miss;
- hr = (hit - hitrate.lhit) / dt;
- mr = (miss - hitrate.lmiss) / dt;
+ hr = hit - hitrate.lhit;
+ mr = miss - hitrate.lmiss;
hitrate.lhit = hit;
hitrate.lmiss = miss;
More information about the varnish-commit
mailing list