@justair/justair-library 4.7.18 → 4.7.20

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@justair/justair-library",
3
- "version": "4.7.18",
3
+ "version": "4.7.20",
4
4
  "description": "JustAir Internal Library",
5
5
 
6
6
  "main": "src/index.js",
@@ -277,6 +277,9 @@ monitorsSchema.index({ monitorSupplier: 1 });
277
277
  monitorsSchema.index({ monitorIdFromSupplier: 1 });
278
278
  monitorsSchema.index({ monitorState: 1 });
279
279
 
280
+ //network metrics for anomalies
281
+ monitorsSchema.index({ sponsor: 1, isActive: 1, monitorSupplier: 1 })
282
+
280
283
  // Pre-hook to log single document deletions
281
284
  monitorsSchema.pre("findOneAndDelete", async function () {
282
285
  const docToDelete = await this.model.findOne(this.getFilter()).lean();
@@ -13,6 +13,31 @@ const networkMetricsSchema = mongoose.Schema({
13
13
  flags: Object
14
14
  }, { timestamps: true });
15
15
 
16
+ networkMetricsSchema.index({
17
+ monitorId: 1,
18
+ measurementsStartTime: -1,
19
+ flags: 1
20
+ });
21
+
22
+ networkMetricsSchema.index({
23
+ parameter: 1,
24
+ measurementsStartTime: 1,
25
+ orgId: 1,
26
+ monitorId: 1
27
+ });
28
+
29
+ networkMetricsSchema.index({
30
+ measurementsStartTime: -1,
31
+ measurementsEndTime: -1,
32
+ flags: 1
33
+ });
34
+
35
+ networkMetricsSchema.index({
36
+ orgId: 1,
37
+ parameter: 1,
38
+ measurementsStartTime: -1
39
+ });
40
+
16
41
  const NetworkMetrics = mongoose.model("NetworkMetrics", networkMetricsSchema);
17
42
 
18
43
  export { networkMetricsSchema, NetworkMetrics };