# Stats controller (/stats)

This controller contains endpoints to get statistics about system memory and storage.

Endpoints in alphabetical order:

/stats/{statName}
/stats/{statName}/latest

# /{statName}

/stats/{statName} GET
Description
Returns the history of a system statistic. The statistics will be sorted by time. Below is an overview of available statistics. Each statistic has a 64-bit integer value.

Memory statistics

free_memory
The amount of free memory in the Java Virtual Machine. The value is in bytes.
max_memory
The maximum amount of memory that the Java Virtual Machine will attempt to use. The value is in bytes.
total_memory
The total amount of memory in the Java Virtual Machine. The value is in bytes.

Storage statistics

These statistics can have multiple instances at one time, one for each file store. They have an extra field that identifies the file store. For example in Windows this could be the volume name and drive letter. In Linux this could be the mount point and partition.

total_file_store_space
The total size of one file store in bytes.
unallocated_file_store-
_space
The free space in the file store in bytes. Not all space may be available to the Java Virtual Machine (see usable_file_store_space).
usable_file_store-
_space
The free space in the file store that can be used by the Java Virtual Machine. The file store may have more free space that is not usable (see unallocated_file_store_space).
Authorization
Only admins can run this query.
URL parameters
{statName}
The statistic name. See the table above.
start
(optional) Start time of the statistics to return (inclusive). This should be an ISO date/time, preferably formatted like:
2015-09-20T00:00:00.000+02:00
Omit or leave empty to receive statistics from the start.
end
(optional) End time of the statistics to return (exclusive). This should be an ISO date/time, preferably formatted like:
2015-09-21T00:00:00.000+02:00
Omit or leave empty to receive statistics till the end.
Content
Response (application/json)
JSON array with statistics. Each statistic is a JSON object with the following properties:
id
UUID
name
Statistic name
value
Statistic value (64-bit integer)
utcTime
UNIX time in milliseconds
localTime
Local time, formatted like 2015-09-21T00:00:00.000
extra
Extra value. This depends on the statistic. See the table above.
Example
Request
GET https://www.example.com/servlets/senseeact/v6.1.0/stats/free_memory
    ?start=2015-09-20T00:00:00.000+02:00
    &end=2015-09-21T00:00:00.000+02:00
X-Auth-Token: ...
Response
[
    {
        "id": "69a4588f14ba4c989e83dd67ea6e4350",
        "name": "free_memory",
        "value": 1073741824,
        "utcTime": 1442736900000,
        "localTime": "2015-09-20T10:15:00.000",
        "extra": null
    },
    ...
]

# /{statName}/latest

/stats/{statName}/latest} GET
Description
Returns the latest value of a system statistic. The available statistics are described in

/stats/{statName}

.

Note that a statistic may have multiple instances at one time. For example the file store space statistics have one value for each file store. This query still only returns one of them.

Authorization
Only admins can run this query.
URL parameters
{statName}
The statistic name. See

/stats/{statName}

.
Content
Response (application/json)
JSON object with the following property:
value
JSON object for the statistic (see below) or null
The statistic object has the following properties:
id
UUID
name
Statistic name
value
Statistic value (64-bit integer)
utcTime
UNIX time in milliseconds
localTime
Local time, formatted like 2015-09-21T00:00:00.000
extra
Extra value. This depends on the statistic. See

/stats/{statName}

.
Example
Request
GET https://www.example.com/servlets/senseeact/v6.1.0/stats/free_memory/latest
X-Auth-Token: ...
Response
{
    "value": {
        "id": "69a4588f14ba4c989e83dd67ea6e4350",
        "name": "free_memory",
        "value": 1073741824,
        "utcTime": 1442736900000,
        "localTime": "2015-09-20T10:15:00.000",
        "extra": null
    }
}