// 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);