switch_profile.h File Reference

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Typedefs

typedef profile_timer switch_profile_timer_t

Functions

switch_profile_timer_tswitch_new_profile_timer (void)
 create a new profile timer
switch_bool_t switch_get_system_idle_time (switch_profile_timer_t *p, double *idle_percentage)
 provides the percentage of idle system time
void switch_delete_profile_timer (switch_profile_timer_t **p)
 Deletes profile timer.


Typedef Documentation

typedef struct profile_timer switch_profile_timer_t

Definition at line 37 of file switch_profile.h.


Function Documentation

void switch_delete_profile_timer ( switch_profile_timer_t **  p  ) 

Deletes profile timer.

Definition at line 278 of file switch_profile.c.

Referenced by SWITCH_MODULE_RUNTIME_FUNCTION().

00279 {
00280         if (!p) return;
00281 
00282 #ifdef __linux__
00283         close((*p)->procfd);
00284 #endif
00285         free(*p);
00286         *p = NULL;
00287 }

switch_bool_t switch_get_system_idle_time ( switch_profile_timer_t p,
double *  idle_percentage 
)

provides the percentage of idle system time

Parameters:
p profile timer structure previously created with new_profile_timer
pointer to store the percentage of idle time
Returns:
false on error true for success
Note:
on error idle_percentage will be set to 100

Definition at line 265 of file switch_profile.c.

References SWITCH_FALSE.

Referenced by SWITCH_MODULE_RUNTIME_FUNCTION().

00266 {
00267         *idle_percentage = 100.0;
00268         return SWITCH_FALSE;
00269 }

switch_profile_timer_t* switch_new_profile_timer ( void   ) 

create a new profile timer

Returns:
profile timer structure previously created with new_profile_timer, NULL on error

Definition at line 273 of file switch_profile.c.

Referenced by SWITCH_MODULE_RUNTIME_FUNCTION().

00274 {
00275         return calloc(1, sizeof(switch_profile_timer_t));
00276 }


Generated on Sun May 20 04:00:13 2012 for FreeSWITCH API Documentation by  doxygen 1.4.7