@platformatic/watt-extra 1.16.0 → 1.17.0-alpha.1

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/plugins/update.js CHANGED
@@ -37,6 +37,21 @@ async function updatePlugin (app) {
37
37
  return
38
38
  }
39
39
 
40
+ // Handle profiling activation/deactivation commands from ICC.
41
+ // Fire and forget: the outcome is reported through the profiling
42
+ // states channel, not through a command reply.
43
+ if (command === 'start-profiling' || command === 'stop-profiling') {
44
+ const enabled = command === 'start-profiling'
45
+ const types = message.params?.types
46
+ app.log.info({ command, types }, 'Received profiling toggle command from ICC')
47
+ try {
48
+ await app.setProfilingEnabled(enabled, types ?? undefined)
49
+ } catch (err) {
50
+ app.log.error({ err, command }, 'Failed to toggle profiling')
51
+ }
52
+ return
53
+ }
54
+
40
55
  // Handle a centrally coordinated cron job execution: ICC dispatches
41
56
  // each tick to exactly one pod of the application, this one.
42
57
  if (command === 'run-scheduled-job') {