Why do Webservice calls such as getMetricData and getLiveMetricData not return a data point for each 15 second time period when querying data for an EP Agent?

Document ID : KB000045315
Last Modified Date : 14/02/2018
Show Technical Document Details

Introduction:

     The Introscope Webservice API provides a framework for polling metrics, metric data, and alert data outside of Introscope UIs.

 

Question:

     Why do Webservice calls such as getMetricData and getLiveMetricData not return a data point for each 15 second time period when querying data for an EPAgent?

 

Environment:

     Occurs in APM version 10.0 and higher.

 

Answer:

     This behavior occurrs due to a design change in APM 10.0 and higher versions. Prior to APM 10.0, a defect was discovered with the Web Service API in which any average based metrics (Average Response Time, etc) returned inconsistent averages for the getMetricData and getLiveMetricData calls. To address this issue, Product Management decided to change the Webservice API so that only metric values reported by the API are those directly reported by the agent. This means, in cases such as the EPAgent where new data points are only received once every X minutes where X is the frequency the plugin runs on the EPAgent, by design we would only expect a single data point every time the plugin runs.

To illustrate this behavior, consider an EP Agent in which the agent plugins run every 5 minutes. Below is a sample getMetricData query against this EP Agent...

<soapenv:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:met="http://metricsdata.webservicesimpl.server.introscope.wily.com">
   <soapenv:Header/>
   <soapenv:Body>
      <met:getMetricData soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
         <agentRegex xsi:type="xsd:string">(.*)EPAgentTest</agentRegex>
         <metricRegex xsi:type="xsd:string">Disk\|_Total:Free Megabytes</metricRegex>
         <startTime xsi:type="xsd:dateTime">2016-07-21T09:50:00-05:00</startTime>
         <endTime xsi:type="xsd:dateTime">2016-07-21T09:55:00-05:00</endTime>
         <dataFrequency xsi:type="xsd:int">15</dataFrequency>
      </met:getMetricData>
   </soapenv:Body>
</soapenv:Envelope>

The request above should return all datapoints for the Free Megabytes metric from the EPAgentTest agent. Since this EP Agent runs on a 5 minute interval, we would expect a new metric value to have occurred once during this interval. (Due to EP Agent design, this one value is repeated when viewed in the Introscope Investigator). Below is sample result....

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
   <soapenv:Body>
      <ns1:getMetricDataResponse soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns1="http://metricsdata.webservicesimpl.server.introscope.wily.com">
         <getMetricDataReturn soapenc:arrayType="ns2:TimesliceGroupedMetricData[4]" xsi:type="soapenc:Array" xmlns:ns2="urn:ca.wily.introscope.webservices" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">
            <getMetricDataReturn href="#id0"/>
            <getMetricDataReturn href="#id1"/>
            <getMetricDataReturn href="#id2"/>
            <getMetricDataReturn href="#id3"/>
   ..... (One id for every 15 seconds of data)
   <getMetricDataReturn href="#id19"/>
         </getMetricDataReturn>
      </ns1:getMetricDataResponse>
  
Below follows the data returned. Most data points (19/20) will return no data as no new data points were returned by the EP Agent at this time. "id0" is shown with other results omitted for this example. "id20" is the generated data point created by the EP Agent and returned by the Webservice API. 

  <multiRef id="id0" soapenc:root="0" soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xsi:type="ns6:TimesliceGroupedMetricData" xmlns:ns6="urn:ca.wily.introscope.webservices" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">
         <metricData soapenc:arrayType="ns6:MetricData[1]" xsi:type="soapenc:Array">
            <metricData xsi:type="ns6:MetricData" xsi:nil="true"/>
         </metricData>
         <timesliceEndTime xsi:type="xsd:dateTime">2016-07-21T14:50:00.000Z</timesliceEndTime>
         <timesliceStartTime xsi:type="xsd:dateTime">2016-07-21T14:50:15.000Z</timesliceStartTime>
      </multiRef>
      <multiRef id="id20" soapenc:root="0" soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xsi:type="ns7:MetricData" xmlns:ns7="urn:ca.wily.introscope.webservices" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">
         <agentName xsi:type="xsd:string"><HostName>|<ProcessName>|EPAgentTest</agentName>
         <metricName xsi:type="xsd:string"><Metric Path>Total:Free Megabytes.value</metricName>
         <metricType xsi:type="xsd:int">257</metricType>
         <metricValue xsi:type="xsd:string">21171</metricValue>
      </multiRef>
   </soapenv:Body>
</soapenv:Envelope>


Additional Information:
    For more information on the Introscope Webservices API, please see: https://docops.ca.com/ca-apm/10/en/integrating/api-reference-guide/ca-introscope-web-services-api-reference .As always, please contact CA Technologies Support if you have further questions.