com.tc.statistics
Class StatisticData
java.lang.Object
com.tc.statistics.StatisticData
- All Implemented Interfaces:
- java.io.Serializable
public class StatisticData
- extends java.lang.Object
- implements java.io.Serializable
This class structures the data that is retrieved through a StatisticRetrievalAction
. New instances are
usually filled in through the specialized constructors. The agentIp
and agentDifferentiator
properties don't have to be filled in. When an instance of StatisticData
is stored in the StatisticsBuffer
of the CVT agent, these properties are set when they are null
. This should be the desired
behavior is almost all of the cases. Also, the moment
property will be filled in by the StatisticsRetriever
to ensure that all the data in one retrieval action can be correlated. Only four types of data
can be stored within a StatisticData
instance and they are mutually exclusive. The reason why it doesn't
allow any Object
to be used as data is to allow for the CVT back-end to store the data while preserving its
type. This makes is easier to query on the data values after collection. The name
of a StatisticData
instance should identify the type of data that it contains, for instance "cpu combined
". The element
property can be null
, but when it's used it should identify different elements of the same data. For instance
when CPU data is collected for multiple CPUs, the names are the same, but the elements will be "cpu 1
", "
cpu 2
", ... so that it's possible to identify the individual data points. Finally, when
StatisticRetrievalAction
s return an array of StatisticData
instances, the moment
property of
each individual data instance should be the same so that the entire array can be situated at the same location on a
timeline. Usually this is done by creating a Date
instance before instantiating the StatisticData
instances and passing that Date
instance to the constructor of each data element.
- See Also:
- Serialized Form
Constructor Summary |
StatisticData()
|
StatisticData(java.lang.String name,
java.math.BigDecimal value)
|
StatisticData(java.lang.String name,
java.util.Date value)
|
StatisticData(java.lang.String name,
java.lang.Long value)
|
StatisticData(java.lang.String name,
java.lang.String value)
|
StatisticData(java.lang.String name,
java.lang.String element,
java.math.BigDecimal value)
|
StatisticData(java.lang.String name,
java.lang.String element,
java.util.Date value)
|
StatisticData(java.lang.String name,
java.lang.String element,
java.lang.Long value)
|
StatisticData(java.lang.String name,
java.lang.String element,
java.lang.String value)
|
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
EMPTY_ARRAY
public static final StatisticData[] EMPTY_ARRAY
StatisticData
public StatisticData()
StatisticData
public StatisticData(java.lang.String name,
java.lang.Long value)
StatisticData
public StatisticData(java.lang.String name,
java.lang.String value)
StatisticData
public StatisticData(java.lang.String name,
java.util.Date value)
StatisticData
public StatisticData(java.lang.String name,
java.math.BigDecimal value)
StatisticData
public StatisticData(java.lang.String name,
java.lang.String element,
java.lang.Long value)
StatisticData
public StatisticData(java.lang.String name,
java.lang.String element,
java.lang.String value)
StatisticData
public StatisticData(java.lang.String name,
java.lang.String element,
java.util.Date value)
StatisticData
public StatisticData(java.lang.String name,
java.lang.String element,
java.math.BigDecimal value)
getSessionId
public java.lang.String getSessionId()
setSessionId
public void setSessionId(java.lang.String sessionId)
sessionId
public StatisticData sessionId(java.lang.String sessionID)
getAgentIp
public java.lang.String getAgentIp()
setAgentIp
public void setAgentIp(java.lang.String agentIp)
agentIp
public StatisticData agentIp(java.lang.String agentIP)
getAgentDifferentiator
public java.lang.String getAgentDifferentiator()
agentDifferentiator
public StatisticData agentDifferentiator(java.lang.String agentDiff)
setAgentDifferentiator
public void setAgentDifferentiator(java.lang.String agentDifferentiator)
setMoment
public void setMoment(java.util.Date moment)
moment
public StatisticData moment(java.util.Date date)
getMoment
public java.util.Date getMoment()
getName
public java.lang.String getName()
setName
public void setName(java.lang.String name)
name
public StatisticData name(java.lang.String nameArg)
getElement
public java.lang.String getElement()
setElement
public void setElement(java.lang.String element)
element
public StatisticData element(java.lang.String elementArg)
getData
public java.lang.Object getData()
setData
public void setData(java.lang.Long data)
data
public StatisticData data(java.lang.Long longData)
setData
public void setData(java.lang.String data)
data
public StatisticData data(java.lang.String strData)
setData
public void setData(java.util.Date data)
data
public StatisticData data(java.util.Date dateData)
setData
public void setData(java.math.BigDecimal data)
data
public StatisticData data(java.math.BigDecimal bigDecimalData)
clone
public java.lang.Object clone()
- Overrides:
clone
in class java.lang.Object
toString
public java.lang.String toString()
- Overrides:
toString
in class java.lang.Object
toLog
public java.lang.String toLog()
escapeForCsv
public static java.lang.String escapeForCsv(java.lang.String value)
toCsv
public java.lang.String toCsv()
- Converts this data instance to a single line of CSV text, terminated by a new line character. All fields are
separated by commas and are delimited by double quotes. Double quotes, back slashes, and new lines are escaped by a
back slash. Carriage returns are stripped away.
- Returns:
- the CSV text of this data instance
toXml
public java.lang.String toXml()
- Converts this data instance to an XML representation. This only outputs the values of the fields as XML tags,
there's no surrounding <statistic> tag.
- Returns:
- the XML representation of this data
Copyright © 2010 Terracotta, Inc.. All Rights Reserved.