mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-08-13 17:38:59 +00:00
add peak sps to stats and a command to reset it
This commit is contained in:
@@ -88,6 +88,7 @@ static void send_heartbeat(void)
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Session-Count", "%u", switch_core_session_count());
|
||||
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-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);
|
||||
@@ -2477,6 +2478,12 @@ SWITCH_DECLARE(int32_t) switch_core_session_ctl(switch_session_ctl_t cmd, void *
|
||||
case SCSC_LAST_SPS:
|
||||
newintval = runtime.sps_last;
|
||||
break;
|
||||
case SCSC_SPS_PEAK:
|
||||
if (oldintval == -1) {
|
||||
runtime.sps_peak = 0;
|
||||
}
|
||||
newintval = runtime.sps_peak;
|
||||
break;
|
||||
case SCSC_MAX_DTMF_DURATION:
|
||||
newintval = switch_core_max_dtmf_duration(oldintval);
|
||||
break;
|
||||
|
Reference in New Issue
Block a user