add peak SPS for last 5 minutes

This commit is contained in:
Ken Rice
2013-07-19 22:40:05 -05:00
parent b830e6fd4b
commit 5660f90509
8 changed files with 37 additions and 6 deletions

View File

@@ -89,6 +89,7 @@ static void send_heartbeat(void)
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Max-Sessions", "%u", switch_core_session_limit(0));
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Session-Per-Sec", "%u", runtime.sps);
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Session-Per-Sec-Max", "%u", runtime.sps_peak);
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Session-Per-Sec-FiveMin", "%u", runtime.sps_peak_fivemin);
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Session-Since-Startup", "%" SWITCH_SIZE_T_FMT, switch_core_session_id() - 1);
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Idle-CPU", "%f", switch_core_idle_cpu());
switch_event_fire(&event);
@@ -2484,6 +2485,9 @@ SWITCH_DECLARE(int32_t) switch_core_session_ctl(switch_session_ctl_t cmd, void *
}
newintval = runtime.sps_peak;
break;
case SCSC_SPS_PEAK_FIVEMIN:
newintval = runtime.sps_peak_fivemin;
break;
case SCSC_MAX_DTMF_DURATION:
newintval = switch_core_max_dtmf_duration(oldintval);
break;