+ if (conf->collect_objects)
+ {
+ /* N expired objects */
+ varnish_submit_derive (conf->instance, "objects", "total_objects", "expired", stats->n_expired);
+ /* N LRU nuked objects */
+ varnish_submit_derive (conf->instance, "objects", "total_objects", "lru_nuked", stats->n_lru_nuked);
+#if HAVE_VARNISH_V2
+ /* N LRU saved objects */
+ varnish_submit_derive (conf->instance, "objects", "total_objects", "lru_saved", stats->n_lru_saved);
+#endif
+ /* N LRU moved objects */
+ varnish_submit_derive (conf->instance, "objects", "total_objects", "lru_moved", stats->n_lru_moved);
+#if HAVE_VARNISH_V2
+ /* N objects on deathrow */
+ varnish_submit_derive (conf->instance, "objects", "total_objects", "deathrow", stats->n_deathrow);
+#endif
+ /* HTTP header overflows */
+ varnish_submit_derive (conf->instance, "objects", "total_objects", "header_overflow", stats->losthdr);
+#if HAVE_VARNISH_V4
+ /* N purged objects */
+ varnish_submit_derive (conf->instance, "objects", "total_objects", "purged", stats->n_obj_purged);
+#else
+ /* Objects sent with sendfile */
+ varnish_submit_derive (conf->instance, "objects", "total_objects", "sent_sendfile", stats->n_objsendfile);
+ /* Objects sent with write */
+ varnish_submit_derive (conf->instance, "objects", "total_objects", "sent_write", stats->n_objwrite);
+ /* Objects overflowing workspace */
+ varnish_submit_derive (conf->instance, "objects", "total_objects", "workspace_overflow", stats->n_objoverflow);
+#endif
+ }
+
+#if HAVE_VARNISH_V2
+ if (conf->collect_purge)
+ {
+ /* N total active purges */
+ varnish_submit_derive (conf->instance, "purge", "total_operations", "total", stats->n_purge);
+ /* N new purges added */
+ varnish_submit_derive (conf->instance, "purge", "total_operations", "added", stats->n_purge_add);
+ /* N old purges deleted */
+ varnish_submit_derive (conf->instance, "purge", "total_operations", "deleted", stats->n_purge_retire);
+ /* N objects tested */
+ varnish_submit_derive (conf->instance, "purge", "total_operations", "objects_tested", stats->n_purge_obj_test);
+ /* N regexps tested against */
+ varnish_submit_derive (conf->instance, "purge", "total_operations", "regexps_tested", stats->n_purge_re_test);
+ /* N duplicate purges removed */
+ varnish_submit_derive (conf->instance, "purge", "total_operations", "duplicate", stats->n_purge_dups);
+ }
+#endif
+#if HAVE_VARNISH_V3
+ if (conf->collect_ban)
+ {
+ /* N total active bans */
+ varnish_submit_derive (conf->instance, "ban", "total_operations", "total", stats->n_ban);
+ /* N new bans added */
+ varnish_submit_derive (conf->instance, "ban", "total_operations", "added", stats->n_ban_add);
+ /* N old bans deleted */
+ varnish_submit_derive (conf->instance, "ban", "total_operations", "deleted", stats->n_ban_retire);
+ /* N objects tested */
+ varnish_submit_derive (conf->instance, "ban", "total_operations", "objects_tested", stats->n_ban_obj_test);
+ /* N regexps tested against */
+ varnish_submit_derive (conf->instance, "ban", "total_operations", "regexps_tested", stats->n_ban_re_test);
+ /* N duplicate bans removed */
+ varnish_submit_derive (conf->instance, "ban", "total_operations", "duplicate", stats->n_ban_dups);
+ }
+#endif
+#if HAVE_VARNISH_V4
+ if (conf->collect_ban)
+ {
+ /* N total active bans */
+ varnish_submit_derive (conf->instance, "ban", "total_operations", "total", stats->bans);
+ /* N new bans added */
+ varnish_submit_derive (conf->instance, "ban", "total_operations", "added", stats->bans_added);
+ /* N bans using obj */
+ varnish_submit_derive (conf->instance, "ban", "total_operations", "obj", stats->bans_obj);
+ /* N bans using req */
+ varnish_submit_derive (conf->instance, "ban", "total_operations", "req", stats->bans_req);
+ /* N new bans completed */
+ varnish_submit_derive (conf->instance, "ban", "total_operations", "completed", stats->bans_completed);
+ /* N old bans deleted */
+ varnish_submit_derive (conf->instance, "ban", "total_operations", "deleted", stats->bans_deleted);
+ /* N objects tested */
+ varnish_submit_derive (conf->instance, "ban", "total_operations", "tested", stats->bans_tested);
+ /* N duplicate bans removed */
+ varnish_submit_derive (conf->instance, "ban", "total_operations", "duplicate", stats->bans_dups);
+ }
+#endif
+
+ if (conf->collect_session)
+ {
+ /* Session Closed */
+ varnish_submit_derive (conf->instance, "session", "total_operations", "closed", stats->sess_closed);
+ /* Session Pipeline */
+ varnish_submit_derive (conf->instance, "session", "total_operations", "pipeline", stats->sess_pipeline);
+ /* Session Read Ahead */
+ varnish_submit_derive (conf->instance, "session", "total_operations", "readahead", stats->sess_readahead);
+#if HAVE_VARNISH_V4
+ /* Sessions accepted */
+ varnish_submit_derive (conf->instance, "session", "total_operations", "accepted", stats->sess_conn);
+ /* Sessions dropped for thread */
+ varnish_submit_derive (conf->instance, "session", "total_operations", "dropped", stats->sess_drop);
+ /* Sessions accept failure */
+ varnish_submit_derive (conf->instance, "session", "total_operations", "failed", stats->sess_fail);
+ /* Sessions pipe overflow */
+ varnish_submit_derive (conf->instance, "session", "total_operations", "overflow", stats->sess_pipe_overflow);
+ /* Sessions queued for thread */
+ varnish_submit_derive (conf->instance, "session", "total_operations", "queued", stats->sess_queued);
+#else
+ /* Session Linger */
+ varnish_submit_derive (conf->instance, "session", "total_operations", "linger", stats->sess_linger);
+#endif
+ /* Session herd */
+ varnish_submit_derive (conf->instance, "session", "total_operations", "herd", stats->sess_herd);
+ }
+