Time Range Selection

AMPS keeps a history of the monitoring interface statistics, and allows that data to be queried. By selecting a leaf node of the monitoring interface resources, a time-based query can be constructed to view a historical report of the information.

A time-based query is created by appending either one or both of the t0 or t1 query parameters to a url of the admin REST interface.

For example, if an administrator wanted to see the number of messages per second consumed by all processors from midnight UTC on November 30, 2011 until 23:25:00 UTC on November 30, 2011, then pointing a browser to:

http://localhost:8085/amps/instance/processors/all/messages_received_per_sec?t0=20111130T0&t1=20111130T232500

will generate the report and output it in the following plain text format (note: entire dataset is not presented, but is truncated).

20111130T000000.000000Z,0
20111130T000010.000000Z,0
20111130T000020.000000Z,0
20111130T000030.000000Z,94244
20111130T000040.000000Z,304661
20111130T000050.000000Z,301078
20111130T000100.000000Z,308922
20111130T000110.000000Z,306177
20111130T000120.000000Z,302140
20111130T000130.000000Z,302390
20111130T000140.000000Z,307637
20111130T000150.000000Z,310109
20111130T000200.000000Z,309888
20111130T000210.000000Z,299993
20111130T000220.000000Z,310002
20111130T000230.000000Z,300612
20111130T000240.000000Z,299387

All times used for the report generation and presentation are ISO-8601 formatted. ISO-8601 formatting is of the following form: YYYYMMDDThhmmss, where YYYY is the year, MM is the month, DD is the year, T is a separator between the date and time, hh is the hours, mm is the minutes and ss is the seconds. Decimals are permitted after the ss units.

All times used for the report generation and presentation are stored and returned in UTC time.

As discussed in the following sections, the date-time range can be used with plain text (html), comma-separated values (csv), json, and XML formats.

Time Based Query Behavior

All times used for the t0 and t1 parameters must be ISO-8601 formatted. ISO-8601 formatting is of the following form: YYYYMMDDThhmmss, where YYYY is the year, MM is the month, DD is the year, T is a separator between the date and time, hh is the hours, mm is the minutes and ss is the seconds. Decimals are permitted after the ss units.

All times used for the t0 and t1 parameters must be in UTC time. All times in the admin interface are stored and compared in UTC time.

The behavior of time based queries is affected by the combination of the t0 and t1 query parameters. These behaviors are described in the table below:

Query Parameter ValuesBehavior

Only t0 is set

The result set is the list of values recorded from time t0 until the latest recorded admin interval. The range is inclusive.

Only t1 is set

The result set is the list of values recorded from the first admin interval recorded in the stats.db of the AMPS instance until time t1. The range is inclusive.

Both t0 and t1 are set to different timestamp values

The result set is the list of values recorded starting from time t0 until time t1. This range is inclusive.

Both t0 and t1 are set to the same timestamp value

Returns a single value that represents the recorded value of that statistic at the specific admin interval set by t0 and t1.

Important:

Unlike the other time query behaviors, when selecting a single data point by setting t0 and t1 to the same value, that value must be a timestamp that is present in the statistics. Valid timestamps can be obtained via the instance/timestamp admin API endpoint.

Leaf Nodes

A leaf node of the monitoring interface represents a single recorded statistic. Leaf nodes fully support time-range selections using the t0 and t1 parameters as described above.

Examples of leaf node endpoints include:

http://localhost:8085/amps/instance/processors/all/messages_received_per_sec

or

http://localhost:8085/amps/instance/transaction_log/write_latency

Non-Leaf Nodes

A non-leaf node represents an aggregate of related statistics. Non-leaf nodes do not support time-range selections.

Non-leaf nodes support historical queries for a specific valid historical admin interval timestamp. A query for a specific timestamp is achieved by setting the t0 and t1 parameters to the same timestamp value as described above.

Examples of non-leaf node endpoints include:

http://localhost:8085/amps/instance/processors/all

or

http://localhost:8085/amps/instance/transaction_log

Last updated

Copyright 2013-2024 60East Technologies, Inc.