Add "statistics" functionality to ShellPerfLog

Add a facility for defining and recording numeric statistics
as performance events

 shell_perf_log_define_statistic()
   Define a statistic and the corresponding event type
 shell_perf_log_update_statistic_[ix]() -
   Update the stored statistic value
 shell_perf_log_add_statistics_callback()
   Add a function called before collecting statistics
 shell_perf_collect_statistics()
   Update statistics and record events for them

In addition to the explicit collection, statistics are
recorded at a periodic interval (currently 5s)

https://bugzilla.gnome.org/show_bug.cgi?id=618189
This commit is contained in:
Owen W. Taylor
2010-05-11 15:48:47 -04:00
parent 98c2247c1b
commit c972ff3ab4
2 changed files with 319 additions and 2 deletions

View File

@ -39,6 +39,28 @@ void shell_perf_log_event_s (ShellPerfLog *perf_log,
const char *name,
const char *arg);
void shell_perf_log_define_statistic (ShellPerfLog *perf_log,
const char *name,
const char *description,
const char *signature);
void shell_perf_log_update_statistic_i (ShellPerfLog *perf_log,
const char *name,
int value);
void shell_perf_log_update_statistic_x (ShellPerfLog *perf_log,
const char *name,
gint64 value);
typedef void (*ShellPerfStatisticsCallback) (ShellPerfLog *perf_log,
gpointer data);
void shell_perf_log_add_statistics_callback (ShellPerfLog *perf_log,
ShellPerfStatisticsCallback callback,
gpointer user_data,
GDestroyNotify notify);
void shell_perf_log_collect_statistics (ShellPerfLog *perf_log);
typedef void (*ShellPerfReplayFunction) (gint64 time,
const char *name,
const char *signature,