summaryrefslogtreecommitdiff
path: root/src/services/update-chart.ts
diff options
context:
space:
mode:
authorsyuilo <syuilotan@yahoo.co.jp>2018-09-15 05:40:58 +0900
committersyuilo <syuilotan@yahoo.co.jp>2018-09-15 05:40:58 +0900
commitc985fed3e43bae05f9e6e854f651f49f2bc3e83a (patch)
treee85c05f5192bef89b4380653b739db3a38804de2 /src/services/update-chart.ts
parent8.39.0 (diff)
downloadmisskey-c985fed3e43bae05f9e6e854f651f49f2bc3e83a.tar.gz
misskey-c985fed3e43bae05f9e6e854f651f49f2bc3e83a.tar.bz2
misskey-c985fed3e43bae05f9e6e854f651f49f2bc3e83a.zip
Resolve #2328
Diffstat (limited to 'src/services/update-chart.ts')
-rw-r--r--src/services/update-chart.ts22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/services/update-chart.ts b/src/services/update-chart.ts
index 1f8da6be9f..78834ba601 100644
--- a/src/services/update-chart.ts
+++ b/src/services/update-chart.ts
@@ -96,6 +96,12 @@ async function getCurrentStats(span: 'day' | 'hour'): Promise<IStats> {
decCount: 0,
decSize: 0
}
+ },
+ network: {
+ requests: 0,
+ totalTime: 0,
+ incomingBytes: 0,
+ outgoingBytes: 0
}
};
@@ -161,6 +167,12 @@ async function getCurrentStats(span: 'day' | 'hour'): Promise<IStats> {
decCount: 0,
decSize: 0
}
+ },
+ network: {
+ requests: 0,
+ totalTime: 0,
+ incomingBytes: 0,
+ outgoingBytes: 0
}
};
@@ -243,3 +255,13 @@ export async function updateDriveStats(file: IDriveFile, isAdditional: boolean)
await update(inc);
}
+
+export async function updateNetworkStats(requests: number, time: number, incomingBytes: number, outgoingBytes: number) {
+ const inc = {} as any;
+ inc['network.requests'] = requests;
+ inc['network.totalTime'] = time;
+ inc['network.incomingBytes'] = incomingBytes;
+ inc['network.outgoingBytes'] = outgoingBytes;
+
+ await update(inc);
+}