Update Notification model to include metric specific notification thresholds

This commit is contained in:
Alex Holliday
2024-11-22 11:52:32 +08:00
parent 3721af7555
commit 930403af8c

View File

@@ -16,6 +16,28 @@ const NotificationSchema = mongoose.Schema(
phone: {
type: String,
},
alertThreshold: {
type: Number,
default: 5,
},
cpuAlertThreshold: {
type: Number,
default: function () {
return this.alertThreshold;
},
},
memoryAlertThreshold: {
type: Number,
default: function () {
return this.alertThreshold;
},
},
diskAlertThreshold: {
type: Number,
default: function () {
return this.alertThreshold;
},
},
},
{
timestamps: true,