|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.cocoon.monitoring.statistics.StatisticsCollector
public class StatisticsCollector
Field Summary | |
---|---|
static long |
DEFAULT_MAX_KEEP_TIME
Default value of maxKeepTime: 24h. |
static long |
DEFAULT_REFRESH_DELAY
Default refresh time: 10s; |
Constructor Summary | |
---|---|
StatisticsCollector()
This constructor uses default values of DEFAULT_MAX_KEEP_TIME ,
and DEFAULT_REFRESH_DELAY to pass into
StatisticsCollector(long, long) |
|
StatisticsCollector(long maxKeepTime,
long refreshDelay)
|
Method Summary | |
---|---|
double |
getHitCount(String key)
Returns sum for all hit count for given key. |
double |
getHitCountSum()
Returns all hit count for this statistics source (sum of all hit counts for all contained key's). |
Map<String,Double> |
getHits()
Returns unordered Map of summed value of all hit |
Map<String,Long> |
getHits(long time)
Returns unordered Map , where key is source name and value is
sum of hit count, limited only to entry's that are younger then time parameter |
long |
getRequestCount(String key,
long time)
Returns hit count for particular key in particular time |
void |
incerementCounter(String key)
Increment value of counter for particular key . |
void |
putKey(String key)
Only adds key into counter but don't increment hit count for this key . |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final long DEFAULT_REFRESH_DELAY
public static final long DEFAULT_MAX_KEEP_TIME
Constructor Detail |
---|
public StatisticsCollector()
DEFAULT_MAX_KEEP_TIME
,
and DEFAULT_REFRESH_DELAY
to pass into
StatisticsCollector(long, long)
public StatisticsCollector(long maxKeepTime, long refreshDelay)
maxKeepTime
- how long (in milliseconds) should be statistics data kept in collectorrefreshDelay
- delay time (in milliseconds) between run of cleaning thread, that will remove entry's
are older than value in maxKeepTime
Method Detail |
---|
public Map<String,Double> getHits()
StatisticsSourceEnabled
Map
of summed value of all hit
getHits
in interface StatisticsSourceEnabled
public Map<String,Long> getHits(long time)
StatisticsSourceEnabled
Map
, where key
is source name and value
is
sum of hit count, limited only to entry's that are younger then time
parameter
getHits
in interface StatisticsSourceEnabled
public double getHitCount(String key)
StatisticsSourceEnabled
getHitCount
in interface StatisticsSourceEnabled
public double getHitCountSum()
StatisticsSourceEnabled
getHitCountSum
in interface StatisticsSourceEnabled
public long getRequestCount(String key, long time)
StatisticsSourceEnabled
key
in particular time
getRequestCount
in interface StatisticsSourceEnabled
public void putKey(String key)
key
. It is useful if you want to have this key
in a list
of all used key's with value 0 (i.e. for registered but never used
cache entry's).
key
- public void incerementCounter(String key)
key
.
In fact this method adds actual time (in milliseconds) into list that is connected with
this key
.
key
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |