[4.1] 0e25e74 Remote variables not necessary to calculate the hit-rate
PÃ¥l Hermunn Johansen
hermunn at varnish-software.com
Wed Sep 14 12:44:11 CEST 2016
commit 0e25e7457a3c78c20130d08306480463d1ef4e9b
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 01c180c..a70b191 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