@kronos-integration/service-health 6.0.2 → 7.0.0

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": "@kronos-integration/service-health",
3
- "version": "6.0.2",
3
+ "version": "7.0.0",
4
4
  "publishConfig": {
5
5
  "access": "public",
6
6
  "provenance": true
@@ -21,7 +21,7 @@ let lastCpuUsage;
21
21
 
22
22
  const intervalEndpointDefs = {
23
23
  cpu: {
24
- receive: () => {
24
+ receive: () => {
25
25
  lastCpuUsage = process.cpuUsage(lastCpuUsage);
26
26
  return lastCpuUsage;
27
27
  },
@@ -73,7 +73,8 @@ export class ServiceHealth extends Service {
73
73
  endpoint.send(hcs.isHealthy);
74
74
  const listener = () => endpoint.send(hcs.isHealthy);
75
75
  hcs.owner.addListener("serviceStateChanged", listener);
76
- return () => hcs.owner.removeListener("serviceStateChanged", listener);
76
+ return () =>
77
+ hcs.owner.removeListener("serviceStateChanged", listener);
77
78
  }
78
79
  }
79
80
  },
@@ -81,23 +82,21 @@ export class ServiceHealth extends Service {
81
82
  };
82
83
  }
83
84
 
84
- static get configurationAttributes() {
85
- return mergeAttributeDefinitions(
86
- prepareAttributesDefinitions(
87
- Object.fromEntries(
88
- Object.entries(intervalEndpointDefs).map(([name, def]) => [
89
- name + "Interval",
90
- {
91
- description: `${name} endpoint send interval (in seconds)`,
92
- default: 30,
93
- type: "duration"
94
- }
95
- ])
96
- )
97
- ),
98
- Service.configurationAttributes
99
- );
100
- }
85
+ static attributes = mergeAttributeDefinitions(
86
+ prepareAttributesDefinitions(
87
+ Object.fromEntries(
88
+ Object.entries(intervalEndpointDefs).map(([name, def]) => [
89
+ name + "Interval",
90
+ {
91
+ description: `${name} endpoint send interval (in seconds)`,
92
+ default: 30,
93
+ type: "duration"
94
+ }
95
+ ])
96
+ )
97
+ ),
98
+ Service.attributes
99
+ );
101
100
 
102
101
  /**
103
102
  * Start immediate