@gazzehamine/armada-watch-agent 1.3.2 → 1.3.3

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/dist/collector.js CHANGED
@@ -136,9 +136,16 @@ async function collectMetrics() {
136
136
  }
137
137
  async function collectProcesses() {
138
138
  const processes = await systeminformation_1.default.processes();
139
+ // Sort by CPU first, then by memory as tiebreaker
140
+ // Don't filter by cpu > 0 since CPU usage fluctuates rapidly
139
141
  return processes.list
140
- .filter((p) => p.cpu > 0 || p.mem > 0)
141
- .sort((a, b) => b.cpu - a.cpu)
142
+ .sort((a, b) => {
143
+ // Sort by CPU descending, then by memory descending
144
+ if (b.cpu !== a.cpu) {
145
+ return b.cpu - a.cpu;
146
+ }
147
+ return b.mem - a.mem;
148
+ })
142
149
  .slice(0, 20)
143
150
  .map((p) => ({
144
151
  pid: p.pid,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gazzehamine/armada-watch-agent",
3
- "version": "1.3.2",
3
+ "version": "1.3.3",
4
4
  "description": "Monitoring agent for Armada Watch - EC2 instance monitoring",
5
5
  "main": "dist/index.js",
6
6
  "bin": {