merge graph timestamps into single array, use seconds
This commit is contained in:
13
lib/ping.js
13
lib/ping.js
@ -85,6 +85,14 @@ class PingController {
|
||||
pingAll = () => {
|
||||
const timestamp = this._app.timeTracker.newTimestamp()
|
||||
|
||||
// Flag each group as history graph additions each minute
|
||||
// This is sent to the frontend for graph updates
|
||||
const updateHistoryGraph = config.logToDatabase && (!this._lastHistoryGraphUpdate || timestamp - this._lastHistoryGraphUpdate >= 60 * 1000)
|
||||
|
||||
if (updateHistoryGraph) {
|
||||
this._lastHistoryGraphUpdate = timestamp
|
||||
}
|
||||
|
||||
this.startPingTasks(results => {
|
||||
const updates = []
|
||||
|
||||
@ -102,7 +110,7 @@ class PingController {
|
||||
// Generate a combined update payload
|
||||
// This includes any modified fields and flags used by the frontend
|
||||
// This will not be cached and can contain live metadata
|
||||
const update = serverRegistration.handlePing(timestamp, result.resp, result.err, result.version)
|
||||
const update = serverRegistration.handlePing(timestamp, result.resp, result.err, result.version, updateHistoryGraph)
|
||||
|
||||
updates[serverRegistration.serverId] = update
|
||||
}
|
||||
@ -110,7 +118,8 @@ class PingController {
|
||||
// Send object since updates uses serverIds as keys
|
||||
// Send a single timestamp entry since it is shared
|
||||
this._app.server.broadcast(MessageOf('updateServers', {
|
||||
timestamp,
|
||||
timestamp: Math.floor(timestamp / 1000),
|
||||
updateHistoryGraph,
|
||||
updates
|
||||
}))
|
||||
})
|
||||
|
Reference in New Issue
Block a user