File: profiler.h

package info (click to toggle)
icinga 1.0.2-2%2Bsqueeze2
  • links: PTS, VCS
  • area: main
  • in suites: squeeze-lts
  • size: 33,964 kB
  • ctags: 13,294
  • sloc: xml: 154,821; ansic: 99,198; sh: 14,761; sql: 5,852; php: 5,126; perl: 2,838; makefile: 1,268
file content (66 lines) | stat: -rw-r--r-- 2,325 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66

/*****************************************************************************
 *
 * PROFILER.H - Event Profiler For Icinga
 *
 * Copyright: (c) 2009 Intellectual Reserve Inc.
 * Author:  Steven D. Morrey (nagios-devel@lists.sourceforge.net)
 *
 * Description:
 *
 * Nagios is a network monitoring tool that will check hosts and services
 * that you specify.  This utility adds the ability to profile the events
 * occuring within the application itself
 *
 * License:
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 as
 * published by the Free Software Foundation.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 *
 *****************************************************************************/
#ifndef __PROFILER__HEADER__INCLUDED__
#define __PROFILER__HEADER__INCLUDED__


#define EVENT_LOOP_EMPTY_LIST                   100
#define EVENT_LOOP_EVENT_LIST_HIGH_EXECUTED     101
#define EVENT_LOOP_FAIL_NO_SERVICE_CHECKS       102
#define EVENT_LOOP_FAIL_MAX_CHECKS              103
#define EVENT_LOOP_FAIL_PARALLEL                104
#define EVENT_LOOP_FAIL_NO_HOST_CHECKS          105
#define EVENT_LOOP_EXECUTED_EVENT               106
#define EVENT_LOOP_NO_EXECUTION                 107
#define EVENT_LOOP_IDLED                        108
#define EVENT_LOOP_COMPLETION                   109


typedef struct profiler_item{
	int   state;
	int    counter;
	double elapsed;
	char * name;
}profiler_item;

extern profiler_item * profiler;

void profiler_init();
void profiler_enable_core();
void profiler_enable_all();
void profiler_full_reset(profiler_item *p[]);
void profiler_item_reset(profiler_item *p);
void profiler_add(int event, char *name);
void profiler_setstate(int event,int state);
void profiler_rename(int p, char * name);
void profiler_update(int event, struct timeval start);
void profiler_output(FILE* fp);
#endif