/** * 负载监控 */ var mongoose = require("./mongodb"); var Schema = mongoose.Schema; var moment=require('moment'); var loadMonitorSchema = new Schema( { serverName:{type:String,index:true,default:''},//服务器名称 serverAddr:{type:String,default:''},//服务器地址 CPULoad:{type: Number},//CPU memory:{type: Number},//内存 diskSpace:{type: Number},//磁盘空间 LogSpace:{type: Number},//日志空间 time:{type:Date,index:true,default:Date.now()},//时间 },{ strict: true, toObject: { virtuals: true }, toJSON: { virtuals: true } }); var loadMonitor = mongoose.model('loadMonitor', loadMonitorSchema,'t_loadMonitor'); module.exports = loadMonitor;