struct freq_ctr ssl_be_keys_per_sec;
struct freq_ctr comp_bps_in; /* bytes per second, before http compression */
struct freq_ctr comp_bps_out; /* bytes per second, after http compression */
+ struct freq_ctr out_32bps; /* #of 32-byte blocks emitted per second */
+ unsigned long long out_bytes; /* total #of bytes emitted */
int cps_lim, cps_max;
int sps_lim, sps_max;
int ssl_lim, ssl_max;
INF_DROPPED_LOGS,
INF_BUSY_POLLING,
INF_FAILED_RESOLUTIONS,
+ INF_TOTAL_BYTES_OUT,
+ INF_BYTES_OUT_RATE,
/* must always be the last one */
INF_TOTAL_FIELDS
leave:
conn_cond_update_sock_polling(conn);
+ if (retval > 0) {
+ /* we count the total bytes sent, and the send rate for 32-byte
+ * blocks. The reason for the latter is that freq_ctr are
+ * limited to 4GB and that it's not enough per second.
+ */
+ _HA_ATOMIC_ADD(&global.out_bytes, retval);
+ update_freq_ctr(&global.out_32bps, (retval + 16) / 32);
+ }
return retval;
out_read0:
conn->flags &= ~CO_FL_WAIT_L4_CONN;
conn_cond_update_sock_polling(conn);
+ if (done > 0) {
+ /* we count the total bytes sent, and the send rate for 32-byte
+ * blocks. The reason for the latter is that freq_ctr are
+ * limited to 4GB and that it's not enough per second.
+ */
+ _HA_ATOMIC_ADD(&global.out_bytes, done);
+ update_freq_ctr(&global.out_32bps, (done + 16) / 32);
+ }
return done;
}
[INF_DROPPED_LOGS] = "DroppedLogs",
[INF_BUSY_POLLING] = "BusyPolling",
[INF_FAILED_RESOLUTIONS] = "FailedResolutions",
+ [INF_TOTAL_BYTES_OUT] = "TotalBytesOut",
+ [INF_BYTES_OUT_RATE] = "BytesOutRate",
};
const char *stat_field_names[ST_F_TOTAL_FIELDS] = {
info[INF_DROPPED_LOGS] = mkf_u32(0, dropped_logs);
info[INF_BUSY_POLLING] = mkf_u32(0, !!(global.tune.options & GTUNE_BUSY_POLLING));
info[INF_FAILED_RESOLUTIONS] = mkf_u32(0, dns_failed_resolutions);
+ info[INF_TOTAL_BYTES_OUT] = mkf_u64(0, global.out_bytes);
+ info[INF_BYTES_OUT_RATE] = mkf_u64(FN_RATE, (unsigned long long)read_freq_ctr(&global.out_32bps) * 32);
return 1;
}