java.lang.Object | |
↳ | org.rrd4j.core.FetchData |
Class used to represent data fetched from the RRD.
Object of this class is created when the method
fetchData()
is
called on a FetchRequest
object.
Data returned from the RRD is, simply, just one big table filled with
timestamps and corresponding datasource values.
Use getRowCount()
method to count the number
of returned timestamps (table rows).
The first table column is filled with timestamps. Time intervals
between consecutive timestamps are guaranteed to be equal. Use
getTimestamps()
method to get an array of
timestamps returned.
Remaining columns are filled with datasource values for the whole timestamp range,
on a column-per-datasource basis. Use getColumnCount()
to find
the number of datasources and getValues(i)
method to obtain
all values for the i-th datasource. Returned datasource values correspond to
the values returned with getTimestamps()
method.
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Dumps the content of the whole FetchData object.
| |||||||||||
Dumps fetch data in XML format.
| |||||||||||
Dumps fetch data to output stream in XML format.
| |||||||||||
Dumps fetch data to file in XML format.
| |||||||||||
Used by ISPs which charge for bandwidth utilization on a "95th percentile" basis.
| |||||||||||
Returns single aggregated value from the fetched data for a single datasource.
| |||||||||||
This method is deprecated.
This method is preserved just for backward compatibility.
| |||||||||||
Returns all aggregated values (MIN, MAX, LAST, FIRST, AVERAGE or TOTAL) calculated from the fetched data
for a single datasource.
| |||||||||||
Returns the timestamp of the last populated slot in the corresponding RRA archive
| |||||||||||
Returns the step of the corresponding RRA archive
| |||||||||||
Returns the number of columns fetched from the corresponding RRD.
| |||||||||||
Retrieve the table index number of a datasource by name.
| |||||||||||
Returns array of datasource names found in the corresponding RRD.
| |||||||||||
Returns the first timestamp in this FetchData object.
| |||||||||||
Returns the last timestamp in this FecthData object.
| |||||||||||
Returns Archive object which is determined to be the best match for the
timestamps specified in the fetch request.
| |||||||||||
Returns
FetchRequest object used to create this FetchData object. | |||||||||||
Returns the number of rows fetched from the corresponding RRD.
| |||||||||||
Same as
get95Percentile(String) , but for a set of values calculated with the given
RPN expression. | |||||||||||
Returns aggregated value for a set of values calculated by applying an RPN expression to the
fetched data.
| |||||||||||
Returns all aggregated values for a set of values calculated by applying an RPN expression to the
fetched data.
| |||||||||||
Returns a set of values created by applying RPN expression to the fetched data.
| |||||||||||
Returns the step with which this data was fetched.
| |||||||||||
Returns an array of timestamps covering the whole range specified in the
FetchReguest object. | |||||||||||
Returns all archived values for a single datasource.
| |||||||||||
Returns all archived values for a single datasource.
| |||||||||||
Returns all archived values for all datasources.
| |||||||||||
Returns string representing fetched data in a RRDTool-like form.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() |
Dumps fetch data in XML format.
IOException | Thrown in case of I/O error |
---|
Dumps fetch data to output stream in XML format.
outputStream | Output stream to dump fetch data to |
---|
IOException | Thrown in case of I/O error |
---|
Dumps fetch data to file in XML format.
filepath | Path to destination file |
---|
IOException | Thrown in case of I/O error |
---|
Used by ISPs which charge for bandwidth utilization on a "95th percentile" basis.
The 95th percentile is the highest source value left when the top 5% of a numerically sorted set of source data is discarded. It is used as a measure of the peak value used when one discounts a fair amount for transitory spikes. This makes it markedly different from the average.
Read more about this topic at:
dsName | Datasource name |
---|
IllegalArgumentException | Thrown if invalid source name is supplied |
---|
Returns single aggregated value from the fetched data for a single datasource.
dsName | Datasource name |
---|---|
consolFun | Consolidation function to be applied to fetched datasource values.
Valid consolidation functions are "MIN", "MAX", "LAST", "FIRST", "AVERAGE" and "TOTAL"
(these string constants are conveniently defined in the ConsolFun class) |
IllegalArgumentException | Thrown if the given datasource name cannot be found in fetched data. |
---|
This method is deprecated.
This method is preserved just for backward compatibility.
Returns aggregated value from the fetched data for a single datasource. Before applying aggregation functions, specified RPN expression is applied to fetched data. For example, if you have a gauge datasource named 'foots' but you want to find the maximum fetched value in meters use something like:
getAggregate("foots", "MAX", "foots,0.3048,*");
dsName | Datasource name |
---|---|
consolFun | Consolidation function (MIN, MAX, LAST, FIRST, AVERAGE or TOTAL) |
rpnExpression | RRDTool-like RPN expression |
IllegalArgumentException | Thrown if the given datasource name cannot be found in fetched data, or if invalid RPN expression is supplied |
---|---|
IOException | Thrown in case of I/O error (unlikely to happen) |
Returns all aggregated values (MIN, MAX, LAST, FIRST, AVERAGE or TOTAL) calculated from the fetched data for a single datasource.
dsName | Datasource name. |
---|
IllegalArgumentException | Thrown if the given datasource name cannot be found in the fetched data. |
---|
Returns the timestamp of the last populated slot in the corresponding RRA archive
Returns the step of the corresponding RRA archive
Returns the number of columns fetched from the corresponding RRD. This number is always equal to the number of datasources defined in the RRD. Each column represents values of a single datasource.
Retrieve the table index number of a datasource by name. Names are case sensitive.
dsName | Name of the datasource for which to find the index. |
---|
Returns array of datasource names found in the corresponding RRD. If the request was filtered (data was fetched only for selected datasources), only datasources selected for fetching are returned.
Returns the first timestamp in this FetchData object.
Returns the last timestamp in this FecthData object.
Returns Archive object which is determined to be the best match for the timestamps specified in the fetch request. All datasource values are obtained from round robin archives belonging to this archive.
Returns FetchRequest
object used to create this FetchData object.
Returns the number of rows fetched from the corresponding RRD. Each row represents datasource values for the specific timestamp.
Same as get95Percentile(String)
, but for a set of values calculated with the given
RPN expression.
rpnExpression | RRDTool-like RPN expression |
---|
IllegalArgumentException | Thrown if invalid RPN expression is supplied |
---|
Returns aggregated value for a set of values calculated by applying an RPN expression to the
fetched data. For example, if you have two datasources named
x
and y
in this FetchData and you want to calculate MAX value of (x+y)/2
use something like:
getRpnAggregate("x,y,+,2,/", "MAX");
rpnExpression | RRDTool-like RPN expression |
---|---|
consolFun | Consolidation function (MIN, MAX, LAST, FIRST, AVERAGE or TOTAL) |
IllegalArgumentException | Thrown if invalid RPN expression is supplied |
---|
Returns all aggregated values for a set of values calculated by applying an RPN expression to the
fetched data. For example, if you have two datasources named
x
and y
in this FetchData and you want to calculate MIN, MAX, LAST, FIRST, AVERAGE and TOTAL value
of (x+y)/2
use something like:
getRpnAggregates("x,y,+,2,/");
rpnExpression | RRDTool-like RPN expression |
---|
IllegalArgumentException | Thrown if invalid RPN expression is supplied |
---|---|
IOException |
Returns a set of values created by applying RPN expression to the fetched data.
For example, if you have two datasources named
x
and y
in this FetchData and you want to calculate values for (x+y)/2
use something like:
getRpnValues("x,y,+,2,/");
rpnExpression | RRDTool-like RPN expression |
---|
IllegalArgumentException | Thrown if invalid RPN expression is supplied |
---|
Returns the step with which this data was fetched.
Returns an array of timestamps covering the whole range specified in the
FetchReguest
object.
Returns all archived values for a single datasource.
Returned values correspond to timestamps
returned with getTimestamps()
method.
dsName | Datasource name. |
---|
Returns all archived values for a single datasource.
Returned values correspond to timestamps
returned with getTimestamps()
method.
dsIndex | Datasource index. |
---|
Returns all archived values for all datasources.
Returned values correspond to timestamps
returned with getTimestamps()
method.
Returns string representing fetched data in a RRDTool-like form.