feat: machine performance indicators
This commit is contained in:
parent
9896b44178
commit
1a166bc279
9 changed files with 189 additions and 23 deletions
|
|
@ -1,25 +1,17 @@
|
|||
const express = require('express')
|
||||
const router = express.Router()
|
||||
|
||||
const { getMachine } = require('../machine-loader')
|
||||
const { updateNetworkHeartbeat, updateNetworkPerformance } = require('../machine-loader')
|
||||
|
||||
function networkHeartbeat (req, res, next) {
|
||||
return getMachine(req.deviceId)
|
||||
.then(machine => {
|
||||
console.log(`${machine.name} network heartbeat:`)
|
||||
console.log(req.body)
|
||||
return res.status(200).send({ status: 'OK' })
|
||||
})
|
||||
return updateNetworkHeartbeat(req.deviceId, req.body)
|
||||
.then(() => res.status(200).send({ status: 'OK' }))
|
||||
.catch(next)
|
||||
}
|
||||
|
||||
function networkPerformance (req, res, next) {
|
||||
return getMachine(req.deviceId)
|
||||
.then(machine => {
|
||||
console.log(`${machine.name} network performance:`)
|
||||
console.log(req.body)
|
||||
return res.status(200).send({ status: 'OK' })
|
||||
})
|
||||
return updateNetworkPerformance(req.deviceId, req.body)
|
||||
.then(() => res.status(200).send({ status: 'OK' }))
|
||||
.catch(next)
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue