mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-18 15:33:12 +09:00
Add startedAtMs to all processes
This commit is contained in:
12 files changed
+118
-9
No files matched your search
@@ -96,6 +96,7 @@ export default class Controller {
|
||||
|
||||
devMiddleware: any | null = null;
|
||||
|
||||
startedAtMs = Date.now();
|
||||
autosaveInterval?: ReturnType<typeof setInterval>;
|
||||
systemMetricsInterval?: ReturnType<typeof setInterval>;
|
||||
|
||||
@@ -397,6 +398,7 @@ export default class Controller {
|
||||
this.onSystemMetricsIntervalChanged();
|
||||
|
||||
logger.info("Started controller");
|
||||
this.startedAtMs = Date.now();
|
||||
this._state = "running";
|
||||
}
|
||||
|
||||
@@ -553,7 +555,7 @@ export default class Controller {
|
||||
requests.push(hostConnection.send(new lib.SystemInfoRequest()));
|
||||
}
|
||||
const restartRequired = await this.checkRestartRequired();
|
||||
requests.push(lib.gatherSystemInfo("controller", this.canRestart, restartRequired));
|
||||
requests.push(lib.gatherSystemInfo("controller", this.canRestart, restartRequired, this.startedAtMs));
|
||||
const newMetrics = await Promise.all(requests);
|
||||
for (const metric of newMetrics) {
|
||||
this.systems.set(metric);
|
||||
@@ -663,6 +665,12 @@ export default class Controller {
|
||||
if (!json.restartRequired) { // Added in 2.0.0.alpha.21
|
||||
json.restartRequired = false;
|
||||
}
|
||||
if (!json.systemStartedAtMs) { // Added in 2.0.0.alpha.23
|
||||
json.systemStartedAtMs = Date.now();
|
||||
}
|
||||
if (!json.processStartedAtMs) { // Added in 2.0.0.alpha.23
|
||||
json.processStartedAtMs = Date.now();
|
||||
}
|
||||
return json;
|
||||
});
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user