|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.ow2.jasmine.probe.collectors.JCollector
public abstract class JCollector
This object represents a Collector in use. It is abstract, because implementation may be various. These implementations are in separate modules.
| Field Summary | |
|---|---|
protected String |
hostName
Host name corresponding to the IP address of the local host |
protected JasmineIndicator |
indicator
Indicator definition |
protected org.ow2.util.log.Log |
logger
Logger |
protected String |
MISC_TARGET
Can't say which target is, indicator's value may be a result of combining values of indicators having different targets. |
protected String |
NO_TARGET
Target not defined (for example, for a constant indicator) |
protected int |
period
Period of polling in seconds |
protected String |
probeId
Probe id |
protected ProbeManager |
probeManager
Reference to the ProbeManager |
| Constructor Summary | |
|---|---|
JCollector(String probeId,
JasmineIndicator def,
int period)
Constructor |
|
| Method Summary | |
|---|---|
protected Number |
addJsr(Collection<JasmineSingleResult> jsrs)
Add the values of a list of JSRs. |
protected long |
addLongJsr(Collection<JasmineSingleResult> jsrs)
Add the values of a list of JSRs. |
protected long |
addLongValues(Collection<Number> values)
Add a list of values of same type (short, int, long or float casted to long) |
protected Number |
addValues(Collection<Number> values)
Add a list of values of one of the following types: short, integer, long, float or doubles |
protected Number |
averageJsr(Collection<JasmineSingleResult> jsrs)
|
protected Number |
diffJsr(Collection<JasmineSingleResult> jsrs)
Make a diff between 2 same type values of a list containing 2 JSRs. |
protected long |
diffLongValues(Number v1,
Number v2)
Make a diff between 2 values |
protected Number |
diffValues(Number v1,
Number v2)
Make a difference between 2 values of one of the following types: short, integer, long, float or doubles |
protected Number |
divideJsr(Collection<JasmineSingleResult> jsrs)
Make a division of 2 values of 2 JSRs contained in a given JSRs list |
protected float |
divideLongValues(Number v1,
Number v2)
Make a div between 2 values |
protected Number |
divideValues(Number v1,
Number v2)
Make a div between 2 values |
protected String |
getDefaultTarget()
The default policy is to use the host name. |
protected String |
getDomainName()
|
JasmineIndicator |
getIndicator()
|
String |
getIndicatorName()
Return the name of the indicator corresponding to this Collector |
protected JasmineSingleResult |
getJsr(String name,
Object value,
long timestamp,
int scale)
Return the JasmineSingleResult corresponding to a polled value (for example an MBean attribute). |
abstract JasmineIndicatorValue |
getLastResult()
return the last result for this indicator |
String |
getProbeId()
|
protected String |
getServerName()
|
boolean |
isRemoved()
|
protected HashMap<String,String> |
jsrProps(Collection<JasmineSingleResult> jsrs)
Construct properties for a JSR by aggregating the properties of a collection of JSRs. |
protected long |
longValue(Number nb)
Try to cast a Number into a long value |
protected Number |
maxJsr(Collection<JasmineSingleResult> jsrs)
Return the max value in a collection of JSRs. |
protected Number |
minJsr(Collection<JasmineSingleResult> jsrs)
Return the min value in a collection of JSRs. |
protected Number |
multiplyJsr(Collection<JasmineSingleResult> jsrs)
Multiply the values of a list of JSRs. |
protected long |
multiplyLongValues(Collection<Number> values)
Multiply a list of values of same type |
protected Number |
multiplyValues(Collection<Number> values)
Multiply a list of values of one of the following types: short, integer, long, float or doubles |
void |
remove()
Mark collector as removed. |
void |
setProbeManager(ProbeManager probeManager)
Set the probeManager ref when it is needed, for some Collectors. |
abstract void |
startPolling()
Restart polling |
abstract void |
stopPolling()
Stop polling |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected org.ow2.util.log.Log logger
protected JasmineIndicator indicator
protected int period
protected String probeId
protected ProbeManager probeManager
protected String hostName
protected final String NO_TARGET
protected final String MISC_TARGET
| Constructor Detail |
|---|
public JCollector(String probeId,
JasmineIndicator def,
int period)
| Method Detail |
|---|
public void remove()
remove in interface JasmineCollectorpublic boolean isRemoved()
isRemoved in interface JasmineCollectorpublic JasmineIndicator getIndicator()
public void setProbeManager(ProbeManager probeManager)
probeManager - protected String getDomainName()
protected String getServerName()
public String getIndicatorName()
getIndicatorName in interface JasmineCollectorpublic String getProbeId()
getProbeId in interface JasmineCollector
public abstract JasmineIndicatorValue getLastResult()
throws JasmineCollectorException
getLastResult in interface JasmineCollectorJasmineCollectorExceptionpublic abstract void stopPolling()
stopPolling in interface JasmineCollectorpublic abstract void startPolling()
startPolling in interface JasmineCollectorprotected String getDefaultTarget()
protected JasmineSingleResult getJsr(String name,
Object value,
long timestamp,
int scale)
throws JasmineCollectorException
name - the name of the polled objectvalue - the obtained valuetimestamp - time stamp in milliseconds to put into the JSRscale - scale to use when calculating the value to put into the JSR
JasmineCollectorException - Raised by divideValues.
protected Number maxJsr(Collection<JasmineSingleResult> jsrs)
throws JasmineCollectorException
jsrs - collection of JSRs to be aggregated
JasmineCollectorException
protected Number minJsr(Collection<JasmineSingleResult> jsrs)
throws JasmineCollectorException
jsrs - collection of JSRs to be aggregated
JasmineCollectorException
protected Number averageJsr(Collection<JasmineSingleResult> jsrs)
throws JasmineCollectorException
JasmineCollectorException
protected long diffLongValues(Number v1,
Number v2)
throws JasmineCollectorException
v1 - v2 -
JasmineCollectorException
protected Number diffJsr(Collection<JasmineSingleResult> jsrs)
throws JasmineCollectorException
jsrs - the list of JSRs
JasmineCollectorException
protected float divideLongValues(Number v1,
Number v2)
throws JasmineCollectorException
v1 - v2 -
JasmineCollectorException
protected Number divideValues(Number v1,
Number v2)
throws JasmineCollectorException
v1 - v2 -
JasmineCollectorException
protected Number divideJsr(Collection<JasmineSingleResult> jsrs)
throws JasmineCollectorException
jsrs - the list of 2 JSRs
JasmineCollectorException
protected Number addValues(Collection<Number> values)
throws JasmineCollectorException
values - to sum
JasmineCollectorException
protected Number diffValues(Number v1,
Number v2)
throws JasmineCollectorException
v1 - v2 -
JasmineCollectorException
protected long addLongValues(Collection<Number> values)
throws JasmineCollectorException
values -
JasmineCollectorException
protected long addLongJsr(Collection<JasmineSingleResult> jsrs)
throws JasmineCollectorException
jsrs - the list of JSRs
JasmineCollectorException
protected Number addJsr(Collection<JasmineSingleResult> jsrs)
throws JasmineCollectorException
jsrs - the list of JSRs
JasmineCollectorException
protected long multiplyLongValues(Collection<Number> values)
throws JasmineCollectorException
values -
JasmineCollectorException
protected Number multiplyValues(Collection<Number> values)
throws JasmineCollectorException
values - to multiply
JasmineCollectorException
protected Number multiplyJsr(Collection<JasmineSingleResult> jsrs)
throws JasmineCollectorException
jsrs - the list of JSRs
JasmineCollectorException
protected long longValue(Number nb)
throws JasmineCollectorException
nb -
JasmineCollectorExceptionprotected HashMap<String,String> jsrProps(Collection<JasmineSingleResult> jsrs)
jsrs -
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||