metrics: add route to query app metrics with the system
This commit is contained in:
@@ -86,7 +86,15 @@ function create() {
|
||||
async getMetrics(options) {
|
||||
let error, result;
|
||||
try {
|
||||
result = await fetcher.get(`${API_ORIGIN}/api/v1/system/metrics`, { fromSecs: options.fromSecs, intervalSecs: options.intervalSecs, access_token: accessToken });
|
||||
const query = [
|
||||
['fromSecs', options.fromSecs],
|
||||
['intervalSecs', options.intervalSecs],
|
||||
['system', String(!!options.system)],
|
||||
...options.appIds.map(id => ['appId', id]), // multiple appId=xx
|
||||
...options.serviceIds.map(id => ['serviceId', id]), // multiple serviceId=xx
|
||||
['access_token', accessToken]
|
||||
];
|
||||
result = await fetcher.get(`${API_ORIGIN}/api/v1/system/metrics`, query);
|
||||
} catch (e) {
|
||||
error = e;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user