Use the monitoring indicator interface to query node status metrics, query request metrics, and transactions per second (TPS) latency for a specified time range.
queryNodeMetricsStatus
Queries the transactions sent by a specific account within a time range.
Signature
public MychainBaseResult<ReplyNodeMetricsStatus> queryNodeMetricsStatus(long startTime, long endTime)Parameters
| Parameter | Required | Type | Description |
|---|---|---|---|
startTime | Yes | long | The timestamp of the start time. |
endTime | Yes | long | The timestamp of the end time. |
Example
long startTime = stringToTimeStamp("2018-10-30 01:00:00");
long currentTime = System.currentTimeMillis();
MychainBaseResult<ReplyNodeMetricsStatus> result = sdk.getQueryService().queryNodeMetricsStatus(startTime, endTime);queryMetricsMessage
Queries the metrics of query requests for a specified time range and node.
Signature
public MychainBaseResult<ReplyQueryMetricMessage> queryMetricsMessage(long startTime, long endTime, Identity identity)Parameters
| Parameter | Required | Type | Description |
|---|---|---|---|
startTime | Yes | long | The timestamp of the start time. |
endTime | Yes | long | The timestamp of the end time. |
identity | No | Identity | The ID of the node. |
Example
long startTime = stringToTimeStamp("2018-10-30 01:00:00");
long currentTime = System.currentTimeMillis();
MychainBaseResult<ReplyQueryMetricMessage> result = sdk.getQueryService().queryMetricsMessage(startTime, endTime, new Identity());queryTpsLatency
Queries the transactions per second (TPS) metrics for a specified time range and node.
Signature
public MychainBaseResult<ReplyTpsLatencyMessage> queryTpsLatency(Identity identity, long startTime, long endTime)Parameters
| Parameter | Required | Type | Description |
|---|---|---|---|
startTime | Yes | long | The timestamp of the start time. |
endTime | Yes | long | The timestamp of the end time. |
identity | No | Identity | The ID of the node. |
Example
long startTime = stringToTimeStamp("2018-10-30 01:00:00");
long currentTime = System.currentTimeMillis();
MychainBaseResult<ReplyTpsLatencyMessage> result = sdk.getQueryService().queryTpsLatency(new Identity(), startTime, endTime);