@oneuptime/common 7.0.2712 → 7.0.2721

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.
@@ -8,6 +8,7 @@ export interface MemoryMetrics {
8
8
 
9
9
  export interface CPUMetrics {
10
10
  percentUsed: number;
11
+ cores: number;
11
12
  }
12
13
 
13
14
  export interface BasicDiskMetrics {
@@ -9,8 +9,10 @@ export interface ServerProcess {
9
9
 
10
10
  export default interface ServerMonitorResponse {
11
11
  monitorId: ObjectID;
12
+ hostname: string; // Hostname of the server
12
13
  basicInfrastructureMetrics?: BasicInfrastructureMetrics | undefined;
13
14
  requestReceivedAt: Date;
14
15
  onlyCheckRequestReceivedAt: boolean;
15
16
  processes?: ServerProcess[] | undefined;
17
+ failureCause?: string | undefined;
16
18
  }
@@ -0,0 +1,9 @@
1
+ import NumberUtil from "./Number";
2
+
3
+ export default class MemoryUtil {
4
+ public static convertToGb(memoryInBytes: number): number {
5
+ const gb: number = memoryInBytes / 1024 / 1024 / 1024;
6
+ //return two decimal places
7
+ return NumberUtil.convertToTwoDecimalPlaces(gb);
8
+ }
9
+ }
@@ -0,0 +1,5 @@
1
+ export default class NumberUtil {
2
+ public static convertToTwoDecimalPlaces(value: number): number {
3
+ return Math.round(value * 100) / 100;
4
+ }
5
+ }
@@ -0,0 +1,9 @@
1
+ import NumberUtil from "./Number";
2
+ export default class MemoryUtil {
3
+ static convertToGb(memoryInBytes) {
4
+ const gb = memoryInBytes / 1024 / 1024 / 1024;
5
+ //return two decimal places
6
+ return NumberUtil.convertToTwoDecimalPlaces(gb);
7
+ }
8
+ }
9
+ //# sourceMappingURL=Memory.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Memory.js","sourceRoot":"","sources":["../../../Utils/Memory.ts"],"names":[],"mappings":"AAAA,OAAO,UAAU,MAAM,UAAU,CAAC;AAElC,MAAM,CAAC,OAAO,OAAO,UAAU;IACtB,MAAM,CAAC,WAAW,CAAC,aAAqB;QAC7C,MAAM,EAAE,GAAW,aAAa,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;QACtD,2BAA2B;QAC3B,OAAO,UAAU,CAAC,yBAAyB,CAAC,EAAE,CAAC,CAAC;IAClD,CAAC;CACF"}
@@ -0,0 +1,6 @@
1
+ export default class NumberUtil {
2
+ static convertToTwoDecimalPlaces(value) {
3
+ return Math.round(value * 100) / 100;
4
+ }
5
+ }
6
+ //# sourceMappingURL=Number.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Number.js","sourceRoot":"","sources":["../../../Utils/Number.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,OAAO,OAAO,UAAU;IACtB,MAAM,CAAC,yBAAyB,CAAC,KAAa;QACnD,OAAO,IAAI,CAAC,KAAK,CAAC,KAAK,GAAG,GAAG,CAAC,GAAG,GAAG,CAAC;IACvC,CAAC;CACF"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oneuptime/common",
3
- "version": "7.0.2712",
3
+ "version": "7.0.2721",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {