forked from mirrors/misskey
Improve chart performance (#7360)
* wip * wip * wip * wip * wip * Update chart.ts * wip * Improve server performance * wip * wip
This commit is contained in:
@@ -15,6 +15,17 @@ export default class NetworkChart extends Chart<NetworkLog> {
|
||||
return {};
|
||||
}
|
||||
|
||||
@autobind
|
||||
protected aggregate(logs: NetworkLog[]): NetworkLog {
|
||||
return {
|
||||
incomingRequests: logs.reduce((a, b) => a + b.incomingRequests, 0),
|
||||
outgoingRequests: logs.reduce((a, b) => a + b.outgoingRequests, 0),
|
||||
totalTime: logs.reduce((a, b) => a + b.totalTime, 0),
|
||||
incomingBytes: logs.reduce((a, b) => a + b.incomingBytes, 0),
|
||||
outgoingBytes: logs.reduce((a, b) => a + b.outgoingBytes, 0),
|
||||
};
|
||||
}
|
||||
|
||||
@autobind
|
||||
protected async fetchActual(): Promise<DeepPartial<NetworkLog>> {
|
||||
return {};
|
||||
|
||||
Reference in New Issue
Block a user