Files
trunk-server/backend/models/system_stat.js
Luke Berndt 0e0b05acf8 fixed it!
2023-04-29 17:56:27 -04:00

33 lines
687 B
JavaScript

var mongoose = require('mongoose');
let decodeErrorSchema = mongoose.Schema({
totalLen: Number,
errors: Number,
spikes: Number,
errorHistory: [Number],
spikeHistory: [Number],
})
let talkgroupStatsSchema = mongoose.Schema({
calls: Number,
totalLen: Number,
callCountHistory: [Number],
callAvgLenHistory: [Number]
})
var systemStatSchema = mongoose.Schema({
callTotals: [Number],
uploadErrors: [Number],
decodeErrorsFreq: {
type: Map,
of: decodeErrorSchema
},
talkgroupStats: {
type: Map,
of: talkgroupStatsSchema
},
shortName: String
}, { collection: 'system_stats' });
module.exports = mongoose.model('SystemStat', systemStatSchema);