1 // ------------------------------------------------
7 // (c) 2002 peercast.org
8 // ------------------------------------------------
9 // This program is free software; you can redistribute it and/or modify
10 // it under the terms of the GNU General Public License as published by
11 // the Free Software Foundation; either version 2 of the License, or
12 // (at your option) any later version.
14 // This program is distributed in the hope that it will be useful,
15 // but WITHOUT ANY WARRANTY; without even the implied warranty of
16 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 // GNU General Public License for more details.
18 // ------------------------------------------------
23 // ------------------------------------------------------
36 NUMQUERYIN,NUMQUERYOUT,
41 NUMOTHERIN,NUMOTHEROUT,
47 NUMHOPS1,NUMHOPS2,NUMHOPS3,NUMHOPS4,NUMHOPS5,NUMHOPS6,NUMHOPS7,NUMHOPS8,NUMHOPS9,NUMHOPS10,
67 bool writeVariable(class Stream &,const class String &);
69 void clearRange(STAT s, STAT e)
71 for(int i=s; i<=e; i++)
74 void clear(STAT s) {current[s]=0;}
75 void add(STAT s,int n=1) {current[s]+=n;}
76 unsigned int getPerSecond(STAT s) {return perSec[s];}
77 unsigned long long int getCurrent(STAT s) {return current[s];}
79 unsigned long long int current[Stats::MAX],last[Stats::MAX];
80 unsigned int perSec[Stats::MAX];
81 unsigned int lastUpdate;