opt-cc/server/models/logs/server-fps.js

48 lines
952 B
JavaScript
Raw Permalink Normal View History

2019-02-09 18:51:01 +01:00
'use strict';
const mongoose = require('mongoose');
const Schema = mongoose.Schema;
const LogServerFpsSchema = new Schema({
war: {
type: mongoose.Schema.Types.ObjectId,
ref: 'War',
required: true,
},
entityName: {
type: String,
required: true,
},
singleAvgFps: {
type: Number,
get: (v) => Math.round(v),
set: (v) => Math.round(v),
required: true,
},
singleMinFps: {
type: Number,
get: (v) => Math.round(v),
set: (v) => Math.round(v),
required: true,
},
2019-02-09 18:51:01 +01:00
avgFps: [{
type: Number,
get: (v) => Math.round(v),
set: (v) => Math.round(v),
required: true,
}],
minFps: [{
type: Number,
get: (v) => Math.round(v),
set: (v) => Math.round(v),
required: true,
}],
}, {
collection: 'logServerFps',
versionKey: false,
2019-02-09 18:51:01 +01:00
});
// optional more indices
LogServerFpsSchema.index({war: 1});
2019-02-11 18:45:21 +01:00
module.exports = mongoose.model('LogServerFps', LogServerFpsSchema);