public abstract class Probe<KeyType,ValueType> extends StarterNode implements Comparable<Probe<KeyType,ValueType>>
ProbeDesc and
can overid some method as needed| Constructor and Description |
|---|
Probe()
A special case constructor, mainly used by virtual probe
|
Probe(ProbeDesc pd)
A special case constructor, mainly used by virtual probe
|
| Modifier and Type | Method and Description |
|---|---|
void |
addGraph(GraphDesc gd) |
void |
addGraph(GraphNode node) |
boolean |
checkStore()
Check the final status of the probe.
|
protected boolean |
checkStoreFile() |
void |
collect()
Launch an collect of values.
|
int |
compareTo(Probe<KeyType,ValueType> arg0)
The comparaison order of two object of the class is a case insensitive
comparaison of it's string value.
|
protected void |
create()
Create the probe file
|
boolean |
dsExist(String dsName) |
Document |
dumpAsXml() |
Document |
dumpAsXml(boolean sorted) |
FetchData |
fetchData(ConsolFun consolFun,
long fetchStart,
long fetchEnd,
long resolution)
Return the probe data for the given period
|
FetchData |
fetchData(Date startDate,
Date endDate)
Return the probe data for the given period
|
FetchData |
fetchData(long fetchStart,
long fetchEnd)
Return the probe data for the given period
|
Map<KeyType,Number> |
filterValues(Map<KeyType,ValueType> valuesList)
This method convert the collected object to numbers and can do post treatment
|
Map<KeyType,String> |
getCollectMapping() |
protected DsDef[] |
getDsDefs() |
Collection<GraphNode> |
getGraphList() |
HostInfo |
getHost() |
String |
getLabel() |
Date |
getLastUpdate()
Return the date of the last update of the rrd backend
|
Map<String,Number> |
getLastValues() |
String |
getName() |
Logger |
getNamedLogger() |
abstract Map<KeyType,ValueType> |
getNewSampleValues()
The method that return a map of data collected.
It should return return as raw as possible, they can even be opaque data tied to the probe. |
ProbeDesc |
getPd() |
String |
getQualifiedName()
Return a unique name for the graph
|
RrdDef |
getRrdDef() |
String |
getRrdName() |
abstract String |
getSourceType() |
Set<String> |
getTags() |
long |
getUptime()
This function should return the uptime of the probe
If it's not overriden or fixed with setUptime, it will return Long.MAX_VALUE
that's make it useless, as it used to make the probe pause
after a restart of the probe.
|
int |
hashCode() |
void |
log(Level l,
String format,
Object... elements) |
void |
log(Level l,
Throwable e,
String format,
Object... elements) |
void |
modifySample(Sample oneSample,
Map<KeyType,ValueType> values)
The sample itself can be modified
|
void |
readProperties(PropertiesManager pm)
A probe can override it to extract custom values from the properties.
|
boolean |
readSpecific()
This function it used by the probe to read all the specific it needs from the probe description
It's called once during the probe initialization
Every override should finish by:
return super();
|
void |
setHost(HostStarter monitoredHost) |
void |
setLabel(String label) |
void |
setName(String name) |
void |
setPd(ProbeDesc pd) |
void |
setUptime(long uptime)
Define the uptime of the probe
|
String |
toString()
Return the string value of the probe as a path constitued of
the host name / the probe name
|
configureStarters, find, find, find, find, find, getHostList, getLevel, getParent, getStarters, getStep, getTimeout, isCollectRunning, isStarted, registerStarter, registerStarter, setParent, setParent, setStep, setTimeout, startCollect, stopCollectpublic Probe(ProbeDesc pd)
monitoredHost - pd - public Probe()
monitoredHost - pd - public HostInfo getHost()
public void setHost(HostStarter monitoredHost)
public void setPd(ProbeDesc pd)
public void addGraph(GraphDesc gd)
public void addGraph(GraphNode node)
public Collection<GraphNode> getGraphList()
public String getName()
public void setName(String name)
public String getRrdName()
protected DsDef[] getDsDefs()
public RrdDef getRrdDef()
protected void create()
throws IOException
IOExceptionpublic boolean checkStore()
IOExceptionRrdExceptionprotected boolean checkStoreFile()
public abstract Map<KeyType,ValueType> getNewSampleValues()
ProbeDesc. A key not associated with an existent datastore will generate a warning
but will not prevent the other values to be stored.public Map<KeyType,Number> filterValues(Map<KeyType,ValueType> valuesList)
valuesList - public void modifySample(Sample oneSample, Map<KeyType,ValueType> values)
oneSample - values - public void collect()
public String toString()
toString in class ObjectObject.toString()public int compareTo(Probe<KeyType,ValueType> arg0)
compareTo in interface Comparable<Probe<KeyType,ValueType>>arg0 - Objectpublic ProbeDesc getPd()
ProbeDesc of the probe.public Date getLastUpdate()
public boolean dsExist(String dsName)
public FetchData fetchData(Date startDate, Date endDate)
startDate - endDate - public FetchData fetchData(long fetchStart, long fetchEnd)
fetchStart - Starting timestamp for fetch request.fetchEnd - Ending timestamp for fetch request.public FetchData fetchData(ConsolFun consolFun, long fetchStart, long fetchEnd, long resolution)
consolFun - Consolidation function to be used in fetch request. Allowed values are
"AVERAGE", "MIN", "MAX" and "LAST" (these constants are conveniently defined in the
ConsolFun class).fetchStart - Starting timestamp for fetch request.fetchEnd - Ending timestamp for fetch request.resolution - Fetch resolution.public String getQualifiedName()
public abstract String getSourceType()
public boolean readSpecific()
public void readProperties(PropertiesManager pm)
pm - public long getUptime()
public void setUptime(long uptime)
uptime - in secondspublic Document dumpAsXml() throws ParserConfigurationException, IOException
public Document dumpAsXml(boolean sorted) throws ParserConfigurationException, IOException
public String getLabel()
public void setLabel(String label)
public void log(Level l, Throwable e, String format, Object... elements)
log in class StarterNodepublic void log(Level l, String format, Object... elements)
log in class StarterNodepublic Logger getNamedLogger()