Files
trunk-server/admin/server/models/system_stat.js
2023-04-10 08:44:38 -04:00

30 lines
596 B
JavaScript

var mongoose = require('mongoose');
let decodeErrorSchema = mongoose.Schema({
errorHistory: [Number],
spikeHistory: [Number],
})
let talkgroupStatsSchema = mongoose.Schema({
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);