thinknagent 0.1.2 → 0.1.4

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/lib/agent.js CHANGED
@@ -65,6 +65,11 @@ class Agent {
65
65
  this.logs.start();
66
66
  });
67
67
 
68
+ this.conn.socket.on('agent:send_metrics_now', () => {
69
+ console.log('[agent] send_metrics_now received — polling now');
70
+ this.metrics.pollNow();
71
+ });
72
+
68
73
  // Graceful shutdown
69
74
  process.on('SIGTERM', () => this._shutdown('SIGTERM'));
70
75
  process.on('SIGINT', () => this._shutdown('SIGINT'));
@@ -92,6 +97,7 @@ class Agent {
92
97
  nodeVersion: process.version,
93
98
  });
94
99
  }
100
+
95
101
 
96
102
  _onDisconnect(reason) {
97
103
  this.shell.killAll();
package/lib/metrics.js CHANGED
@@ -22,6 +22,9 @@ class MetricsPoller {
22
22
  if (this._timer) clearInterval(this._timer);
23
23
  console.log('[metrics] Poller stopped');
24
24
  }
25
+ pollNow() {
26
+ return this._poll();
27
+ }
25
28
 
26
29
  async _poll() {
27
30
  try {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "thinknagent",
3
- "version": "0.1.2",
3
+ "version": "0.1.4",
4
4
  "description": "ThinkNCollab server agent — metrics, logs, alerts, shell bridge",
5
5
  "main": "lib/agent.js",
6
6
  "bin": {