+ varnish_submit_derive (conf->instance, "sms", "total_bytes", "free", stats->sms_bfree);
+ }
+
+ if (conf->collect_struct)
+ {
+ /* N struct sess_mem */
+ varnish_submit_gauge (conf->instance, "struct", "current_sessions", "sess_mem", stats->n_sess_mem);
+ /* N struct sess */
+ varnish_submit_gauge (conf->instance, "struct", "current_sessions", "sess", stats->n_sess);
+ /* N struct object */
+ varnish_submit_gauge (conf->instance, "struct", "objects", "object", stats->n_object);
+#ifdef HAVE_VARNISH_V3
+ /* N unresurrected objects */
+ varnish_submit_gauge (conf->instance, "struct", "objects", "vampireobject", stats->n_vampireobject);
+ /* N struct objectcore */
+ varnish_submit_gauge (conf->instance, "struct", "objects", "objectcore", stats->n_objectcore);
+#endif
+ /* N struct objecthead */
+ varnish_submit_gauge (conf->instance, "struct", "objects", "objecthead", stats->n_objecthead);
+#ifdef HAVE_VARNISH_V2
+ /* N struct smf */
+ varnish_submit_gauge (conf->instance, "struct", "objects", "smf", stats->n_smf);
+ /* N small free smf */
+ varnish_submit_gauge (conf->instance, "struct", "objects", "smf_frag", stats->n_smf_frag);
+ /* N large free smf */
+ varnish_submit_gauge (conf->instance, "struct", "objects", "smf_large", stats->n_smf_large);
+ /* N struct vbe_conn */
+ varnish_submit_gauge (conf->instance, "struct", "objects", "vbe_conn", stats->n_vbe_conn);
+#endif
+ }
+
+ if (conf->collect_totals)
+ {
+ /* Total Sessions */
+ varnish_submit_derive (conf->instance, "totals", "total_sessions", "sessions", stats->s_sess);
+ /* Total Requests */
+ varnish_submit_derive (conf->instance, "totals", "total_requests", "requests", stats->s_req);
+ /* Total pipe */
+ varnish_submit_derive (conf->instance, "totals", "total_operations", "pipe", stats->s_pipe);
+ /* Total pass */
+ varnish_submit_derive (conf->instance, "totals", "total_operations", "pass", stats->s_pass);
+ /* Total fetch */
+ varnish_submit_derive (conf->instance, "totals", "total_operations", "fetches", stats->s_fetch);
+ /* Total header bytes */
+ varnish_submit_derive (conf->instance, "totals", "total_bytes", "header-bytes", stats->s_hdrbytes);
+ /* Total body byte */
+ varnish_submit_derive (conf->instance, "totals", "total_bytes", "body-bytes", stats->s_bodybytes);
+ }
+
+#ifdef HAVE_VARNISH_V3
+ if (conf->collect_uptime)
+ {
+ /* Client uptime */
+ varnish_submit_gauge (conf->instance, "uptime", "uptime", "client_uptime", stats->uptime);
+ }
+#endif
+
+ if (conf->collect_vcl)
+ {
+ /* N vcl total */
+ varnish_submit_gauge (conf->instance, "vcl", "vcl", "total_vcl", stats->n_vcl);
+ /* N vcl available */
+ varnish_submit_gauge (conf->instance, "vcl", "vcl", "avail_vcl", stats->n_vcl_avail);
+ /* N vcl discarded */
+ varnish_submit_gauge (conf->instance, "vcl", "vcl", "discarded_vcl", stats->n_vcl_discard);
+ }
+
+ if (conf->collect_workers)
+ {
+ /* worker threads */
+ varnish_submit_gauge (conf->instance, "workers", "threads", "worker", stats->n_wrk);
+ /* worker threads created */
+ varnish_submit_derive (conf->instance, "workers", "total_threads", "created", stats->n_wrk_create);
+ /* worker threads not created */
+ varnish_submit_derive (conf->instance, "workers", "total_threads", "failed", stats->n_wrk_failed);
+ /* worker threads limited */
+ varnish_submit_derive (conf->instance, "workers", "total_threads", "limited", stats->n_wrk_max);
+ /* dropped work requests */
+ varnish_submit_derive (conf->instance, "workers", "total_requests", "dropped", stats->n_wrk_drop);
+#ifdef HAVE_VARNISH_V2
+ /* queued work requests */
+ varnish_submit_derive (conf->instance, "workers", "total_requests", "queued", stats->n_wrk_queue);
+ /* overflowed work requests */
+ varnish_submit_derive (conf->instance, "workers", "total_requests", "overflowed", stats->n_wrk_overflow);
+#else
+ /* queued work requests */
+ varnish_submit_derive (conf->instance, "workers", "total_requests", "queued", stats->n_wrk_queued);
+ /* work request queue length */
+ varnish_submit_derive (conf->instance, "workers", "total_requests", "queue_length", stats->n_wrk_lqueue);
+#endif