Skip to content
Browse files

Added all the varnish metrics from varnishstat

  • Loading branch information...
1 parent 42b0c90 commit d6ce24f2df5414802e575844089ff7fcc9566db2 vuksan committed Sep 12, 2011
Showing with 726 additions and 76 deletions.
  1. +20 −1 varnish/conf.d/{varnish.conf → varnish.pyconf}
  2. +706 −75 varnish/python_modules/varnish.py
View
21 varnish/conf.d/varnish.conf → varnish/conf.d/varnish.pyconf
@@ -10,16 +10,32 @@ modules {
collection_group {
collect_every = 30
- time_threshold = 90
+ time_threshold = 60
+
+# If you want all of metrics kept track by varnishstat ie. all 100 of them
+# you can simply uncomment line below and comment out all the other ones
+# metric {
+# name_match = "varnish_(.+)"
+# }
+
metric {
name = "varnish_client_req"
title = "Client Requests"
}
+
metric {
name = "varnish_backend_req"
title = "Backend Requests"
}
metric {
+ name = "varnish_backend_unhealthy"
+ title = "Backend conn. not attempted"
+ }
+ metric {
+ name = "varnish_backend_busy"
+ title = "Backend conn. too many"
+ }
+ metric {
name = "varnish_cache_hit_ratio"
title = "Cache Hit Ratio"
}
@@ -35,4 +51,7 @@ collection_group {
name = "varnish_n_wrk"
title = "Worker Threads"
}
+
+
+
}
View
781 varnish/python_modules/varnish.py
@@ -31,14 +31,20 @@
NAME_PREFIX = 'varnish_'
PARAMS = {
- 'stats_command' : 'ssh varnish01.example.com varnishstat -1'
+ 'stats_command' : 'varnishstat -1'
}
METRICS = {
'time' : 0,
'data' : {}
}
LAST_METRICS = dict(METRICS)
-METRICS_CACHE_MAX = 1
+METRICS_CACHE_MAX = 5
+
+def create_desc(skel, prop):
+ d = skel.copy()
+ for k,v in prop.iteritems():
+ d[k] = v
+ return d
def get_metrics():
@@ -66,7 +72,6 @@ def get_metrics():
return [METRICS, LAST_METRICS]
-
def get_value(name):
"""Return a value for the requested metric"""
@@ -90,8 +95,9 @@ def get_delta(name):
# get delta
name = name[len(NAME_PREFIX):] # remove prefix from name
try:
- delta = (curr_metrics['data'][name] - last_metrics['data'][name])/(curr_metrics['time'] - last_metrics['time'])
+ delta = float(curr_metrics['data'][name] - last_metrics['data'][name])/(curr_metrics['time'] - last_metrics['time'])
if delta < 0:
+ print "Less than 0"
delta = 0
except StandardError:
delta = 0
@@ -113,83 +119,708 @@ def get_cache_hit_ratio(name):
def metric_init(lparams):
"""Initialize metric descriptors"""
- global PARAMS
+ global PARAMS, Desc_Skel
# set parameters
for key in lparams:
PARAMS[key] = lparams[key]
# define descriptors
time_max = 60
- groups = 'varnish'
- descriptors = [
- {
- 'name': NAME_PREFIX + 'client_req',
- 'call_back': get_delta,
- 'time_max': time_max,
- 'value_type': 'float',
- 'units': 'Ops/Sec',
- 'slope': 'both',
- 'format': '%f',
- 'description': 'Client Requests',
- 'groups': groups
- },
- {
- 'name': NAME_PREFIX + 'backend_req',
- 'call_back': get_delta,
- 'time_max': time_max,
- 'value_type': 'float',
- 'units': 'Ops/Sec',
- 'slope': 'both',
- 'format': '%f',
- 'description': 'Backend Requests',
- 'groups': groups
- },
- {
- 'name': NAME_PREFIX + 'cache_hit_ratio',
- 'call_back': get_cache_hit_ratio,
- 'time_max': time_max,
- 'value_type': 'float',
- 'units': '%',
- 'slope': 'both',
- 'format': '%f',
- 'description': 'Cache Hit Ratio',
- 'groups': groups
- },
- {
- 'name': NAME_PREFIX + 'n_object',
- 'call_back': get_value,
- 'time_max': time_max,
- 'value_type': 'uint',
- 'units': 'Objects',
- 'slope': 'both',
- 'format': '%u',
- 'description': 'Objects in Cache',
- 'groups': groups
- },
- {
- 'name': NAME_PREFIX + 'sm_balloc',
- 'call_back': get_value,
- 'time_max': time_max,
- 'value_type': 'uint',
- 'units': 'Bytes',
- 'slope': 'both',
- 'format': '%u',
- 'description': 'Allocated Storage',
- 'groups': groups
- },
- {
- 'name': NAME_PREFIX + 'n_wrk',
- 'call_back': get_value,
- 'time_max': time_max,
- 'value_type': 'uint',
- 'units': 'Threads',
- 'slope': 'both',
- 'format': '%u',
- 'description': 'Worker Threads',
- 'groups': groups
+
+ Desc_Skel = {
+ 'name' : 'XXX',
+ 'call_back' : 'XXX',
+ 'time_max' : 60,
+ 'value_type' : 'float',
+ 'format' : '%f',
+ 'units' : 'XXX',
+ 'slope' : 'both', # zero|positive|negative|both
+ 'description' : 'XXX',
+ 'groups' : 'varnish',
}
- ]
+
+ descriptors = []
+
+ descriptors.append( create_desc(Desc_Skel, {
+ "name" : NAME_PREFIX + 'cache_hit_ratio',
+ "call_back" : get_cache_hit_ratio,
+ "units" : "pct",
+ "description": "Cache Hit ratio",
+ }))
+
+ descriptors.append( create_desc(Desc_Skel, {
+ "name" : NAME_PREFIX + 'client_conn',
+ "call_back" : get_delta,
+ "units" : "conn/s",
+ "description": "Client connections accepted",
+ }))
+
+ descriptors.append( create_desc(Desc_Skel, {
+ "name" : NAME_PREFIX + 'client_drop',
+ "call_back" : get_delta,
+ "units" : "conn/s",
+ "description": "Connection dropped, no sess/wrk",
+ }))
+
+ descriptors.append( create_desc(Desc_Skel, {
+ "name" : NAME_PREFIX + 'client_req',
+ "call_back" : get_delta,
+ "units" : "req/s",
+ "description": "Client requests received",
+ }))
+
+ descriptors.append( create_desc(Desc_Skel, {
+ "name" : NAME_PREFIX + 'cache_hit',
+ "call_back" : get_delta,
+ "units" : "hit/s",
+ "description": "Cache hits",
+ }))
+
+ descriptors.append( create_desc(Desc_Skel, {
+ "name" : NAME_PREFIX + 'cache_hitpass',
+ "call_back" : get_delta,
+ "units" : "hit/s",
+ "description": "Cache hits for pass",
+ }))
+
+ descriptors.append( create_desc(Desc_Skel, {
+ "name" : NAME_PREFIX + 'cache_miss',
+ "units" : "miss/s",
+ "call_back" : get_delta,
+ "description": "Cache misses",
+ }))
+
+ descriptors.append( create_desc(Desc_Skel, {
+ "name" : NAME_PREFIX + 'backend_conn',
+ "call_back" : get_delta,
+ "units" : "conn/s",
+ "description": "Backend conn. success",
+ }))
+
+ descriptors.append( create_desc(Desc_Skel, {
+ "name" : NAME_PREFIX + 'backend_unhealthy',
+ "call_back" : get_delta,
+ "units" : "conn/s",
+ "description": "Backend conn. not attempted",
+ }))
+
+ descriptors.append( create_desc(Desc_Skel, {
+ "name" : NAME_PREFIX + 'backend_busy',
+ "call_back" : get_delta,
+ "units" : "busy/s",
+ "description": "Backend conn. too many",
+ }))
+
+ descriptors.append( create_desc(Desc_Skel, {
+ "name" : NAME_PREFIX + 'backend_fail',
+ "call_back" : get_delta,
+ "units" : "fail/s",
+ "description": "Backend conn. failures",
+ }))
+
+ descriptors.append( create_desc(Desc_Skel, {
+ "name" : NAME_PREFIX + 'backend_reuse',
+ "call_back" : get_delta,
+ "units" : "/s",
+ "description": "Backend conn. reuses",
+ }))
+
+ descriptors.append( create_desc(Desc_Skel, {
+ "name" : NAME_PREFIX + 'backend_toolate',
+ "call_back" : get_delta,
+ "units" : "/s",
+ "description": "Backend conn. was closed",
+ }))
+
+ descriptors.append( create_desc(Desc_Skel, {
+ "name" : NAME_PREFIX + 'backend_recycle',
+ "call_back" : get_delta,
+ "units" : "/s",
+ "description": "Backend conn. recycles",
+ }))
+
+ descriptors.append( create_desc(Desc_Skel, {
+ "name" : NAME_PREFIX + 'backend_unused',
+ "call_back" : get_delta,
+ "units" : "/s",
+ "description": "Backend conn. unused",
+ }))
+
+ descriptors.append( create_desc(Desc_Skel, {
+ "name" : NAME_PREFIX + 'fetch_head',
+ "call_back" : get_delta,
+ "units" : "/s",
+ "description": "Fetch head",
+ }))
+
+ descriptors.append( create_desc(Desc_Skel, {
+ "name" : NAME_PREFIX + 'fetch_length',
+ "call_back" : get_delta,
+ "units" : "/s",
+ "description": "Fetch with Length",
+ }))
+
+ descriptors.append( create_desc(Desc_Skel, {
+ "name" : NAME_PREFIX + 'fetch_chunked',
+ "call_back" : get_delta,
+ "units" : "/s",
+ "description": "Fetch chunked",
+ }))
+
+ descriptors.append( create_desc(Desc_Skel, {
+ "name" : NAME_PREFIX + 'fetch_eof',
+ "call_back" : get_delta,
+ "units" : "/s",
+ "description": "Fetch EOF",
+ }))
+
+ descriptors.append( create_desc(Desc_Skel, {
+ "name" : NAME_PREFIX + 'fetch_bad',
+ "call_back" : get_delta,
+ "units" : "/s",
+ "description": "Fetch had bad headers",
+ }))
+
+ descriptors.append( create_desc(Desc_Skel, {
+ "name" : NAME_PREFIX + 'fetch_close',
+ "call_back" : get_delta,
+ "units" : "/s",
+ "description": "Fetch wanted close",
+ }))
+
+ descriptors.append( create_desc(Desc_Skel, {
+ "name" : NAME_PREFIX + 'fetch_oldhttp',
+ "call_back" : get_delta,
+ "units" : "/s",
+ "description": "Fetch pre HTTP/1.1 closed",
+ }))
+
+ descriptors.append( create_desc(Desc_Skel, {
+ "name" : NAME_PREFIX + 'fetch_zero',
+ "call_back" : get_delta,
+ "units" : "/s",
+ "description": "Fetch zero len",
+ }))
+
+ descriptors.append( create_desc(Desc_Skel, {
+ "name" : NAME_PREFIX + 'fetch_failed',
+ "call_back" : get_delta,
+ "units" : "/s",
+ "description": "Fetch failed",
+ }))
+
+ descriptors.append( create_desc(Desc_Skel, {
+ "name" : NAME_PREFIX + 'n_sess_mem',
+ "call_back" : get_value,
+ "units" : "Bytes",
+ "description": "N struct sess_mem",
+ }))
+
+ descriptors.append( create_desc(Desc_Skel, {
+ "name" : NAME_PREFIX + 'n_sess',
+ "call_back" : get_value,
+ "units" : "sessions",
+ "description": "N struct sess",
+ }))
+
+ descriptors.append( create_desc(Desc_Skel, {
+ "name" : NAME_PREFIX + 'n_object',
+ "call_back" : get_value,
+ "units" : "objects",
+ "description": "N struct object",
+ }))
+
+ descriptors.append( create_desc(Desc_Skel, {
+ "name" : NAME_PREFIX + 'n_vampireobject',
+ "call_back" : get_value,
+ "units" : "objects",
+ "description": "N unresurrected objects",
+ }))
+
+ descriptors.append( create_desc(Desc_Skel, {
+ "name" : NAME_PREFIX + 'n_objectcore',
+ "call_back" : get_value,
+ "units" : "objects",
+ "description": "N struct objectcore",
+ }))
+
+ descriptors.append( create_desc(Desc_Skel, {
+ "name" : NAME_PREFIX + 'n_objecthead',
+ "call_back" : get_value,
+ "units" : "objects",
+ "description": "N struct objecthead",
+ }))
+
+ descriptors.append( create_desc(Desc_Skel, {
+ "name" : NAME_PREFIX + 'n_smf',
+ "call_back" : get_value,
+ "units" : "",
+ "description": "N struct smf",
+ }))
+
+ descriptors.append( create_desc(Desc_Skel, {
+ "name" : NAME_PREFIX + 'n_smf_frag',
+ "call_back" : get_value,
+ "units" : "frags",
+ "description": "N small free smf",
+ }))
+
+ descriptors.append( create_desc(Desc_Skel, {
+ "name" : NAME_PREFIX + 'n_smf_large',
+ "call_back" : get_value,
+ "units" : "frags",
+ "description": "N large free smf",
+ }))
+
+ descriptors.append( create_desc(Desc_Skel, {
+ "name" : NAME_PREFIX + 'n_vbe_conn',
+ "call_back" : get_value,
+ "units" : "conn",
+ "description": "N struct vbe_conn",
+ }))
+
+ descriptors.append( create_desc(Desc_Skel, {
+ "name" : NAME_PREFIX + 'n_wrk',
+ "call_back" : get_value,
+ "units" : "threads",
+ "description": "N worker threads",
+ }))
+
+ descriptors.append( create_desc(Desc_Skel, {
+ "name" : NAME_PREFIX + 'n_wrk_create',
+ "call_back" : get_delta,
+ "units" : "threads/s",
+ "description": "N worker threads created",
+ }))
+
+ descriptors.append( create_desc(Desc_Skel, {
+ "name" : NAME_PREFIX + 'n_wrk_failed',
+ "call_back" : get_delta,
+ "units" : "wrk/s",
+ "description": "N worker threads not created",
+ }))
+
+ descriptors.append( create_desc(Desc_Skel, {
+ "name" : NAME_PREFIX + 'n_wrk_max',
+ "call_back" : get_delta,
+ "units" : "threads/s",
+ "description": "N worker threads limited",
+ }))
+
+ descriptors.append( create_desc(Desc_Skel, {
+ "name" : NAME_PREFIX + 'n_wrk_queue',
+ "call_back" : get_value,
+ "units" : "req",
+ "description": "N queued work requests",
+ }))
+
+ descriptors.append( create_desc(Desc_Skel, {
+ "name" : NAME_PREFIX + 'n_wrk_overflow',
+ "call_back" : get_delta,
+ "units" : "req/s",
+ "description": "N overflowed work requests",
+ }))
+
+ descriptors.append( create_desc(Desc_Skel, {
+ "name" : NAME_PREFIX + 'n_wrk_drop',
+ "call_back" : get_delta,
+ "units" : "req/s",
+ "description": "N dropped work requests",
+ }))
+
+ descriptors.append( create_desc(Desc_Skel, {
+ "name" : NAME_PREFIX + 'n_backend',
+ "call_back" : get_value,
+ "units" : "backends",
+ "description": "N backends",
+ }))
+
+ descriptors.append( create_desc(Desc_Skel, {
+ "name" : NAME_PREFIX + 'n_expired',
+ "call_back" : get_delta,
+ "units" : "obj/s",
+ "description": "N expired objects",
+ }))
+
+ descriptors.append( create_desc(Desc_Skel, {
+ "name" : NAME_PREFIX + 'n_lru_nuked',
+ "call_back" : get_delta,
+ "units" : "obj/s",
+ "description": "N LRU nuked objects",
+ }))
+
+ descriptors.append( create_desc(Desc_Skel, {
+ "name" : NAME_PREFIX + 'n_lru_saved',
+ "call_back" : get_delta,
+ "units" : "obj/s",
+ "description": "N LRU saved objects",
+ }))
+
+ descriptors.append( create_desc(Desc_Skel, {
+ "name" : NAME_PREFIX + 'n_lru_moved',
+ "call_back" : get_delta,
+ "units" : "obj/s",
+ "description": "N LRU moved objects",
+ }))
+
+ descriptors.append( create_desc(Desc_Skel, {
+ "name" : NAME_PREFIX + 'n_deathrow',
+ "call_back" : get_delta,
+ "units" : "obj/s",
+ "description": "N objects on deathrow",
+ }))
+
+ descriptors.append( create_desc(Desc_Skel, {
+ "name" : NAME_PREFIX + 'losthdr',
+ "call_back" : get_delta,
+ "units" : "hdrs/s",
+ "description": "HTTP header overflows",
+ }))
+
+ descriptors.append( create_desc(Desc_Skel, {
+ "name" : NAME_PREFIX + 'n_objsendfile',
+ "call_back" : get_delta,
+ "units" : "obj/s",
+ "description": "Objects sent with sendfile",
+ }))
+
+ descriptors.append( create_desc(Desc_Skel, {
+ "name" : NAME_PREFIX + 'n_objwrite',
+ "call_back" : get_delta,
+ "units" : "obj/s",
+ "description": "Objects sent with write",
+ }))
+
+ descriptors.append( create_desc(Desc_Skel, {
+ "name" : NAME_PREFIX + 'n_objoverflow',
+ "call_back" : get_delta,
+ "description": "Objects overflowing workspace",
+ }))
+
+ descriptors.append( create_desc(Desc_Skel, {
+ "name" : NAME_PREFIX + 's_sess',
+ "call_back" : get_delta,
+ "description": "Total Sessions",
+ }))
+
+ descriptors.append( create_desc(Desc_Skel, {
+ "name" : NAME_PREFIX + 's_req',
+ "call_back" : get_delta,
+ "description": "Total Requests",
+ }))
+
+ descriptors.append( create_desc(Desc_Skel, {
+ "name" : NAME_PREFIX + 's_pipe',
+ "call_back" : get_delta,
+ "description": "Total pipe",
+ }))
+
+ descriptors.append( create_desc(Desc_Skel, {
+ "name" : NAME_PREFIX + 's_pass',
+ "call_back" : get_delta,
+ "description": "Total pass",
+ }))
+
+ descriptors.append( create_desc(Desc_Skel, {
+ "name" : NAME_PREFIX + 's_fetch',
+ "call_back" : get_delta,
+ "description": "Total fetch",
+ }))
+
+ descriptors.append( create_desc(Desc_Skel, {
+ "name" : NAME_PREFIX + 's_hdrbytes',
+ "call_back" : get_delta,
+ "description": "Total header bytes",
+ }))
+
+ descriptors.append( create_desc(Desc_Skel, {
+ "name" : NAME_PREFIX + 's_bodybytes',
+ "call_back" : get_delta,
+ "units" : "bytes/s",
+ "description": "Total body bytes",
+ }))
+
+ descriptors.append( create_desc(Desc_Skel, {
+ "name" : NAME_PREFIX + 'sess_closed',
+ "call_back" : get_delta,
+ "units" : "sessions/s",
+ "description": "Session Closed",
+ }))
+
+ descriptors.append( create_desc(Desc_Skel, {
+ "name" : NAME_PREFIX + 'sess_pipeline',
+ "call_back" : get_delta,
+ "description": "Session Pipeline",
+ }))
+
+ descriptors.append( create_desc(Desc_Skel, {
+ "name" : NAME_PREFIX + 'sess_readahead',
+ "call_back" : get_delta,
+ "description": "Session Read Ahead",
+ }))
+
+ descriptors.append( create_desc(Desc_Skel, {
+ "name" : NAME_PREFIX + 'sess_linger',
+ "call_back" : get_delta,
+ "description": "Session Linger",
+ }))
+
+ descriptors.append( create_desc(Desc_Skel, {
+ "name" : NAME_PREFIX + 'sess_herd',
+ "call_back" : get_delta,
+ "description": "Session herd",
+ }))
+
+ descriptors.append( create_desc(Desc_Skel, {
+ "name" : NAME_PREFIX + 'shm_records',
+ "call_back" : get_delta,
+ "description": "SHM records",
+ }))
+
+ descriptors.append( create_desc(Desc_Skel, {
+ "name" : NAME_PREFIX + 'shm_writes',
+ "call_back" : get_delta,
+ "description": "SHM writes",
+ }))
+
+ descriptors.append( create_desc(Desc_Skel, {
+ "name" : NAME_PREFIX + 'shm_flushes',
+ "call_back" : get_delta,
+ "description": "SHM flushes due to overflow",
+ }))
+
+ descriptors.append( create_desc(Desc_Skel, {
+ "name" : NAME_PREFIX + 'shm_cont',
+ "call_back" : get_delta,
+ "description": "SHM MTX contention",
+ }))
+
+ descriptors.append( create_desc(Desc_Skel, {
+ "name" : NAME_PREFIX + 'shm_cycles',
+ "call_back" : get_delta,
+ "description": "SHM cycles through buffer",
+ }))
+
+ descriptors.append( create_desc(Desc_Skel, {
+ "name" : NAME_PREFIX + 'sm_nreq',
+ "call_back" : get_delta,
+ "description": "allocator requests",
+ }))
+
+ descriptors.append( create_desc(Desc_Skel, {
+ "name" : NAME_PREFIX + 'sm_nobj',
+ "call_back" : get_delta,
+ "description": "outstanding allocations",
+ }))
+
+ descriptors.append( create_desc(Desc_Skel, {
+ "name" : NAME_PREFIX + 'sm_balloc',
+ "call_back" : get_value,
+ "description": "bytes allocated",
+ }))
+
+ descriptors.append( create_desc(Desc_Skel, {
+ "name" : NAME_PREFIX + 'sm_bfree',
+ "call_back" : get_delta,
+ "description": "bytes free",
+ }))
+
+ descriptors.append( create_desc(Desc_Skel, {
+ "name" : NAME_PREFIX + 'sma_nreq',
+ "call_back" : get_delta,
+ "description": "SMA allocator requests",
+ }))
+
+ descriptors.append( create_desc(Desc_Skel, {
+ "name" : NAME_PREFIX + 'sma_nobj',
+ "call_back" : get_value,
+ "units" : "obj",
+ "description": "SMA outstanding allocations",
+ }))
+
+ descriptors.append( create_desc(Desc_Skel, {
+ "name" : NAME_PREFIX + 'sma_nbytes',
+ "call_back" : get_value,
+ "units" : "Bytes",
+ "description": "SMA outstanding bytes",
+ }))
+
+ descriptors.append( create_desc(Desc_Skel, {
+ "name" : NAME_PREFIX + 'sma_balloc',
+ "call_back" : get_delta,
+ "units" : "bytes/s",
+ "description": "SMA bytes allocated",
+ }))
+
+ descriptors.append( create_desc(Desc_Skel, {
+ "name" : NAME_PREFIX + 'sma_bfree',
+ "call_back" : get_delta,
+ "units" : "bytes/s",
+ "description": "SMA bytes free",
+ }))
+
+ descriptors.append( create_desc(Desc_Skel, {
+ "name" : NAME_PREFIX + 'sms_nreq',
+ "call_back" : get_delta,
+ "units" : "req/s",
+ "description": "SMS allocator requests",
+ }))
+
+ descriptors.append( create_desc(Desc_Skel, {
+ "name" : NAME_PREFIX + 'sms_nobj',
+ "call_back" : get_value,
+ "units" : "obj",
+ "description": "SMS outstanding allocations",
+ }))
+
+ descriptors.append( create_desc(Desc_Skel, {
+ "name" : NAME_PREFIX + 'sms_nbytes',
+ "call_back" : get_value,
+ "units" : "Bytes",
+ "description": "SMS outstanding bytes",
+ }))
+
+ descriptors.append( create_desc(Desc_Skel, {
+ "name" : NAME_PREFIX + 'sms_balloc',
+ "call_back" : get_delta,
+ "units" : "bytes/s",
+ "description": "SMS bytes allocated",
+ }))
+
+ descriptors.append( create_desc(Desc_Skel, {
+ "name" : NAME_PREFIX + 'sms_bfree',
+ "call_back" : get_delta,
+ "units" : "Bytes/s",
+ "description": "SMS bytes freed",
+ }))
+
+ descriptors.append( create_desc(Desc_Skel, {
+ "name" : NAME_PREFIX + 'backend_req',
+ "call_back" : get_delta,
+ "units" : "req/s",
+ "description": "Backend requests made",
+ }))
+
+ descriptors.append( create_desc(Desc_Skel, {
+ "name" : NAME_PREFIX + 'n_vcl',
+ "call_back" : get_value,
+ "units" : "vcl",
+ "description": "N vcl total",
+ }))
+
+ descriptors.append( create_desc(Desc_Skel, {
+ "name" : NAME_PREFIX + 'n_vcl_avail',
+ "call_back" : get_value,
+ "units" : "vcl",
+ "description": "N vcl available",
+ }))
+
+ descriptors.append( create_desc(Desc_Skel, {
+ "name" : NAME_PREFIX + 'n_vcl_discard',
+ "call_back" : get_value,
+ "units" : "vcl",
+ "description": "N vcl discarded",
+ }))
+
+ descriptors.append( create_desc(Desc_Skel, {
+ "name" : NAME_PREFIX + 'n_purge',
+ "call_back" : get_value,
+ "units" : "purges",
+ "description": "N total active purges",
+ }))
+
+ descriptors.append( create_desc(Desc_Skel, {
+ "name" : NAME_PREFIX + 'n_purge_add',
+ "call_back" : get_delta,
+ "units" : "purges/sec",
+ "description": "N new purges added",
+ }))
+
+ descriptors.append( create_desc(Desc_Skel, {
+ "name" : NAME_PREFIX + 'n_purge_retire',
+ "call_back" : get_delta,
+ "units" : "purges/s",
+ "description": "N old purges deleted",
+ }))
+
+ descriptors.append( create_desc(Desc_Skel, {
+ "name" : NAME_PREFIX + 'n_purge_obj_test',
+ "call_back" : get_delta,
+ "units" : "purges/s",
+ "description": "N objects tested",
+ }))
+
+ descriptors.append( create_desc(Desc_Skel, {
+ "name" : NAME_PREFIX + 'n_purge_re_test',
+ "call_back" : get_delta,
+ "description": "N regexps tested against",
+ "units" : "purges/s",
+ }))
+
+ descriptors.append( create_desc(Desc_Skel, {
+ "name" : NAME_PREFIX + 'n_purge_dups',
+ "call_back" : get_delta,
+ "units" : "purges/s",
+ "description": "N duplicate purges removed",
+ }))
+
+ descriptors.append( create_desc(Desc_Skel, {
+ "name" : NAME_PREFIX + 'hcb_nolock',
+ "call_back" : get_delta,
+ "units" : "locks/s",
+ "description": "HCB Lookups without lock",
+ }))
+
+ descriptors.append( create_desc(Desc_Skel, {
+ "name" : NAME_PREFIX + 'hcb_lock',
+ "call_back" : get_delta,
+ "units" : "locks/s",
+ "description": "HCB Lookups with lock",
+ }))
+
+ descriptors.append( create_desc(Desc_Skel, {
+ "name" : NAME_PREFIX + 'hcb_insert',
+ "call_back" : get_delta,
+ "units" : "inserts/s",
+ "description": "HCB Inserts",
+ }))
+
+ descriptors.append( create_desc(Desc_Skel, {
+ "name" : NAME_PREFIX + 'esi_parse',
+ "call_back" : get_delta,
+ "units" : "obj/s",
+ "description": "Objects ESI parsed (unlock)",
+ }))
+
+ descriptors.append( create_desc(Desc_Skel, {
+ "name" : NAME_PREFIX + 'esi_errors',
+ "call_back" : get_delta,
+ "units" : "err/s",
+ "description": "ESI parse errors (unlock)",
+ }))
+
+ descriptors.append( create_desc(Desc_Skel, {
+ "name" : NAME_PREFIX + 'accept_fail',
+ "call_back" : get_delta,
+ "units" : "accepts/s",
+ "description": "Accept failures",
+ }))
+
+ descriptors.append( create_desc(Desc_Skel, {
+ "name" : NAME_PREFIX + 'client_drop_late',
+ "call_back" : get_delta,
+ "units" : "conn/s",
+ "description": "Connection dropped late",
+ }))
+
+ descriptors.append( create_desc(Desc_Skel, {
+ "name" : NAME_PREFIX + 'uptime',
+ "call_back" : get_value,
+ "units" : "seconds",
+ "description": "Client uptime",
+ }))
+
return descriptors
@@ -206,5 +837,5 @@ def metric_cleanup():
while True:
for d in descriptors:
print (('%s = %s') % (d['name'], d['format'])) % (d['call_back'](d['name']))
- print ''
- time.sleep(1)
+ print 'Sleeping 15 seconds'
+ time.sleep(15)

0 comments on commit d6ce24f

Please sign in to comment.
Something went wrong with that request. Please try again.