* shm_flushes SHM flushes due to overflow Y
* shm_cont SHM MTX contention Y
* shm_cycles SHM cycles through buffer Y
- * sm_nreq allocator requests N
- * sm_nobj outstanding allocations N
- * sm_balloc bytes allocated N
- * sm_bfree bytes free N
+ * sm_nreq allocator requests Y
+ * sm_nobj outstanding allocations Y
+ * sm_balloc bytes allocated Y
+ * sm_bfree bytes free Y
* sma_nreq SMA allocator requests Y
* sma_nobj SMA outstanding allocations Y
* sma_nbytes SMA outstanding bytes Y
#include <varnish/varnishapi.h>
-#define USER_CONFIG_INIT {0, 0, 0, 0, 0, 0, 0, 0, 0}
+#define USER_CONFIG_INIT {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
#define SET_MONITOR_FLAG(name, flag, value) if((strcasecmp(name, key) == 0) && IS_TRUE(value)) user_config.flag = 1
/* {{{ user_config_s */
int monitor_shm;
int monitor_sma;
int monitor_sms;
+ int monitor_sm;
};
typedef struct user_config_s user_config_t; /* }}} */
"MonitorHCB",
"MonitorSHM",
"MonitorSMA",
- "MonitorSMS"
+ "MonitorSMS",
+ "MonitorSM"
};
static int config_keys_num = STATIC_ARRAY_SIZE (config_keys); /* }}} */
SET_MONITOR_FLAG("MonitorSHM" , monitor_shm , value);
SET_MONITOR_FLAG("MonitorSMA" , monitor_sma , value);
SET_MONITOR_FLAG("MonitorSMS" , monitor_sms , value);
+ SET_MONITOR_FLAG("MonitorSM" , monitor_sm , value);
return (0);
} /* }}} */
varnish_submit("varnish_sms", "sms_balloc", VSL_stats->sms_balloc); /* SMS bytes allocated */
varnish_submit("varnish_sms", "sms_bfree" , VSL_stats->sms_bfree); /* SMS bytes freed */
}
+
+ if(user_config.monitor_sm == 1)
+ {
+ varnish_submit("varnish_sm", "sm_nreq" , VSL_stats->sm_nreq); /* allocator requests */
+ varnish_submit("varnish_sm", "sm_nobj" , VSL_stats->sm_nobj); /* outstanding allocations */
+ varnish_submit("varnish_sm", "sm_balloc", VSL_stats->sm_balloc); /* bytes allocated */
+ varnish_submit("varnish_sm", "sm_bfree" , VSL_stats->sm_bfree); /* bytes free */
+ }
} /* }}} */
static int varnish_read(void) /* {{{ */