expose uptime to client resources API endpoint (#3705)

resolves #3704
This commit is contained in:
Alex 2021-10-24 20:12:17 +03:00 committed by GitHub
parent 72680fc954
commit ef4410bac6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 0 deletions

View file

@ -28,6 +28,7 @@ class StatsTransformer extends BaseClientTransformer
'disk_bytes' => Arr::get($data, 'utilization.disk_bytes', 0),
'network_rx_bytes' => Arr::get($data, 'utilization.network.rx_bytes', 0),
'network_tx_bytes' => Arr::get($data, 'utilization.network.tx_bytes', 0),
'uptime' => Arr::get($data, 'utilization.uptime', 0),
],
];
}

View file

@ -10,6 +10,7 @@ export interface ServerStats {
diskUsageInBytes: number;
networkRxInBytes: number;
networkTxInBytes: number;
uptime: number;
}
export default (server: string): Promise<ServerStats> => {
@ -23,6 +24,7 @@ export default (server: string): Promise<ServerStats> => {
diskUsageInBytes: attributes.resources.disk_bytes,
networkRxInBytes: attributes.resources.network_rx_bytes,
networkTxInBytes: attributes.resources.network_tx_bytes,
uptime: attributes.resources.uptime,
}))
.catch(reject);
});