7.2.3 Trend Data Management
- Organization of this subsection
(1) Trend Data Object
- Description
-
A json representing the trend data held by Trend data Management Database.
When the jp1trendDataService.getTrendData method is executed from the product plug-in, the trend data object is returned as the return data object via the trend data management service (Promscale).
For details of jp1TrendDataService.getTrendData method, see 4.5.17 jp1TrendDataService.getTrendData.
- Format
{ "status":"status", "data":{ "resultType":"result-type", "result":[ {"metric":{ "Label-name":"label-value", ... }, "values":[ [time,"value"], ... ] } ] } }- Members
-
Members are listed in the following table.
Table 7‒23: Trend data object members No.
Member
Data type
Description
1
status
string
A string that represents the retrieved result.
If the acquisition is successful, "success" is set.
2
resultType
string
A string that represents the type of data retrieved.
Fixed "matrix" is set.
3
result
array
An array that represents the trend data.
4
metric
array
An array that contains the labels attached to the trend data.
5
label name
string
The name of the label given to the trend data.
6
label value
string
The value of the label given to the trend data.
7
values
array
An array that represents the performance data for each time.
8
time
Numeric
The time of the performance data (the number of seconds elapsed since January 1, 1970 00:00:00 UTC).
9
values
Numeric
The value of the performance data.
- Output example
{ "status":"success", "data":{ "resultType":"matrix", "result":[ {"metric":{ "__name__":"foo", "job":"hoge" }, "values":[ [1617436800,"100"], [1617436830,"100"], [1617436860,"100"], [1617436890,"100"] ] } ] } }
(2) Label Set List Object
- Description
-
A json object that lists the label sets for trend data held by Trend data Management Database.
When you Execute jp1trendDataService.getLabelList method from product plugin, the label set list object is returned as a data object for the return Value through the Trend Data Management Service (Promscale).
For Detail of jp1TrendDataService.getLabelList method, see 4.5.18 jp1TrendDataService.getLabelList.
- Format
{ "status":"Status", "data":[ { "Label name":"Label Value", ... }, { "Label name":"Label Value", ... }, ... ] }Within the above definition, the following part shows a single set of labels.
{ "Label name":"Label Value", ... },- Members
-
Members are listed in the following table.
Table 7‒24: Trend data object members No.
Member
Data type
Description
1
status
string
A character string representing the result of the acquisition.
If the acquisition is successful, "success" is Setup.
2
Label name
string
The name of the label attached to the trend data.
3
Label Value
string
The value of the label attached to the trend data.
- Output example
{ "status" : "success", "data" : [ { "__name__" : "up", "job" : "prometheus", "instance" : "localhost:9090" }, { "__name__" : "up", "job" : "node", "instance" : "localhost:9091" } ] }