getResourceAggregatedMetricTimeSeries()

The function getResourceAggregatedMetricTimeSeries() helps you to extract the aggregated data.

Purpose

getResourceAggregatedMetricTimeSeries() retrieves, through JDBC, data for a set of resources. The function provides the additional options of aggregating the extracted data, you can use one of the aggregation types, and also set the granularity of aggregation, or the time period over which the selected aggregation operation is applied.

getResourceAggregatedMetricTimeSeries (String group, 
				String[] metricTypes, String[] attributeTypes, String granularity,
				Timestamp startTime, Timestamp endTime, 
				String[] Hint)

Parameters

groupString
A resource group name.
metricTypesString[]
Array of metric summaries to be retrieved. Each metric summary is specified as follows:
<statistic>(<metric path>)

Where:

  • <statistic>: can be min, max, sum, count, avg, percentile, or sampleQuality.
  • <metric path>: is the metric, for example, AP~Generic~Universal~Throughput~Inbound Throughput (bps).

The metric type name is either the readable name of the metric or its id. (If id instead of the name is used, it must also be used in the result).

With the aggregation parameter, you can define the operation that is carried out on the data for the period as set by granularity.

The MDE API supports the following aggregation functions for all granularities:

avg
The average of all aggregated values.
min
The minimum of all aggregated values.
max
The maximum of all aggregated values.
sum
The sum of all aggregated values.
count
The number of all aggregated values.

For more information about the possible operations, see Data aggregation.

attributeTypesString[]
The array of attributes to be retrieved. An entry is either the name of the attribute or its id. (If id instead of the name is used, it must also be used in the result)
granularityString
You can express the Granularity as one of the following: 5min, 10min, 15min, 20min, 30min, 1hour, 2hour, 3hour, day, week, month.

For more information about granularity and its constraints, see Data aggregation.

startTimeTimestamp
Beginning of the extraction time window. This date is inclusive.
endTimeTimestamp
End of the extraction time window.
hintString
The sorting order for the result set. The parameter is optional:
ascending(resource)
Query results are given by a primary sort resource in ascending order. The default secondary sort is by time in ascending order.
ascending(time)
Query results are given by a primary sort time in ascending order. The default secondary sort is by resource in ascending order.
descending(resource)
Query results are given by a primary sort resource in descending order. The default secondary sort is by time in descending order.
descending(time)
Query results are given by a primary sort time in descending order. The default secondary sort is by resource in descending order.
includeNearRealTime
Causes any other query hint to be ignored and enforce ascending(time) sorting, which by default means that the secondary sort is by ascending resource.
There are three requirements for the NearRealTime query to work.
  1. The query must retrieve raw data
  2. The query must include the NearRealTime hint.

    For example:<hint>includeNearRealTime</hint>

  3. The current time must be between the start time and the end time. The end time must be at least 2 hours more than the current time.
    For example: If the current time on the Mass Data Extraction client/server is Mon May 07 16:55:33 BRT 2012. Then,
    StartDate: 2012-05-07T16:50:00-0300
    EndDate: 2012-05-07T19:00:00-0300
    Note: Ensure that the Coordinated Universal Time used in the start and end times must be relative to the timezone configured on the Mass Data Extraction client/server.

Example

This example extracts attributes and aggregated metrics.

Note: To ensure that the following command does not run off the page, carriage returns are inserted. A forward slash, “/", identifies where a carriage return is added.
getResourceAggregatedMetricTimeSeries(\"NOC Reporting\", /
[\"min(AP~Generic~Universal~Throughput~Inbound Throughput (bps))\",/
\"max(AP~Generic~Universal~Throughput~Inbound Throughput (bps))\",/
\"avg(AP~Generic~Universal~Throughput~Inbound Throughput (bps))/
\",\"sum(AP~Generic~Universal~Throughput~Inbound Throughput (bps))\",/
\"count(AP~Generic~Universal~Throughput~Inbound Throughput (bps))\",/
\"sampleQuality(AP~Generic~Universal~Throughput~Inbound Throughput (bps))\",/
\"percentile(AP~Generic~Universal~Throughput~Inbound Throughput (bps))\"],/
 [\"AP_ifSpeed\",\"AP_ifStatus\",\"AP_ifType\"], \"day\", /
2009-12-15 00:00:00.0-0000, 2009-12-16 00:00:00.0-0000, [\"\"])

The example extracts the following and from the NOC Reporting group the following attributes and metrics are requested:

  • The min(AP~Generic~Universal~Throughput~Inbound Throughput (bps)) metric. This metric is wrapped with the min statistical wrapper. The output is an element that contains the minimum result for this metric over the period as set in the granularity element.
  • The max(AP~Generic~Universal~Throughput~Inbound Throughput (bps)) metric. This metric is wrapped with the max statistical wrapper. The output is an element that contains the maximum result for this metric over the period as set in the granularity element.
  • The avg(AP~Generic~Universal~Throughput~Inbound Throughput (bps)) metric. This metric is wrapped with the avg statistical wrapper. The output is an element that contains the average result for this metric over the period as set in the granularity element.
  • The sum(AP~Generic~Universal~Throughput~Inbound Throughput (bps)) metric. This metric is wrapped with the sum statistical wrapper. The output is an element that contains the sum of all results for this metric over the period as set in the granularity element.
  • The count(AP~Generic~Universal~Throughput~Inbound Throughput (bps)) metric. This metric is wrapped with the count statistical wrapper. The output is an element that contains the total number of occurrences of this metric over the period as set in the granularity element.
  • The sampleQuality(AP~Generic~Universal~Throughput~Inbound Throughput (bps)) metric. This metric is wrapped with the sampleQuality statistical wrapper. The output is an element that contains count expressed as a percentage of the number of expected occurrences of this metric. This aggregation type can be used only if the granularity, or period of aggregation, is greater than one day.
  • The percentile(AP~Generic~Universal~Throughput~Inbound Throughput (bps)) metric. This metric is wrapped with the percentile statistical wrapper. This metric can be used only if the granularity, or period of aggregation, is greater than one day.
  • The AP_ifSpeed attribute.
  • The AP_ifStatus attribute.
  • The AP_ifType attribute.
  • The queryidentifier, ResourcesNocReporting is used in the naming of the output file.
Note: This example corresponds to the command-line example Time Series: Aggregated