Analytics datasets use the following properties. All properties except for suspended are immutable.
|
Available datasets:
arc.accesses[hit/miss]
arc.l2_accesses[hit/miss]
arc.l2_size
arc.size
arc.size[component]
cpu.utilization
cpu.utilization[mode]
dnlc.accesses[hit/miss]
fc.bytes
fc.ops
ftp.kilobytes
http.reqs
io.bytes
io.bytes[op]
io.disks[utilization=95][disk]
io.ops
io.ops[disk]
io.ops[op]
iscsi.bytes
iscsi.ops
metacap.bytesused
metacap.percentused
ndmp.diskkb
nfs2.ops
nfs2.ops[op]
nfs3.ops
nfs3.ops[op]
nfs4.ops
nfs4.ops[op]
nfs4-1.ops
nfs4-1.bytes
nic.kilobytes
nic.kilobytes[device]
nic.kilobytes[direction]
sftp.kilobytes
smb.ops
smb.ops[op]
Lists all configured analytic datasets.
Example Request:
GET /api/analytics/v1/datasets HTTP/1.1 Authorization: Basic ab6rt4psMWE= Host: zfs-storage.example.com:215 Accept: application/json
Example Results:
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 237
X-Zfssa-Analytics-Api: 1.0
{
"datasets": [{
"dataset": "dataset-000",
"href": "/api/analytics/v1/datasets/arc.accesses[hit/miss]",
"name": "arc.accesses[hit/miss]"
}, {
"dataset": "dataset-001",
"href": "/api/analytics/v1/datasets/arc.l2_accesses[hit/miss]",
"name": "arc.l2_accesses[hit/miss]",
}, {
"dataset": "dataset-002",
"href": "/api/analytics/v1/datasets/arc.l2_size",
"name": "arc.l2_size",
}, {
"dataset": "dataset-003",
"href": "/api/analytics/v1/datasets/arc.size",
"name": "arc.size",
}, {
"dataset": "dataset-004",
"href": "/api/analytics/v1/datasets/arc.size[component]",
"name": "arc.size[component]",
}, {
...
}]
}
Gets properties from the specified dataset.
Example Request:
GET /api/analytics/v1/datasets/nfs4.ops HTTP/1.1 Authorization: Basic ab6rt4psMWE= Host: zfs-storage.example.com:215 Accept: application/json
Example Results:
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 237
X-Zfssa-Analytics-Api: 1.0
{
"dataset": {
"activity": "none",
"dataset": "dataset-030",
"explanation": "NFSv4 operations per second",
"grouping": "Protocol",
"href": "/api/analytics/v1/datasets/nfs4.ops",
"incore": 296128,
"name": "nfs4.ops",
"size": 53211540,
"suspended": false
}
}
Creates a new dataset.
Example Request:
POST /api/analytics/v1/datasets HTTP/1.1
X-Auth-User: root
X-Auth-Key: password
Content-Type: application/json
Content-Length: 26
{"statistic": "test.sine"}
Example Results:
HTTP/1.1 201 Created
Content-Type: application/json
Content-Length: 200
Location: /api/analytics/v1/datasets/test.sine
{
"dataset":{
"href": "/api/analytics/v1/datasets",
"name": "test.sine",
"grouping": "Test",
"explanation": "sine per second",
"incore": 34752,
"size": 31912,
"suspended": false,
"activity": "none"
}
}
The modify dataset command is used to suspend or resume data collection of a single dataset.
Example Suspend Request:
POST /api/analytics/v1/datasets/nfs4.ops
{"suspended":true}
Example Resume Request:
POST /api/analytics/v1/datasets/nfs4.ops
{"suspended":false}
Example Response:
HTTP/1.1 202 Accepted
Content-Type: application/json
Content-Length: 228
X-Zfssa-Analytics-Api: 1.0
{
"dataset" {
...
"suspended": false
}
}
Destroys a dataset.
Example Request:
DELETE /api/analytics/v1/datasets/test.sine HTTP/1.1
Example Response:
HTTP/1.1 204 No Content X-Zfssa-Analytics-Api: 1.0
Saves a dataset.
Example Request:
PUT /api/analytics/v1/datasets/nfs4.ops/data
Example Response:
HTTP/1.1 202 Accepted
The following table shows query parameters that are used in pruning datasets.
|
Example Request:
DELETE /api/analytics/v1/datasets/nfs4.ops/data?granularity=hour
Example Response:
HTTP/1.1 204 No Content
Gets data from an analytic dataset. Both per-second and granular data retrieval are supported.
The following table shows time-based query parameters for getting dataset data.
|
If the start parameter is not supplied, the start time is set to the current time minus the number of seconds of sample data specified. The start time cannot be in the future. If the number of seconds to collect data goes beyond the current time, the server waits for each sample before returning the data.
To retrieve granular data, use a combination of parameters span and granularity. When span and granularity are used, the seconds parameter is ignored. If either span or granularity is entered incorrectly, the request is ignored and the seconds parameter is used instead. An incorrect or unsupported request displays the error message "Input span and granularity are not supported."
The following list describes how the span and granularity parameters can be combined:
If span is minute, granularity can only be minute.
If span is hour, granularity can be minute or hour.
If span is day, granularity can be minute, hour, or day.
If span is week, granularity can be hour, day, or week.
If span is month, granularity can be day, week, or month.
If span is year, granularity can be week, month, or year.
The following table shows the dataset data properties that are returned.
|
The startTime property can be in one of the following formats:
An ISO 8601 time/date string (for example, 20130531T01:13:58)
Sample index number
The string literal now
Example request to collect three seconds of live data:
GET /api/analytics/v1/datasets/nfs4.ops%5Bfile%5D/data?start=now&seconds=3 HTTP/1.1 Authorization: Basic ab6rt4psMWE= Host: zfs-storage.example.com:215 Accept: text/x-yaml
Example Results:
HTTP/1.1 200 OK
Content-Type: text/x-yaml
X-Zfssa-Analytics-Api: 1.0
Transfer-Encoding: chunked
---
data:
- sample: 239024557
data:
value: 5
startTime: 20130912T21:42:38
samples: 239024558
- sample: 239024558
data:
value: 15
startTime: 20130912T21:42:39
samples: 239024559
- sample: 239024559
data:
value: 25
startTime: 20130912T21:42:40
samples: 239024560
size: 3
---
Example request to collect seven days of live data within the span of one week:
GET /api/analytics/v1/datasets/nfs4.ops%5Bfile%5D/data?start=239024557&span=week&granularity=day
HTTP/1.1
Authorization: Basic ab6rt4psMWE=
Host: zfs-storage.example.com:215
Accept: text/x-yaml
Example Results:
HTTP/1.1 200 OK
Content-Type: text/x-yaml
X-Zfssa-Analytics-Api: 1.0
Transfer-Encoding: chunked
---
data:
- sample: 239024557
data:
value: 5
max: 79
min: 0
startTime: 20130912T21:42:38
samples: 240074328
- sample: 239110957
data:
value: 15
max: 150
min: 1
startTime: 20130913T21:42:38
samples: 240074328
...
- sample: 239629357
data:
value: 25
max: 120
min: 2
startTime: 20130914T21:42:38
samples: 240074328
size: 7