t_loadMonitor.js 804 B

1234567891011121314151617181920212223242526272829
  1. /**
  2. * 负载监控
  3. */
  4. var mongoose = require("./mongodb");
  5. var Schema = mongoose.Schema;
  6. var moment=require('moment');
  7. var loadMonitorSchema = new Schema(
  8. {
  9. serverName:{type:String,index:true,default:''},//服务器名称
  10. serverAddr:{type:String,default:''},//服务器地址
  11. CPULoad:{type: Number},//CPU
  12. memory:{type: Number},//内存
  13. diskSpace:{type: Number},//磁盘空间
  14. LogSpace:{type: Number},//日志空间
  15. time:{type:Date,index:true,default:Date.now()},//时间
  16. },{
  17. strict: true,
  18. toObject: {
  19. virtuals: true
  20. },
  21. toJSON: {
  22. virtuals: true
  23. }
  24. });
  25. var loadMonitor = mongoose.model('loadMonitor',
  26. loadMonitorSchema,'t_loadMonitor');
  27. module.exports = loadMonitor;