Granularity

Granularity specifies the periods into which you want the larger time period, specified by the start and end dates, subdivided.

The following are the granularity periods that can be specified:

  • HOUR
  • DAY
  • WEEK
  • MONTH
  • YEAR

Granularity is passed in requests in the <duration > / <granularity element. For example:

Request:
...
<duration>
   <endDate>2011-08-30T00:00:00.000Z</endDate>
   <startDate>2011-08-27T00:00:00.000Z</startDate>
   <granularity>DAY</granularity>
</duration>
...

This example is specifying start and end dates that encompass three days, with a granularity of one day. This causes the response to include statistical data in three, one-day periods.

For each granularity period, a <period element is returned, which contains the event measures data (in the <entry elements) for that particular time period:

Response:
...
<measure xmlns="">
   <index>0</index>
   <id xmlns:api="http://api.ec.n2.tibco.com" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
      <processTemplateName>CSCallbackProcess</processTemplateName>
   </id>
   <period
      <index>0</index>
      <duration>
         <startDate>2011-08-27T00:00:00.000Z</startDate>
      </duration>
      <entry>
         <index>0</index>
         <value>19</value>
         <type>STARTED</type>
      </entry>
      ...
   </period
...

In this example, three <period elements are returned, each contained the event measures data for one day.

Also note that when the granularity period is specified as DAY, it means 24 hours, starting at the beginning of the hour block according to the start date (as described above), to the next day at the same time (that is, it is not from the beginning of the day to the end of the day).

For example, if the startDate is 2011-08-27T07:00:00.000Z, a granularity of DAY means the granularity period is from 7:00 on Aug. 27 to 7:00 on Aug. 28.