|
||||||||||
| 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 org.ow2.jasmine.probe.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 org.ow2.jasmine.probe.probemanager.ProbeManager |
probeManager
Reference to the ProbeManager |
| Constructor Summary | |
|---|---|
JCollector(String probeId,
org.ow2.jasmine.probe.JasmineIndicator def,
int period)
Constructor |
|
| Method Summary | |
|---|---|
protected Number |
addJsr(Collection<org.ow2.jasmine.probe.JasmineSingleResult> jsrs)
Add the values of a list of JSRs. |
protected long |
addLongJsr(Collection<org.ow2.jasmine.probe.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<org.ow2.jasmine.probe.JasmineSingleResult> jsrs)
|
protected Number |
diffJsr(Collection<org.ow2.jasmine.probe.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<org.ow2.jasmine.probe.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()
|
org.ow2.jasmine.probe.JasmineIndicator |
getIndicator()
|
String |
getIndicatorName()
Return the name of the indicator corresponding to this Collector |
protected org.ow2.jasmine.probe.JasmineSingleResult |
getJsr(String name,
Object value,
long timestamp,
int scale)
Return the JasmineSingleResult corresponding to a polled value (for example an MBean attribute). |
abstract org.ow2.jasmine.probe.JasmineIndicatorValue |
getLastResult()
return the last result for this indicator |
String |
getProbeId()
|
protected String |
getServerName()
|
boolean |
isRemoved()
|
protected HashMap<String,String> |
jsrProps(Collection<org.ow2.jasmine.probe.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<org.ow2.jasmine.probe.JasmineSingleResult> jsrs)
Return the max value in a collection of JSRs. |
protected Number |
minJsr(Collection<org.ow2.jasmine.probe.JasmineSingleResult> jsrs)
Return the min value in a collection of JSRs. |
protected Number |
multiplyJsr(Collection<org.ow2.jasmine.probe.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(org.ow2.jasmine.probe.probemanager.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 org.ow2.jasmine.probe.JasmineIndicator indicator
protected int period
protected String probeId
protected org.ow2.jasmine.probe.probemanager.ProbeManager probeManager
protected String hostName
protected final String NO_TARGET
protected final String MISC_TARGET
| Constructor Detail |
|---|
public JCollector(String probeId,
org.ow2.jasmine.probe.JasmineIndicator def,
int period)
| Method Detail |
|---|
public void remove()
remove in interface org.ow2.jasmine.probe.collector.JasmineCollectorpublic boolean isRemoved()
isRemoved in interface org.ow2.jasmine.probe.collector.JasmineCollectorpublic org.ow2.jasmine.probe.JasmineIndicator getIndicator()
public void setProbeManager(org.ow2.jasmine.probe.probemanager.ProbeManager probeManager)
probeManager - protected String getDomainName()
protected String getServerName()
public String getIndicatorName()
getIndicatorName in interface org.ow2.jasmine.probe.collector.JasmineCollectorpublic String getProbeId()
getProbeId in interface org.ow2.jasmine.probe.collector.JasmineCollector
public abstract org.ow2.jasmine.probe.JasmineIndicatorValue getLastResult()
throws org.ow2.jasmine.probe.collector.JasmineCollectorException
getLastResult in interface org.ow2.jasmine.probe.collector.JasmineCollectororg.ow2.jasmine.probe.collector.JasmineCollectorExceptionpublic abstract void stopPolling()
stopPolling in interface org.ow2.jasmine.probe.collector.JasmineCollectorpublic abstract void startPolling()
startPolling in interface org.ow2.jasmine.probe.collector.JasmineCollectorprotected String getDefaultTarget()
protected org.ow2.jasmine.probe.JasmineSingleResult getJsr(String name,
Object value,
long timestamp,
int scale)
throws org.ow2.jasmine.probe.collector.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
org.ow2.jasmine.probe.collector.JasmineCollectorException - Raised by divideValues.
protected Number maxJsr(Collection<org.ow2.jasmine.probe.JasmineSingleResult> jsrs)
throws org.ow2.jasmine.probe.collector.JasmineCollectorException
jsrs - collection of JSRs to be aggregated
org.ow2.jasmine.probe.collector.JasmineCollectorException
protected Number minJsr(Collection<org.ow2.jasmine.probe.JasmineSingleResult> jsrs)
throws org.ow2.jasmine.probe.collector.JasmineCollectorException
jsrs - collection of JSRs to be aggregated
org.ow2.jasmine.probe.collector.JasmineCollectorException
protected Number averageJsr(Collection<org.ow2.jasmine.probe.JasmineSingleResult> jsrs)
throws org.ow2.jasmine.probe.collector.JasmineCollectorException
org.ow2.jasmine.probe.collector.JasmineCollectorException
protected long diffLongValues(Number v1,
Number v2)
throws org.ow2.jasmine.probe.collector.JasmineCollectorException
v1 - v2 -
org.ow2.jasmine.probe.collector.JasmineCollectorException
protected Number diffJsr(Collection<org.ow2.jasmine.probe.JasmineSingleResult> jsrs)
throws org.ow2.jasmine.probe.collector.JasmineCollectorException
jsrs - the list of JSRs
org.ow2.jasmine.probe.collector.JasmineCollectorException
protected float divideLongValues(Number v1,
Number v2)
throws org.ow2.jasmine.probe.collector.JasmineCollectorException
v1 - v2 -
org.ow2.jasmine.probe.collector.JasmineCollectorException
protected Number divideValues(Number v1,
Number v2)
throws org.ow2.jasmine.probe.collector.JasmineCollectorException
v1 - v2 -
org.ow2.jasmine.probe.collector.JasmineCollectorException
protected Number divideJsr(Collection<org.ow2.jasmine.probe.JasmineSingleResult> jsrs)
throws org.ow2.jasmine.probe.collector.JasmineCollectorException
jsrs - the list of 2 JSRs
org.ow2.jasmine.probe.collector.JasmineCollectorException
protected Number addValues(Collection<Number> values)
throws org.ow2.jasmine.probe.collector.JasmineCollectorException
values - to sum
org.ow2.jasmine.probe.collector.JasmineCollectorException
protected Number diffValues(Number v1,
Number v2)
throws org.ow2.jasmine.probe.collector.JasmineCollectorException
v1 - v2 -
org.ow2.jasmine.probe.collector.JasmineCollectorException
protected long addLongValues(Collection<Number> values)
throws org.ow2.jasmine.probe.collector.JasmineCollectorException
values -
org.ow2.jasmine.probe.collector.JasmineCollectorException
protected long addLongJsr(Collection<org.ow2.jasmine.probe.JasmineSingleResult> jsrs)
throws org.ow2.jasmine.probe.collector.JasmineCollectorException
jsrs - the list of JSRs
org.ow2.jasmine.probe.collector.JasmineCollectorException
protected Number addJsr(Collection<org.ow2.jasmine.probe.JasmineSingleResult> jsrs)
throws org.ow2.jasmine.probe.collector.JasmineCollectorException
jsrs - the list of JSRs
org.ow2.jasmine.probe.collector.JasmineCollectorException
protected long multiplyLongValues(Collection<Number> values)
throws org.ow2.jasmine.probe.collector.JasmineCollectorException
values -
org.ow2.jasmine.probe.collector.JasmineCollectorException
protected Number multiplyValues(Collection<Number> values)
throws org.ow2.jasmine.probe.collector.JasmineCollectorException
values - to multiply
org.ow2.jasmine.probe.collector.JasmineCollectorException
protected Number multiplyJsr(Collection<org.ow2.jasmine.probe.JasmineSingleResult> jsrs)
throws org.ow2.jasmine.probe.collector.JasmineCollectorException
jsrs - the list of JSRs
org.ow2.jasmine.probe.collector.JasmineCollectorException
protected long longValue(Number nb)
throws org.ow2.jasmine.probe.collector.JasmineCollectorException
nb -
org.ow2.jasmine.probe.collector.JasmineCollectorExceptionprotected HashMap<String,String> jsrProps(Collection<org.ow2.jasmine.probe.JasmineSingleResult> jsrs)
jsrs -
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||