3
\brief Statistics (fs, av, cache, etc.) routines
5
$Id: stats.cxx,v 1.4 2008-11-23 16:04:24 burghardt Exp $
9
ClamFS - An user-space anti-virus protected file system
10
Copyright (C) 2008 Krzysztof Burghardt.
12
This program is free software; you can redistribute it and/or modify
13
it under the terms of the GNU General Public License as published by
14
the Free Software Foundation; either version 2 of the License, or
15
(at your option) any later version.
17
This program is distributed in the hope that it will be useful,
18
but WITHOUT ANY WARRANTY; without even the implied warranty of
19
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20
GNU General Public License for more details.
22
You should have received a copy of the GNU General Public License
23
along with this program; if not, write to the Free Software
24
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
31
Stats::Stats(time_t dumpEvery) {
48
lastdump = time(NULL);
55
void Stats::dumpToLog() {
56
rLog(Info, "--- begin of statistics ---");
57
rLog(Info, "Early cache hit: %llu", earlyCacheHit);
58
rLog(Info, "Early cache miss: %llu", earlyCacheMiss);
59
rLog(Info, "Late cache hit: %llu", lateCacheHit);
60
rLog(Info, "Late cache miss: %llu", lateCacheMiss);
61
rLog(Info, "Whitelist hit: %llu", whitelistHit);
62
rLog(Info, "Blacklist hit: %llu", blacklistHit);
63
rLog(Info, "Files bigger than maximal-size: %llu", tooBigFile);
64
rLog(Info, "open() function called %llu times (allowed: %llu, denied: %llu)",
65
openCalled, openAllowed, openDenied);
66
rLog(Info, "Scan failed %llu times", scanFailed);
67
rLog(Info, "--- end of statistics ---");
70
void Stats::periodicDumpToLog() {
74
time_t current = time(NULL);
75
if ((current - lastdump) > every) {
81
} /* namespace clamfs */