BBlack has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/71647


Change subject: add dequeue stat
......................................................................

add dequeue stat

Change-Id: I189c387429289e4f22e107038c72ae0a84d6bec1
---
M src/stats.c
M src/stats.h
M src/strq.c
3 files changed, 6 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/software/varnish/vhtcpd 
refs/changes/47/71647/1

diff --git a/src/stats.c b/src/stats.c
index 063b2eb..f13d6f9 100644
--- a/src/stats.c
+++ b/src/stats.c
@@ -43,12 +43,14 @@
                  " inpkts_recvd: %" PRIu64
                  " inpkts_sane: %" PRIu64
                  " inpkts_enqueued: %" PRIu64
+                 " inpkts_dequeued: %" PRIu64
                  " queue_overflows: %" PRIu64,
                  (uint64_t)start_time,
                  (uint64_t)(now - start_time),
                  stats.inpkts_recvd,
                  stats.inpkts_sane,
                  stats.inpkts_enqueued,
+                 stats.inpkts_dequeued,
                  stats.queue_overflows
     );
 }
@@ -65,6 +67,7 @@
                  " inpkts_recvd:%" PRIu64
                  " inpkts_sane:%" PRIu64
                  " inpkts_enqueued:%" PRIu64
+                 " inpkts_dequeued:%" PRIu64
                  " queue_overflows:%" PRIu64
                  "\n",
                  (uint64_t)start_time,
@@ -72,6 +75,7 @@
                  stats.inpkts_recvd,
                  stats.inpkts_sane,
                  stats.inpkts_enqueued,
+                 stats.inpkts_dequeued,
                  stats.queue_overflows
     );
     if(fpf_rv < 0) {
diff --git a/src/stats.h b/src/stats.h
index a273c8d..30c5b82 100644
--- a/src/stats.h
+++ b/src/stats.h
@@ -9,6 +9,7 @@
     uint64_t inpkts_recvd;
     uint64_t inpkts_sane;
     uint64_t inpkts_enqueued;
+    uint64_t inpkts_dequeued;
     uint64_t queue_overflows;
 } stats_t;
 
diff --git a/src/strq.c b/src/strq.c
index f263d26..c22565b 100644
--- a/src/strq.c
+++ b/src/strq.c
@@ -169,6 +169,7 @@
         q->vheads[vhead] &= (q->q_alloc - 1U); // mod po2 to wrap
 
         if(advance_head) {
+            stats.inpkts_dequeued++;
             q->q_head++;
             q->q_head &= (q->q_alloc - 1U); // mod po2 to wrap
             q->q_size--;

-- 
To view, visit https://gerrit.wikimedia.org/r/71647
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I189c387429289e4f22e107038c72ae0a84d6bec1
Gerrit-PatchSet: 1
Gerrit-Project: operations/software/varnish/vhtcpd
Gerrit-Branch: master
Gerrit-Owner: BBlack <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to