OpenDNSSEC-signer  2.1.5
stats.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2009 NLNet Labs. All rights reserved.
3  *
4  * Redistribution and use in source and binary forms, with or without
5  * modification, are permitted provided that the following conditions
6  * are met:
7  * 1. Redistributions of source code must retain the above copyright
8  * notice, this list of conditions and the following disclaimer.
9  * 2. Redistributions in binary form must reproduce the above copyright
10  * notice, this list of conditions and the following disclaimer in the
11  * documentation and/or other materials provided with the distribution.
12  *
13  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
14  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
15  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
16  * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
17  * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
18  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
19  * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
20  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
21  * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
22  * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
23  * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24  *
25  */
26 
27 #ifndef SIGNER_STATS_H
28 #define SIGNER_STATS_H
29 
30 #include "config.h"
31 #include <ctype.h>
32 #include <stdint.h>
33 #include <time.h>
34 #ifdef HAVE_SYS_TYPES_H
35 # include <sys/types.h>
36 #endif
37 #ifdef HAVE_UNISTD_H
38 # include <unistd.h>
39 #endif
40 
41 #include <ldns/ldns.h>
42 
43 typedef struct stats_struct stats_type;
44 
45 #include "locks.h"
46 
50 struct stats_struct {
51  uint32_t sort_count;
52  time_t sort_time;
53  int sort_done;
54  uint32_t nsec_count;
55  time_t nsec_time;
56  uint32_t sig_count;
57  uint32_t sig_soa_count;
58  uint32_t sig_reuse;
59  time_t sig_time;
60  time_t audit_time;
61  time_t start_time;
62  time_t end_time;
63  pthread_mutex_t stats_lock;
64 };
65 
72 
81 void stats_log(stats_type* stats, const char* name, uint32_t serial,
82  ldns_rr_type nsec_type);
83 
89 void stats_clear(stats_type* stats);
90 
96 void stats_cleanup(stats_type* stats);
97 
98 #endif /* SIGNER_STATS_H */
stats_clear
void stats_clear(stats_type *stats)
Definition: stats.c:54
stats_log
void stats_log(stats_type *stats, const char *name, uint32_t serial, ldns_rr_type nsec_type)
Definition: stats.c:76
stats_struct::sort_time
time_t sort_time
Definition: stats.h:52
stats_struct::end_time
time_t end_time
Definition: stats.h:62
stats_cleanup
void stats_cleanup(stats_type *stats)
Definition: stats.c:106
stats_struct::start_time
time_t start_time
Definition: stats.h:61
stats_struct::nsec_time
time_t nsec_time
Definition: stats.h:55
stats_struct::audit_time
time_t audit_time
Definition: stats.h:60
stats_struct
Definition: stats.h:50
stats_create
stats_type * stats_create(void)
Definition: stats.c:40
stats_struct::sig_time
time_t sig_time
Definition: stats.h:59
stats_struct::sig_soa_count
uint32_t sig_soa_count
Definition: stats.h:57
stats_struct::nsec_count
uint32_t nsec_count
Definition: stats.h:54
stats_struct::sort_count
uint32_t sort_count
Definition: stats.h:51
stats_struct::sig_reuse
uint32_t sig_reuse
Definition: stats.h:58
stats_struct::sig_count
uint32_t sig_count
Definition: stats.h:56
stats_struct::stats_lock
pthread_mutex_t stats_lock
Definition: stats.h:63
stats_struct::sort_done
int sort_done
Definition: stats.h:53