48 lines
958 B
JavaScript
48 lines
958 B
JavaScript
'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,
|
|
},
|
|
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,
|
|
});
|
|
// optional more indices
|
|
LogServerFpsSchema.index({war: 1});
|
|
|
|
module.exports = mongoose.model('LogServerFpsSchema', LogServerFpsSchema);
|