DTP Base provides a scalable and secure Node.js application development harness ready for production service.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

31 lines
931 B

// net-host-stats.js
// Copyright (C) 2024 DTP Technologies, LLC
// All Rights Reserved
'use strict';
import mongoose from 'mongoose';
const Schema = mongoose.Schema;
import {
CpuInfoSchema,
MemoryInfoSchema,
CacheStatsSchema,
DiskUsageSchema,
NetworkInterfaceStatsSchema,
} from './lib/host-stats.js';
const NetHostStatsSchema = new Schema({
created: { type: Date, default: Date.now, required: true, index: 1, expires: '7d' },
host: { type: Schema.ObjectId, required: true, index: 1, ref: 'NetHost' },
load: { type: [Number], required: true },
cpus: { type: [CpuInfoSchema], required: true },
memory: { type: MemoryInfoSchema, required: true },
cache: { type: CacheStatsSchema, required: true },
disk: {
cache: { type: DiskUsageSchema, required: true },
},
network: { type: [NetworkInterfaceStatsSchema], required: true },
});
export default mongoose.model('NetHostStats', NetHostStatsSchema);