104 lines
3.1 KiB
C
104 lines
3.1 KiB
C
/*
|
|
Copyright (C) 2004, Wolfgang Hottgenroth
|
|
|
|
This file is part of smmapdfw.
|
|
|
|
smmapdfw is free software; you can redistribute it and/or modify it
|
|
under the terms of the GNU General Public License as published by
|
|
the Free Software Foundation; either version 2 of the License, or
|
|
(at your option) any later version.
|
|
|
|
smmapdfw 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 smmapdfw. If not, write to the Free Software Foundation, 59
|
|
Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
*/
|
|
|
|
|
|
#ifndef _STATS_H_
|
|
#define _STATS_H_
|
|
|
|
#include "smmapd.h"
|
|
|
|
#ifdef _STATS_C_
|
|
char *stat_cnt_names[] = {
|
|
"",
|
|
"Server: accepted",
|
|
"Server: failed",
|
|
"Server: running networker threads",
|
|
"Server: networker threads",
|
|
"Server: failed to start, networker threads",
|
|
|
|
"Verifier: entries in cache",
|
|
"Verifier: running worker threads",
|
|
"Verifier: worker threads",
|
|
"Verifier: failed to start, worker threads",
|
|
"Verifier: timed out worker threads",
|
|
"Verifier: running checker threads",
|
|
"Verifier: checker threads",
|
|
"Verifier: failed to start, checker threads",
|
|
"Verifier: answered from cache",
|
|
"Verifier: returned OK",
|
|
"Verifier: returned NOK",
|
|
"Verifier: returned TNOK",
|
|
|
|
"Cyrus: checker",
|
|
"Cyrus: illegal input",
|
|
"Cyrus: depot dns failure",
|
|
"Cyrus: returned OK",
|
|
"Cyrus: returned NOK",
|
|
"Cyrus: returned TNOK",
|
|
|
|
"Server: returned OK",
|
|
"Server: returned TEMP_NOK",
|
|
"Server: returned PERM_NOK",
|
|
"Server: returned NOT_FOUND_NOK",
|
|
"Server: returned illegal input",
|
|
"Server: returned unknown class",
|
|
"Server: returned TIMEOUT_NOK",
|
|
"Server: returned netstring unparsable",
|
|
};
|
|
#endif /* _STATS_C_ */
|
|
|
|
|
|
#define STAT_CNT_ACCEPTED 1
|
|
#define STAT_CNT_FAILED 2
|
|
#define STAT_CNT_NETWORKER_R_THREADS 3
|
|
#define STAT_CNT_NETWORKER_THREADS 4
|
|
#define STAT_CNT_NETWORKER_THREADS_FAILED 5
|
|
|
|
#define STAT_CNT_VERIFIER_CACHE 6
|
|
#define STAT_CNT_VERIFIER_WORKER_R_THREADS 7
|
|
#define STAT_CNT_VERIFIER_WORKER_THREADS 8
|
|
#define STAT_CNT_VERIFIER_WORKER_THREADS_FAILED 9
|
|
#define STAT_CNT_VERIFIER_WORKER_THREADS_TIMEOUT 10
|
|
#define STAT_CNT_VERIFIER_CHECKER_R_THREADS 11
|
|
#define STAT_CNT_VERIFIER_CHECKER_THREADS 12
|
|
#define STAT_CNT_VERIFIER_CHECKER_THREADS_FAILED 13
|
|
#define STAT_CNT_VERIFIER_ANSWERED_FROM_CACHE 14
|
|
#define STAT_CNT_VERIFIER_RETURNED_OK 15
|
|
#define STAT_CNT_VERIFIER_RETURNED_NOK 16
|
|
#define STAT_CNT_VERIFIER_RETURNED_TNOK 17
|
|
|
|
#define STAT_CNT_CYRUS_WORKER 18
|
|
#define STAT_CNT_CYRUS_ILLEGAL_INPUT 19
|
|
#define STAT_CNT_CYRUS_DEPOT_DNS_FAILURE 20
|
|
#define STAT_CNT_CYRUS_RETURNED_OK 21
|
|
#define STAT_CNT_CYRUS_RETURNED_NOK 22
|
|
#define STAT_CNT_CYRUS_RETURNED_TNOK 23
|
|
|
|
#define STAT_CNT_OFFSET 23
|
|
#define STAT_CNT_MAXNUM STAT_CNT_OFFSET + SMM_MAX_NUM
|
|
|
|
|
|
void initStatCounter();
|
|
unsigned int getStatCounter(int cnt_idx);
|
|
void incStatCounter(int cnt_idx);
|
|
void decStatCounter(int cnt_idx);
|
|
void outputStats(int stdout_nice, int syslog_nice);
|
|
#endif /* _STATS_H_ */
|