[master] f46e5c7 Add a display format field to the VSC_F table
Martin Blix Grydeland
martin at varnish-software.com
Tue Jan 27 17:17:56 CET 2015
commit f46e5c7308a3a2ace489702c6078e9a54b4d5274
Author: Martin Blix Grydeland <martin at varnish-software.com>
Date: Tue Jan 27 15:47:28 2015 +0100
Add a display format field to the VSC_F table
The field describes how to best display the field.
diff --git a/bin/varnishd/cache/cache.h b/bin/varnishd/cache/cache.h
index d307c38..fccc466 100644
--- a/bin/varnishd/cache/cache.h
+++ b/bin/varnishd/cache/cache.h
@@ -268,7 +268,7 @@ struct acct_bereq {
#define L0(t, n)
#define L1(t, n) t n;
-#define VSC_F(n,t,l,s,v,d,e) L##l(t, n)
+#define VSC_F(n,t,l,s,f,v,d,e) L##l(t, n)
struct dstat {
unsigned summs;
#include "tbl/vsc_f_main.h"
diff --git a/bin/varnishd/cache/cache_pool.c b/bin/varnishd/cache/cache_pool.c
index 5c1c444..95e3e75 100644
--- a/bin/varnishd/cache/cache_pool.c
+++ b/bin/varnishd/cache/cache_pool.c
@@ -93,7 +93,7 @@ pool_sumstat(const struct dstat *src)
Lck_AssertHeld(&wstat_mtx);
#define L0(n)
#define L1(n) (VSC_C_main->n += src->n)
-#define VSC_F(n,t,l,s,v,d,e) L##l(n);
+#define VSC_F(n,t,l,s,f,v,d,e) L##l(n);
#include "tbl/vsc_f_main.h"
#undef VSC_F
#undef L0
@@ -132,7 +132,7 @@ pool_addstat(struct dstat *dst, struct dstat *src)
dst->summs++;
#define L0(n)
#define L1(n) (dst->n += src->n)
-#define VSC_F(n,t,l,s,v,d,e) L##l(n);
+#define VSC_F(n,t,l,s,f,v,d,e) L##l(n);
#include "tbl/vsc_f_main.h"
#undef VSC_F
#undef L0
diff --git a/include/tbl/vsc_f_main.h b/include/tbl/vsc_f_main.h
index 87555ed..6bd68c1 100644
--- a/include/tbl/vsc_f_main.h
+++ b/include/tbl/vsc_f_main.h
@@ -35,7 +35,7 @@
* Globals, not related to traffic
*/
-VSC_F(uptime, uint64_t, 0, 'c', info,
+VSC_F(uptime, uint64_t, 0, 'c', 'i', info,
"Child process uptime",
"How long the child process has been running."
)
@@ -45,56 +45,56 @@ VSC_F(uptime, uint64_t, 0, 'c', info,
* Sessions
*/
-VSC_F(sess_conn, uint64_t, 1, 'c', info,
+VSC_F(sess_conn, uint64_t, 1, 'c', 'i', info,
"Sessions accepted",
"Count of sessions successfully accepted"
)
-VSC_F(sess_drop, uint64_t, 1, 'c', info,
+VSC_F(sess_drop, uint64_t, 1, 'c', 'i', info,
"Sessions dropped",
"Count of sessions silently dropped due to lack of worker thread."
)
-VSC_F(sess_fail, uint64_t, 1, 'c', info,
+VSC_F(sess_fail, uint64_t, 1, 'c', 'i', info,
"Session accept failures",
"Count of failures to accept TCP connection."
" Either the client changed its mind, or the kernel ran out of"
" some resource like file descriptors."
)
-VSC_F(sess_pipe_overflow, uint64_t, 1, 'c', info,
+VSC_F(sess_pipe_overflow, uint64_t, 1, 'c', 'i', info,
"Session pipe overflow",
"Count of sessions dropped due to the session pipe overflowing."
)
/*---------------------------------------------------------------------*/
-VSC_F(client_req_400, uint64_t, 1, 'c', info,
+VSC_F(client_req_400, uint64_t, 1, 'c', 'i', info,
"Client requests received, subject to 400 errors",
"400 means we couldn't make sense of the request, it was"
" malformed in some drastic way."
)
-VSC_F(client_req_417, uint64_t, 1, 'c', info,
+VSC_F(client_req_417, uint64_t, 1, 'c', 'i', info,
"Client requests received, subject to 417 errors",
"417 means that something went wrong with an Expect: header."
)
-VSC_F(client_req, uint64_t, 1, 'c', info,
+VSC_F(client_req, uint64_t, 1, 'c', 'i', info,
"Good client requests received",
"The count of parseable client requests seen."
)
/*---------------------------------------------------------------------*/
-VSC_F(cache_hit, uint64_t, 1, 'c', info,
+VSC_F(cache_hit, uint64_t, 1, 'c', 'i', info,
"Cache hits",
"Count of cache hits. "
" A cache hit indicates that an object has been delivered to a"
" client without fetching it from a backend server."
)
-VSC_F(cache_hitpass, uint64_t, 1, 'c', info,
+VSC_F(cache_hitpass, uint64_t, 1, 'c', 'i', info,
"Cache hits for pass",
"Count of hits for pass"
" A cache hit for pass indicates that Varnish is going to"
@@ -103,7 +103,7 @@ VSC_F(cache_hitpass, uint64_t, 1, 'c', info,
" decision is being used."
)
-VSC_F(cache_miss, uint64_t, 1, 'c', info,
+VSC_F(cache_miss, uint64_t, 1, 'c', 'i', info,
"Cache misses",
"Count of misses"
" A cache miss indicates the object was fetched from the"
@@ -112,34 +112,34 @@ VSC_F(cache_miss, uint64_t, 1, 'c', info,
/*---------------------------------------------------------------------*/
-VSC_F(backend_conn, uint64_t, 0, 'c', info,
+VSC_F(backend_conn, uint64_t, 0, 'c', 'i', info,
"Backend conn. success",
"How many backend connections have successfully been"
" established."
)
-VSC_F(backend_unhealthy, uint64_t, 0, 'c', info,
+VSC_F(backend_unhealthy, uint64_t, 0, 'c', 'i', info,
"Backend conn. not attempted",
""
)
-VSC_F(backend_busy, uint64_t, 0, 'c', info,
+VSC_F(backend_busy, uint64_t, 0, 'c', 'i', info,
"Backend conn. too many",
""
)
-VSC_F(backend_fail, uint64_t, 0, 'c', info,
+VSC_F(backend_fail, uint64_t, 0, 'c', 'i', info,
"Backend conn. failures",
""
)
-VSC_F(backend_reuse, uint64_t, 0, 'c', info,
+VSC_F(backend_reuse, uint64_t, 0, 'c', 'i', info,
"Backend conn. reuses",
"Count of backend connection reuses"
" This counter is increased whenever we reuse a recycled connection."
)
-VSC_F(backend_toolate, uint64_t, 0, 'c', info,
+VSC_F(backend_toolate, uint64_t, 0, 'c', 'i', info,
"Backend conn. was closed",
""
)
-VSC_F(backend_recycle, uint64_t, 0, 'c', info,
+VSC_F(backend_recycle, uint64_t, 0, 'c', 'i', info,
"Backend conn. recycles",
"Count of backend connection recycles"
" This counter is increased whenever we have a keep-alive"
@@ -147,7 +147,7 @@ VSC_F(backend_recycle, uint64_t, 0, 'c', info,
" It has not yet been used, but it might be, unless the backend"
" closes it."
)
-VSC_F(backend_retry, uint64_t, 0, 'c', info,
+VSC_F(backend_retry, uint64_t, 0, 'c', 'i', info,
"Backend conn. retry",
""
)
@@ -156,47 +156,47 @@ VSC_F(backend_retry, uint64_t, 0, 'c', info,
* Backend fetch statistics
*/
-VSC_F(fetch_head, uint64_t, 1, 'c', info,
+VSC_F(fetch_head, uint64_t, 1, 'c', 'i', info,
"Fetch no body (HEAD)",
"beresp with no body because the request is HEAD."
)
-VSC_F(fetch_length, uint64_t, 1, 'c', info,
+VSC_F(fetch_length, uint64_t, 1, 'c', 'i', info,
"Fetch with Length",
"beresp.body with Content-Length."
)
-VSC_F(fetch_chunked, uint64_t, 1, 'c', info,
+VSC_F(fetch_chunked, uint64_t, 1, 'c', 'i', info,
"Fetch chunked",
"beresp.body with Chunked."
)
-VSC_F(fetch_eof, uint64_t, 1, 'c', info,
+VSC_F(fetch_eof, uint64_t, 1, 'c', 'i', info,
"Fetch EOF",
"beresp.body with EOF."
)
-VSC_F(fetch_bad, uint64_t, 1, 'c', info,
+VSC_F(fetch_bad, uint64_t, 1, 'c', 'i', info,
"Fetch bad T-E",
"beresp.body length/fetch could not be determined."
)
-VSC_F(fetch_none, uint64_t, 1, 'c', info,
+VSC_F(fetch_none, uint64_t, 1, 'c', 'i', info,
"Fetch no body",
"beresp.body empty"
)
-VSC_F(fetch_1xx, uint64_t, 1, 'c', info,
+VSC_F(fetch_1xx, uint64_t, 1, 'c', 'i', info,
"Fetch no body (1xx)",
"beresp with no body because of 1XX response."
)
-VSC_F(fetch_204, uint64_t, 1, 'c', info,
+VSC_F(fetch_204, uint64_t, 1, 'c', 'i', info,
"Fetch no body (204)",
"beresp with no body because of 204 response."
)
-VSC_F(fetch_304, uint64_t, 1, 'c', info,
+VSC_F(fetch_304, uint64_t, 1, 'c', 'i', info,
"Fetch no body (304)",
"beresp with no body because of 304 response."
)
-VSC_F(fetch_failed, uint64_t, 1, 'c', info,
+VSC_F(fetch_failed, uint64_t, 1, 'c', 'i', info,
"Fetch failed (all causes)",
"beresp fetch failed."
)
-VSC_F(fetch_no_thread, uint64_t, 1, 'c', info,
+VSC_F(fetch_no_thread, uint64_t, 1, 'c', 'i', info,
"Fetch failed (no thread)",
"beresp fetch failed, no thread available."
)
@@ -207,75 +207,75 @@ VSC_F(fetch_no_thread, uint64_t, 1, 'c', info,
*
*/
-VSC_F(pools, uint64_t, 0, 'g', info,
+VSC_F(pools, uint64_t, 0, 'g', 'i', info,
"Number of thread pools",
"Number of thread pools. See also parameter thread_pools."
" NB: Presently pools cannot be removed once created."
)
-VSC_F(threads, uint64_t, 0, 'g', info,
+VSC_F(threads, uint64_t, 0, 'g', 'i', info,
"Total number of threads",
"Number of threads in all pools."
" See also parameters thread_pools, thread_pool_min and"
" thread_pool_max."
)
-VSC_F(threads_limited, uint64_t, 0, 'c', info,
+VSC_F(threads_limited, uint64_t, 0, 'c', 'i', info,
"Threads hit max",
"Number of times more threads were needed, but limit was reached"
" in a thread pool."
" See also parameter thread_pool_max."
)
-VSC_F(threads_created, uint64_t, 0, 'c', info,
+VSC_F(threads_created, uint64_t, 0, 'c', 'i', info,
"Threads created",
"Total number of threads created in all pools."
)
-VSC_F(threads_destroyed, uint64_t, 0, 'c', info,
+VSC_F(threads_destroyed, uint64_t, 0, 'c', 'i', info,
"Threads destroyed",
"Total number of threads destroyed in all pools."
)
-VSC_F(threads_failed, uint64_t, 0, 'c', info,
+VSC_F(threads_failed, uint64_t, 0, 'c', 'i', info,
"Thread creation failed",
"Number of times creating a thread failed."
" See VSL::Debug for diagnostics."
" See also parameter thread_fail_delay."
)
-VSC_F(thread_queue_len, uint64_t, 0, 'g', info,
+VSC_F(thread_queue_len, uint64_t, 0, 'g', 'i', info,
"Length of session queue",
"Length of session queue waiting for threads."
" NB: Only updates once per second."
" See also parameter queue_max."
)
-VSC_F(busy_sleep, uint64_t, 1, 'c', info,
+VSC_F(busy_sleep, uint64_t, 1, 'c', 'i', info,
"Number of requests sent to sleep on busy objhdr",
"Number of requests sent to sleep without a worker thread because"
" they found a busy object."
)
-VSC_F(busy_wakeup, uint64_t, 1, 'c', info,
+VSC_F(busy_wakeup, uint64_t, 1, 'c', 'i', info,
"Number of requests woken after sleep on busy objhdr",
"Number of requests taken of the busy object sleep list and"
" and rescheduled."
)
-VSC_F(busy_killed, uint64_t, 1, 'c', info,
+VSC_F(busy_killed, uint64_t, 1, 'c', 'i', info,
"Number of requests killed after sleep on busy objhdr",
"Number of requests killed from the busy object sleep list"
" due to lack of resources."
)
-VSC_F(sess_queued, uint64_t, 0, 'c', info,
+VSC_F(sess_queued, uint64_t, 0, 'c', 'i', info,
"Sessions queued for thread",
"Number of times session was queued waiting for a thread."
" See also parameter queue_max."
)
-VSC_F(sess_dropped, uint64_t, 0, 'c', info,
+VSC_F(sess_dropped, uint64_t, 0, 'c', 'i', info,
"Sessions dropped for thread",
"Number of times session was dropped because the queue were too"
" long already. See also parameter queue_max."
@@ -283,245 +283,245 @@ VSC_F(sess_dropped, uint64_t, 0, 'c', info,
/*---------------------------------------------------------------------*/
-VSC_F(n_object, uint64_t, 1, 'g', info,
+VSC_F(n_object, uint64_t, 1, 'g', 'i', info,
"object structs made",
"Number of object structs made"
)
-VSC_F(n_vampireobject, uint64_t, 1, 'g', diag,
+VSC_F(n_vampireobject, uint64_t, 1, 'g', 'i', diag,
"unresurrected objects",
"Number of unresurrected objects"
)
-VSC_F(n_objectcore, uint64_t, 1, 'g', info,
+VSC_F(n_objectcore, uint64_t, 1, 'g', 'i', info,
"objectcore structs made",
"Number of objectcore structs made"
)
-VSC_F(n_objecthead, uint64_t, 1, 'g', info,
+VSC_F(n_objecthead, uint64_t, 1, 'g', 'i', info,
"objecthead structs made",
"Number of objecthead structs made"
)
-VSC_F(n_waitinglist, uint64_t, 1, 'g', debug,
+VSC_F(n_waitinglist, uint64_t, 1, 'g', 'i', debug,
"waitinglist structs made",
"Number of waitinglist structs made"
)
-VSC_F(n_backend, uint64_t, 0, 'g', info,
+VSC_F(n_backend, uint64_t, 0, 'g', 'i', info,
"Number of backends",
"Number of backends known to us."
)
-VSC_F(n_expired, uint64_t, 0, 'g', info,
+VSC_F(n_expired, uint64_t, 0, 'g', 'i', info,
"Number of expired objects",
"Number of objects that expired from cache"
" because of old age."
)
-VSC_F(n_lru_nuked, uint64_t, 0, 'g', info,
+VSC_F(n_lru_nuked, uint64_t, 0, 'g', 'i', info,
"Number of LRU nuked objects",
"How many objects have been forcefully evicted"
" from storage to make room for a new object."
)
-VSC_F(n_lru_moved, uint64_t, 0, 'g', diag,
+VSC_F(n_lru_moved, uint64_t, 0, 'g', 'i', diag,
"Number of LRU moved objects",
"Number of move operations done on the LRU list."
)
-VSC_F(losthdr, uint64_t, 0, 'c', info,
+VSC_F(losthdr, uint64_t, 0, 'c', 'i', info,
"HTTP header overflows",
""
)
-VSC_F(s_sess, uint64_t, 1, 'c', info,
+VSC_F(s_sess, uint64_t, 1, 'c', 'i', info,
"Total sessions seen",
""
)
-VSC_F(s_req, uint64_t, 1, 'c', info,
+VSC_F(s_req, uint64_t, 1, 'c', 'i', info,
"Total requests seen",
""
)
-VSC_F(s_pipe, uint64_t, 1, 'c', info,
+VSC_F(s_pipe, uint64_t, 1, 'c', 'i', info,
"Total pipe sessions seen",
""
)
-VSC_F(s_pass, uint64_t, 1, 'c', info,
+VSC_F(s_pass, uint64_t, 1, 'c', 'i', info,
"Total pass-ed requests seen",
""
)
-VSC_F(s_fetch, uint64_t, 1, 'c', info,
+VSC_F(s_fetch, uint64_t, 1, 'c', 'i', info,
"Total backend fetches initiated",
""
)
-VSC_F(s_synth, uint64_t, 1, 'c', info,
+VSC_F(s_synth, uint64_t, 1, 'c', 'i', info,
"Total synthethic responses made",
""
)
-VSC_F(s_req_hdrbytes, uint64_t, 1, 'c', info,
+VSC_F(s_req_hdrbytes, uint64_t, 1, 'c', 'i', info,
"Request header bytes",
"Total request header bytes received"
)
-VSC_F(s_req_bodybytes, uint64_t, 1, 'c', info,
+VSC_F(s_req_bodybytes, uint64_t, 1, 'c', 'i', info,
"Request body bytes",
"Total request body bytes received"
)
-VSC_F(s_resp_hdrbytes, uint64_t, 1, 'c', info,
+VSC_F(s_resp_hdrbytes, uint64_t, 1, 'c', 'i', info,
"Response header bytes",
"Total response header bytes transmitted"
)
-VSC_F(s_resp_bodybytes, uint64_t, 1, 'c', info,
+VSC_F(s_resp_bodybytes, uint64_t, 1, 'c', 'i', info,
"Response body bytes",
"Total response body bytes transmitted"
)
-VSC_F(s_pipe_hdrbytes, uint64_t, 0, 'c', info,
+VSC_F(s_pipe_hdrbytes, uint64_t, 0, 'c', 'i', info,
"Pipe request header bytes",
"Total request bytes received for piped sessions"
)
-VSC_F(s_pipe_in, uint64_t, 0, 'c', info,
+VSC_F(s_pipe_in, uint64_t, 0, 'c', 'i', info,
"Piped bytes from client",
"Total number of bytes forwarded from clients in"
" pipe sessions"
)
-VSC_F(s_pipe_out, uint64_t, 0, 'c', info,
+VSC_F(s_pipe_out, uint64_t, 0, 'c', 'i', info,
"Piped bytes to client",
"Total number of bytes forwarded to clients in"
" pipe sessions"
)
-VSC_F(sess_closed, uint64_t, 1, 'c', info,
+VSC_F(sess_closed, uint64_t, 1, 'c', 'i', info,
"Session Closed",
""
)
-VSC_F(sess_pipeline, uint64_t, 1, 'c', info,
+VSC_F(sess_pipeline, uint64_t, 1, 'c', 'i', info,
"Session Pipeline",
""
)
-VSC_F(sess_readahead, uint64_t, 1, 'c', info,
+VSC_F(sess_readahead, uint64_t, 1, 'c', 'i', info,
"Session Read Ahead",
""
)
-VSC_F(sess_herd, uint64_t, 1, 'c', diag,
+VSC_F(sess_herd, uint64_t, 1, 'c', 'i', diag,
"Session herd",
""
)
/*--------------------------------------------------------------------*/
-VSC_F(shm_records, uint64_t, 0, 'c', diag,
+VSC_F(shm_records, uint64_t, 0, 'c', 'i', diag,
"SHM records",
""
)
-VSC_F(shm_writes, uint64_t, 0, 'c', diag,
+VSC_F(shm_writes, uint64_t, 0, 'c', 'i', diag,
"SHM writes",
""
)
-VSC_F(shm_flushes, uint64_t, 0, 'c', diag,
+VSC_F(shm_flushes, uint64_t, 0, 'c', 'i', diag,
"SHM flushes due to overflow",
""
)
-VSC_F(shm_cont, uint64_t, 0, 'c', diag,
+VSC_F(shm_cont, uint64_t, 0, 'c', 'i', diag,
"SHM MTX contention",
""
)
-VSC_F(shm_cycles, uint64_t, 0, 'c', diag,
+VSC_F(shm_cycles, uint64_t, 0, 'c', 'i', diag,
"SHM cycles through buffer",
""
)
/*--------------------------------------------------------------------*/
-VSC_F(backend_req, uint64_t, 0, 'c', info,
+VSC_F(backend_req, uint64_t, 0, 'c', 'i', info,
"Backend requests made",
""
)
/*--------------------------------------------------------------------*/
-VSC_F(n_vcl, uint64_t, 0, 'c', info,
+VSC_F(n_vcl, uint64_t, 0, 'c', 'i', info,
"Number of loaded VCLs in total",
""
)
-VSC_F(n_vcl_avail, uint64_t, 0, 'c', diag,
+VSC_F(n_vcl_avail, uint64_t, 0, 'c', 'i', diag,
"Number of VCLs available",
""
)
-VSC_F(n_vcl_discard, uint64_t, 0, 'c', diag,
+VSC_F(n_vcl_discard, uint64_t, 0, 'c', 'i', diag,
"Number of discarded VCLs",
""
)
/*--------------------------------------------------------------------*/
-VSC_F(bans, uint64_t, 0, 'g', info,
+VSC_F(bans, uint64_t, 0, 'g', 'i', info,
"Count of bans",
"Number of all bans in system, including bans superseded"
" by newer bans and bans already checked by the ban-lurker."
)
-VSC_F(bans_completed, uint64_t, 0, 'g', diag,
+VSC_F(bans_completed, uint64_t, 0, 'g', 'i', diag,
"Number of bans marked 'completed'",
"Number of bans which are no longer active, either because they"
" got checked by the ban-lurker or superseded by newer identical bans."
)
-VSC_F(bans_obj, uint64_t, 0, 'g', diag,
+VSC_F(bans_obj, uint64_t, 0, 'g', 'i', diag,
"Number of bans using obj.*",
"Number of bans which use obj.* variables. These bans can possibly"
" be washed by the ban-lurker."
)
-VSC_F(bans_req, uint64_t, 0, 'g', diag,
+VSC_F(bans_req, uint64_t, 0, 'g', 'i', diag,
"Number of bans using req.*",
"Number of bans which use req.* variables. These bans can not"
" be washed by the ban-lurker."
)
-VSC_F(bans_added, uint64_t, 0, 'c', diag,
+VSC_F(bans_added, uint64_t, 0, 'c', 'i', diag,
"Bans added",
"Counter of bans added to ban list."
)
-VSC_F(bans_deleted, uint64_t, 0, 'c', diag,
+VSC_F(bans_deleted, uint64_t, 0, 'c', 'i', diag,
"Bans deleted",
"Counter of bans deleted from ban list."
)
-VSC_F(bans_tested, uint64_t, 0, 'c', diag,
+VSC_F(bans_tested, uint64_t, 0, 'c', 'i', diag,
"Bans tested against objects (lookup)",
"Count of how many bans and objects have been tested against"
" each other during hash lookup."
)
-VSC_F(bans_obj_killed, uint64_t, 0, 'c', diag,
+VSC_F(bans_obj_killed, uint64_t, 0, 'c', 'i', diag,
"Objects killed by bans (lookup)",
"Number of objects killed by bans during object lookup."
)
-VSC_F(bans_lurker_tested, uint64_t, 0, 'c', diag,
+VSC_F(bans_lurker_tested, uint64_t, 0, 'c', 'i', diag,
"Bans tested against objects (lurker)",
"Count of how many bans and objects have been tested against"
" each other by the ban-lurker."
)
-VSC_F(bans_tests_tested, uint64_t, 0, 'c', diag,
+VSC_F(bans_tests_tested, uint64_t, 0, 'c', 'i', diag,
"Ban tests tested against objects (lookup)",
"Count of how many tests and objects have been tested against"
" each other during lookup."
" 'ban req.url == foo && req.http.host == bar'"
" counts as one in 'bans_tested' and as two in 'bans_tests_tested'"
)
-VSC_F(bans_lurker_tests_tested, uint64_t, 0, 'c', diag,
+VSC_F(bans_lurker_tests_tested, uint64_t, 0, 'c', 'i', diag,
"Ban tests tested against objects (lurker)",
"Count of how many tests and objects have been tested against"
" each other by the ban-lurker."
" 'ban req.url == foo && req.http.host == bar'"
" counts as one in 'bans_tested' and as two in 'bans_tests_tested'"
)
-VSC_F(bans_lurker_obj_killed, uint64_t, 0, 'c', diag,
+VSC_F(bans_lurker_obj_killed, uint64_t, 0, 'c', 'i', diag,
"Objects killed by bans (lurker)",
"Number of objects killed by ban-lurker."
)
-VSC_F(bans_dups, uint64_t, 0, 'c', diag,
+VSC_F(bans_dups, uint64_t, 0, 'c', 'i', diag,
"Bans superseded by other bans",
"Count of bans replaced by later identical bans."
)
-VSC_F(bans_lurker_contention, uint64_t, 0, 'c', diag,
+VSC_F(bans_lurker_contention, uint64_t, 0, 'c', 'i', diag,
"Lurker gave way for lookup",
"Number of times the ban-lurker had to wait for lookups."
)
-VSC_F(bans_persisted_bytes, uint64_t, 0, 'g', diag,
+VSC_F(bans_persisted_bytes, uint64_t, 0, 'g', 'i', diag,
"Bytes used by the persisted ban lists",
"Number of bytes used by the persisted ban lists."
)
-VSC_F(bans_persisted_fragmentation, uint64_t, 0, 'g', diag,
+VSC_F(bans_persisted_fragmentation, uint64_t, 0, 'g', 'i', diag,
"Extra bytes in persisted ban lists due to fragmentation",
"Number of extra bytes accumulated through dropped and"
" completed bans in the persistent ban lists."
@@ -529,100 +529,100 @@ VSC_F(bans_persisted_fragmentation, uint64_t, 0, 'g', diag,
/*--------------------------------------------------------------------*/
-VSC_F(n_purges, uint64_t, 0, 'g', info,
+VSC_F(n_purges, uint64_t, 0, 'g', 'i', info,
"Number of purge operations executed",
""
)
-VSC_F(n_obj_purged, uint64_t, 0, 'g', info,
+VSC_F(n_obj_purged, uint64_t, 0, 'g', 'i', info,
"Number of purged objects",
""
)
/*--------------------------------------------------------------------*/
-VSC_F(exp_mailed, uint64_t, 0, 'c', diag,
+VSC_F(exp_mailed, uint64_t, 0, 'c', 'i', diag,
"Number of objects mailed to expiry thread",
"Number of objects mailed to expiry thread for handling."
)
-VSC_F(exp_received, uint64_t, 0, 'c', diag,
+VSC_F(exp_received, uint64_t, 0, 'c', 'i', diag,
"Number of objects received by expiry thread",
"Number of objects received by expiry thread for handling."
)
/*--------------------------------------------------------------------*/
-VSC_F(hcb_nolock, uint64_t, 1, 'c', debug,
+VSC_F(hcb_nolock, uint64_t, 1, 'c', 'i', debug,
"HCB Lookups without lock",
""
)
-VSC_F(hcb_lock, uint64_t, 0, 'c', debug,
+VSC_F(hcb_lock, uint64_t, 0, 'c', 'i', debug,
"HCB Lookups with lock",
""
)
-VSC_F(hcb_insert, uint64_t, 0, 'c', debug,
+VSC_F(hcb_insert, uint64_t, 0, 'c', 'i', debug,
"HCB Inserts",
""
)
/*--------------------------------------------------------------------*/
-VSC_F(esi_errors, uint64_t, 0, 'c', diag,
+VSC_F(esi_errors, uint64_t, 0, 'c', 'i', diag,
"ESI parse errors (unlock)",
""
)
-VSC_F(esi_warnings, uint64_t, 0, 'c', diag,
+VSC_F(esi_warnings, uint64_t, 0, 'c', 'i', diag,
"ESI parse warnings (unlock)",
""
)
/*--------------------------------------------------------------------*/
-VSC_F(vmods, uint64_t, 0, 'g', info,
+VSC_F(vmods, uint64_t, 0, 'g', 'i', info,
"Loaded VMODs",
""
)
/*--------------------------------------------------------------------*/
-VSC_F(n_gzip, uint64_t, 0, 'c', info,
+VSC_F(n_gzip, uint64_t, 0, 'c', 'i', info,
"Gzip operations",
""
)
-VSC_F(n_gunzip, uint64_t, 0, 'c', info,
+VSC_F(n_gunzip, uint64_t, 0, 'c', 'i', info,
"Gunzip operations",
""
)
/*--------------------------------------------------------------------*/
-VSC_F(vsm_free, uint64_t, 0, 'g', diag,
+VSC_F(vsm_free, uint64_t, 0, 'g', 'i', diag,
"Free VSM space",
"Number of bytes free in the shared memory used to communicate"
" with tools like varnishstat, varnishlog etc."
)
-VSC_F(vsm_used, uint64_t, 0, 'g', diag,
+VSC_F(vsm_used, uint64_t, 0, 'g', 'i', diag,
"Used VSM space",
"Number of bytes used in the shared memory used to communicate"
" with tools like varnishstat, varnishlog etc."
)
-VSC_F(vsm_cooling, uint64_t, 0, 'g', debug,
+VSC_F(vsm_cooling, uint64_t, 0, 'g', 'i', debug,
"Cooling VSM space",
"Number of bytes which will soon (max 1 minute) be freed"
" in the shared memory used to communicate"
" with tools like varnishstat, varnishlog etc."
)
-VSC_F(vsm_overflow, uint64_t, 0, 'g', diag,
+VSC_F(vsm_overflow, uint64_t, 0, 'g', 'i', diag,
"Overflow VSM space",
"Number of bytes which does not fit"
" in the shared memory used to communicate"
" with tools like varnishstat, varnishlog etc."
)
-VSC_F(vsm_overflowed, uint64_t, 0, 'c', diag,
+VSC_F(vsm_overflowed, uint64_t, 0, 'c', 'i', diag,
"Overflowed VSM space",
"Total number of bytes which did not fit"
" in the shared memory used to communicate"
diff --git a/include/tbl/vsc_fields.h b/include/tbl/vsc_fields.h
index c7bc451..0cdb51f 100644
--- a/include/tbl/vsc_fields.h
+++ b/include/tbl/vsc_fields.h
@@ -29,7 +29,7 @@
* Definition of all shared memory statistics below (except main - see
* include/tbl/vsc_f_main.h).
*
- * Fields (n, t, l, s, v, d, e):
+ * Fields (n, t, l, s, f, v, d, e):
* n - Name: Field name, in C-source and stats programs
* t - C-type: uint64_t, unless marked in 's'
* l - Local: Local counter in worker thread.
@@ -37,6 +37,9 @@
* 'b' - Bitmap
* 'c' - Counter, never decreases.
* 'g' - Gauge, goes up and down
+ * f - Format: Display format for the field
+ * 'b' - Bitmap
+ * 'i' - Integer
* v - Verbosity: Counter verbosity level (see vsc_levels.h)
* d - Description: Short description of field (for screen use)
* e - Explanation: Long explanation of field (for doc use)
@@ -61,32 +64,32 @@
#ifdef VSC_DO_MGT
-VSC_F(uptime, uint64_t, 0, 'c', info,
+VSC_F(uptime, uint64_t, 0, 'c', 'i', info,
"Management process uptime",
"Uptime in seconds of the management process"
)
-VSC_F(child_start, uint64_t, 0, 'c', diag,
+VSC_F(child_start, uint64_t, 0, 'c', 'i', diag,
"Child process started",
"Number of times the child process has been started"
)
-VSC_F(child_exit, uint64_t, 0, 'c', diag,
+VSC_F(child_exit, uint64_t, 0, 'c', 'i', diag,
"Child process normal exit",
"Number of times the child process has been cleanly stopped"
)
-VSC_F(child_stop, uint64_t, 0, 'c', diag,
+VSC_F(child_stop, uint64_t, 0, 'c', 'i', diag,
"Child process unexpected exit",
"Number of times the child process has exited with an unexpected"
" return code"
)
-VSC_F(child_died, uint64_t, 0, 'c', diag,
+VSC_F(child_died, uint64_t, 0, 'c', 'i', diag,
"Child process died (signal)",
"Number of times the child process has died due to signals"
)
-VSC_F(child_dump, uint64_t, 0, 'c', diag,
+VSC_F(child_dump, uint64_t, 0, 'c', 'i', diag,
"Child process core dumped",
"Number of times the child process has produced core dumps"
)
-VSC_F(child_panic, uint64_t, 0, 'c', diag,
+VSC_F(child_panic, uint64_t, 0, 'c', 'i', diag,
"Child process panic",
"Number of times the management process has caught a child panic"
)
@@ -97,15 +100,15 @@ VSC_F(child_panic, uint64_t, 0, 'c', diag,
#ifdef VSC_DO_LCK
-VSC_F(creat, uint64_t, 0, 'c', debug,
+VSC_F(creat, uint64_t, 0, 'c', 'i', debug,
"Created locks",
""
)
-VSC_F(destroy, uint64_t, 0, 'c', debug,
+VSC_F(destroy, uint64_t, 0, 'c', 'i', debug,
"Destroyed locks",
""
)
-VSC_F(locks, uint64_t, 0, 'c', debug,
+VSC_F(locks, uint64_t, 0, 'c', 'i', debug,
"Lock Operations",
""
)
@@ -117,31 +120,31 @@ VSC_F(locks, uint64_t, 0, 'c', debug,
*/
#if defined(VSC_DO_SMA) || defined (VSC_DO_SMF)
-VSC_F(c_req, uint64_t, 0, 'c', info,
+VSC_F(c_req, uint64_t, 0, 'c', 'i', info,
"Allocator requests",
""
)
-VSC_F(c_fail, uint64_t, 0, 'c', info,
+VSC_F(c_fail, uint64_t, 0, 'c', 'i', info,
"Allocator failures",
""
)
-VSC_F(c_bytes, uint64_t, 0, 'c', info,
+VSC_F(c_bytes, uint64_t, 0, 'c', 'i', info,
"Bytes allocated",
""
)
-VSC_F(c_freed, uint64_t, 0, 'c', info,
+VSC_F(c_freed, uint64_t, 0, 'c', 'i', info,
"Bytes freed",
""
)
-VSC_F(g_alloc, uint64_t, 0, 'g', info,
+VSC_F(g_alloc, uint64_t, 0, 'g', 'i', info,
"Allocations outstanding",
""
)
-VSC_F(g_bytes, uint64_t, 0, 'g', info,
+VSC_F(g_bytes, uint64_t, 0, 'g', 'i', info,
"Bytes outstanding",
""
)
-VSC_F(g_space, uint64_t, 0, 'g', info,
+VSC_F(g_space, uint64_t, 0, 'g', 'i', info,
"Bytes available",
""
)
@@ -157,15 +160,15 @@ VSC_F(g_space, uint64_t, 0, 'g', info,
/**********************************************************************/
#ifdef VSC_DO_SMF
-VSC_F(g_smf, uint64_t, 0, 'g', info,
+VSC_F(g_smf, uint64_t, 0, 'g', 'i', info,
"N struct smf",
""
)
-VSC_F(g_smf_frag, uint64_t, 0, 'g', info,
+VSC_F(g_smf_frag, uint64_t, 0, 'g', 'i', info,
"N small free smf",
""
)
-VSC_F(g_smf_large, uint64_t, 0, 'g', info,
+VSC_F(g_smf_large, uint64_t, 0, 'g', 'i', info,
"N large free smf",
""
)
@@ -175,49 +178,49 @@ VSC_F(g_smf_large, uint64_t, 0, 'g', info,
#ifdef VSC_DO_VBE
-VSC_F(vcls, uint64_t, 0, 'g', debug,
+VSC_F(vcls, uint64_t, 0, 'g', 'i', debug,
"VCL references",
""
)
-VSC_F(happy, uint64_t, 0, 'b', info,
+VSC_F(happy, uint64_t, 0, 'b', 'b', info,
"Happy health probes",
""
)
-VSC_F(bereq_hdrbytes, uint64_t, 0, 'c', info,
+VSC_F(bereq_hdrbytes, uint64_t, 0, 'c', 'i', info,
"Request header bytes",
"Total backend request header bytes sent"
)
-VSC_F(bereq_bodybytes, uint64_t, 0, 'c', info,
+VSC_F(bereq_bodybytes, uint64_t, 0, 'c', 'i', info,
"Request body bytes",
"Total backend request body bytes sent"
)
-VSC_F(beresp_hdrbytes, uint64_t, 0, 'c', info,
+VSC_F(beresp_hdrbytes, uint64_t, 0, 'c', 'i', info,
"Response header bytes",
"Total backend response header bytes received"
)
-VSC_F(beresp_bodybytes, uint64_t, 0, 'c', info,
+VSC_F(beresp_bodybytes, uint64_t, 0, 'c', 'i', info,
"Response body bytes",
"Total backend response body bytes received"
)
-VSC_F(pipe_hdrbytes, uint64_t, 0, 'c', info,
+VSC_F(pipe_hdrbytes, uint64_t, 0, 'c', 'i', info,
"Pipe request header bytes",
"Total request bytes sent for piped sessions"
)
-VSC_F(pipe_out, uint64_t, 0, 'c', info,
+VSC_F(pipe_out, uint64_t, 0, 'c', 'i', info,
"Piped bytes to backend",
"Total number of bytes forwarded to backend in"
" pipe sessions"
)
-VSC_F(pipe_in, uint64_t, 0, 'c', info,
+VSC_F(pipe_in, uint64_t, 0, 'c', 'i', info,
"Piped bytes from backend",
"Total number of bytes forwarded from backend in"
" pipe sessions"
)
-VSC_F(conn, uint64_t, 0, 'g', info,
+VSC_F(conn, uint64_t, 0, 'g', 'i', info,
"Concurrent connections to backend",
""
)
-VSC_F(req, uint64_t, 0, 'c', info,
+VSC_F(req, uint64_t, 0, 'c', 'i', info,
"Backend requests sent",
""
)
@@ -227,47 +230,47 @@ VSC_F(req, uint64_t, 0, 'c', info,
/**********************************************************************/
#ifdef VSC_DO_MEMPOOL
-VSC_F(live, uint64_t, 0, 'g', debug,
+VSC_F(live, uint64_t, 0, 'g', 'i', debug,
"In use",
""
)
-VSC_F(pool, uint64_t, 0, 'g', debug,
+VSC_F(pool, uint64_t, 0, 'g', 'i', debug,
"In Pool",
""
)
-VSC_F(sz_wanted, uint64_t, 0, 'g', debug,
+VSC_F(sz_wanted, uint64_t, 0, 'g', 'i', debug,
"Size requested",
""
)
-VSC_F(sz_needed, uint64_t, 0, 'g', debug,
+VSC_F(sz_needed, uint64_t, 0, 'g', 'i', debug,
"Size allocated",
""
)
-VSC_F(allocs, uint64_t, 0, 'c', debug,
+VSC_F(allocs, uint64_t, 0, 'c', 'i', debug,
"Allocations",
""
)
-VSC_F(frees, uint64_t, 0, 'c', debug,
+VSC_F(frees, uint64_t, 0, 'c', 'i', debug,
"Frees",
""
)
-VSC_F(recycle, uint64_t, 0, 'c', debug,
+VSC_F(recycle, uint64_t, 0, 'c', 'i', debug,
"Recycled from pool",
""
)
-VSC_F(timeout, uint64_t, 0, 'c', debug,
+VSC_F(timeout, uint64_t, 0, 'c', 'i', debug,
"Timed out from pool",
""
)
-VSC_F(toosmall, uint64_t, 0, 'c', debug,
+VSC_F(toosmall, uint64_t, 0, 'c', 'i', debug,
"Too small to recycle",
""
)
-VSC_F(surplus, uint64_t, 0, 'c', debug,
+VSC_F(surplus, uint64_t, 0, 'c', 'i', debug,
"Too many for pool",
""
)
-VSC_F(randry, uint64_t, 0, 'c', debug,
+VSC_F(randry, uint64_t, 0, 'c', 'i', debug,
"Pool ran dry",
""
)
diff --git a/include/vapi/vsc.h b/include/vapi/vsc.h
index 4a7782d..e653579 100644
--- a/include/vapi/vsc.h
+++ b/include/vapi/vsc.h
@@ -190,7 +190,7 @@ const struct VSC_level_desc *VSC_LevelDesc(unsigned level);
#undef VSC_TYPE_F
#define VSC_DO(U,l,t) extern const struct VSC_desc VSC_desc_##l[];
-#define VSC_F(n,t,l,s,v,d,e)
+#define VSC_F(n,t,l,s,f,v,d,e)
#define VSC_DONE(U,l,t)
#include "tbl/vsc_all.h"
#undef VSC_DO
diff --git a/include/vapi/vsc_int.h b/include/vapi/vsc_int.h
index 4a7d4a8..376a755 100644
--- a/include/vapi/vsc_int.h
+++ b/include/vapi/vsc_int.h
@@ -46,7 +46,7 @@ enum VSC_level_e {
/* Define the vsc type structs */
#define VSC_DO(u,l,t) struct VSC_C_##l {
-#define VSC_F(n,t,l,s,v,d,e) t n;
+#define VSC_F(n,t,l,s,f,v,d,e) t n;
#define VSC_DONE(u,l,t) };
#include "tbl/vsc_all.h"
#undef VSC_DO
diff --git a/lib/libvarnishapi/vsc.c b/lib/libvarnishapi/vsc.c
index fe8c449..69c39e6 100644
--- a/lib/libvarnishapi/vsc.c
+++ b/lib/libvarnishapi/vsc.c
@@ -387,7 +387,7 @@ vsc_add_pt(struct vsc *vsc, const volatile void *ptr,
CHECK_OBJ_NOTNULL(vsc, VSC_MAGIC); \
st = vf->fantom.b;
-#define VSC_F(nn,tt,ll,ss,vv,dd,ee) \
+#define VSC_F(nn,tt,ll,ss,ff,vv,dd,ee) \
vsc_add_pt(vsc, &st->nn, descs++, vf);
#define VSC_DONE(U,l,t) \
@@ -437,7 +437,7 @@ vsc_build_pt_list(struct VSM_data *vd)
CHECK_OBJ_NOTNULL(vf, VSC_VF_MAGIC); \
if (!strcmp(vf->fantom.type, t)) \
iter_##l(vsc, VSC_desc_##l, vf);
-#define VSC_F(n,t,l,s,v,d,e)
+#define VSC_F(n,t,l,s,f,v,d,e)
#define VSC_DONE(a,b,c)
#include "tbl/vsc_all.h"
#undef VSC_DO
@@ -565,7 +565,7 @@ VSC_LevelDesc(unsigned level)
#undef VSC_TYPE_F
#define VSC_DO(U,l,t) const struct VSC_desc VSC_desc_##l[] = {
-#define VSC_F(n,t,l,s,v,d,e) {#n,#t,s,d,e,&VSC_level_desc_##v},
+#define VSC_F(n,t,l,s,f,v,d,e) {#n,#t,s,d,e,&VSC_level_desc_##v},
#define VSC_DONE(U,l,t) };
#include "tbl/vsc_all.h"
#undef VSC_DO
diff --git a/man/vsc2rst.c b/man/vsc2rst.c
index 6c00971..4e62917 100644
--- a/man/vsc2rst.c
+++ b/man/vsc2rst.c
@@ -40,7 +40,7 @@
printf(x "\n", ##__VA_ARGS__)
#define VSC_LEVEL_F(v,l,e,d) \
printf("%s – %s\n\t%s\n\n", l, e, d);
-#define VSC_F(n, t, l, s, v, d, e) \
+#define VSC_F(n, t, l, s, f, v, d, e) \
printf("%s – %s (%s)\n\t%s\n\n", #n, e, VSC_level_##v, d);
int main(int argc, char **argv)
More information about the varnish-commit
mailing list