How can we help?

Statistics - Service API

Follow

The Auvik Statistics API allows you to view service statistics recorded by Auvik.

For details on a specific endpoint or cURL example, click the endpoint name listed below. API documentation opens in a new window.

Before using the Statistics API, please read the section Timestamps.

There’s one service endpoint in the Statistics API:

Read service statistics pulls detailed statistics of services in a site (and children if it’s a multi-site). This includes round trip time, packets transmitted, and packets received from cloud ping checks. The statistic, the statistic ID, and the list of data points included in each statistic are listed in the table below.

Statistic

Stat ID

Data Point

Internet Connection Check (Round Trip Time)

pingTime

  • time (unix minutes)
  • maximum (milliseconds)
  • minimum (milliseconds)
  • average (milliseconds)

Internet Connection Check (Packet Loss)

pingPacket

  • time (unix minutes)
  • transmitted (packets)
  • received (packets)

 

An entry is returned for each service. The service ID and tenant ID are in the relationships field.

Timestamps

In all the descriptions above, time is the unix timestamp in minutes representing when the data point is recorded. This occurs at the end of the interval. 

For example, if the interval is set to hourly, then the data point is recorded at the beginning of the next hour. The data point that represents the statistic for the time interval from 1:00 p.m. to 2:00 p.m. is recorded at 2:00 p.m. There are three things to take note of here and we’ll illustrate using an hourly interval.

To capture all data points for 1 day, you need to set the filters to filter[fromTime] to 12 a.m. the current day and filter[thruTime] to 12 a.m. the next day. 

https://auvikapi.us2.my.auvik.com/v1/stat/device/bandwidth?filter[fromTime]=2020-09-01T00:00:00.000Z&filter[thruTime]=2020-09-02T00:00:00.000Z&filter[interval]="hour"&filter[deviceId]=NzkyMzyzMjAwOZMwNTc4MDUzMjg2LAg&tenants=123456789012345678&page[first]=50

The API response will include an attributes object with a description of the statistics and the data points:

"attributes": {

"reportPeriod": {

     "fromTime": "2020-09-01T00:00:00.000Z",

     "thruTime": "2020-09-02T00:00:00.000Z"

},

"interval": "hour",

"statType": "deviceBandwidth",

"stats": [

     {

         "legend": [

             "Recorded At",

             "Transmit",

             "Receive",

             "Bandwidth"

         ],

         "unit": [

             "unix_mins",

             "bits_per_sec",

             "bits_per_sec",

             "bits_per_sec"

         ],

         "data": [

             [

                 26648700,

                 429220,

                 459335,

                 888555

             ],

             [

                 26648760,

                 333506,

                 356849,

                 690355

             ],

             [

                 26648820,

                 415272,

                 446054,

                 861326

             ],

             [

                 26648880,

                 410369,

                 441050,

                 851419

             ],

             [

                 26648940,

                 414771,

                 446854,

                 861625

             ],

             [

                 26649000,

                 409957,

                 440509,

                 850466

             ],

             [

                 26649060,

                 414546,

                 445989,

                 860535

             ],

             [

                 26649120,

                 300272,

                 322354,

                 622626

             ],

             [

                 26649180,

                 406035,

                 436273,

                 842308

             ],

             [

                 26649240,

                 414772,

                 445498,

                 860270

             ],

             [

                 26649300,

                 412679,

                 443176,

                 855855

             ],

             [

                 26649360,

                 428046,

                 458037,

                 886083

             ],

             [

                 26649420,

                 436317,

                 467159,

                 903476

             ],

             [

                 26649480,

                 428178,

                 458719,

                 886897

             ],

             [

                 26649540,

                 433840,

                 464663,

                 898503

             ],

             [

                 26649600,

                 441621,

                 472646,

                 914267

             ],

             [

                 26649660,

                 438784,

                 468843,

                 907627

             ],

             [

                 26649720,

                 437182,

                 468212,

                 905393

             ],

             [

                 26649780,

                 431165,

                 463129,

                 894294

             ],

             [

                 26649840,

                 440732,

                 471962,

                 912694

             ],

             [

                 26649900,

                 433472,

                 463853,

                 897325

             ],

             [

                 26649960,

                 434610,

                 471183,

                 905794

             ],

             [

                 26650020,

                 433357,

                 463528,

                 896885

             ],

             [

                 26650080,

                 443499,

                 475056,

                 918555

             ]

         ]

     }

]

}

The first data point has the recorded-at time of 26648700 in unix minutes, which is 1598922000 in seconds. This is 1:00 a.m. UTC on September 1, 2020, and the following data represents the statistic for the time interval from 12:00 a.m. UTC to 1:00 a.m. on September 1, 2020. 

The last data point has the recorded-at time of 26650080 in unix minutes, which is 1599004800 in seconds. This is 12:00 a.m. UTC on September 2, 2020 and the following data represents the statistic for the time interval from 11:00 p.m. UTC to 12:00 a.m. on September 2, 2020.

Limits

Maximum page size

For the statistics API, the maximum page size, page[first] and page[last], is 100.

Maximum time range

For the statistics API, the following maximum time ranges, the difference of filter[fromTime] from filter[thruTime], for each statistic interval, filter[interval] are as follows:

Interval

Maximum time range

minute

1 day

hour

31 days

day

1 year

 

If you want to capture a time range greater than the maximum time range, then the desired time range needs to be broken down into multiple smaller time ranges that adhere to the maximums listed above. When specifying the time range, take note of how the filters work as described in Timestamps.

Was this article helpful?
1 out of 1 found this helpful
Have more questions? Submit a request