]> err.no Git - varnish/commitdiff
Clean all but t_open timestamps to NAN at end of transaction.
authorphk <phk@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Fri, 13 Jul 2007 07:27:50 +0000 (07:27 +0000)
committerphk <phk@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Fri, 13 Jul 2007 07:27:50 +0000 (07:27 +0000)
git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@1684 d4fa192b-c00b-0410-8231-f00ffab90ce4

varnish-cache/bin/varnishd/cache_center.c
varnish-cache/bin/varnishd/cache_session.c

index 62ce3914828619a90268864c98792911cf44dcb4..4a7fec888f7a37ba5b1eaeae610b49b916fcffc5 100644 (file)
@@ -58,6 +58,7 @@ DOT start -> recv [style=bold,color=green,weight=4]
 
 #include <stdio.h>
 #include <errno.h>
+#include <math.h>
 #include <stdlib.h>
 #include <string.h>
 #include <unistd.h>
@@ -196,8 +197,11 @@ cnt_done(struct sess *sp)
            sp->xid, sp->t_req, sp->t_end, dh, dp, da);
 
        sp->xid = 0;
-       sp->t_open = sp->t_end;
        SES_Charge(sp);
+       sp->t_open = sp->t_end;
+       sp->t_req = NAN;
+       sp->t_resp = NAN;
+       sp->t_end = NAN;
        WSL_Flush(sp->wrk);
        if (sp->fd >= 0 && sp->doclose != NULL)
                vca_close_session(sp, sp->doclose);
index d4efdfb0c982e32ab4ef0c07def4498c63b06f52..ddec49ca4e55acba8aca718718e3035b158173b0 100644 (file)
@@ -229,6 +229,7 @@ SES_Charge(struct sess *sp)
 
        ses_sum_acct(&sp->acct, a);
        if (sp->srcaddr != NULL) {
+               /* XXX: only report once per second ? */
                CHECK_OBJ(sp->srcaddr, SRCADDR_MAGIC);
                LOCK(&sp->srcaddr->sah->mtx);
                ses_sum_acct(&sp->srcaddr->acct, a);