Description
Is your enhancement related to a problem? Please describe
Workspaces controlled by the che-server are shut down when inactive for a specific period of time (specified by the customCheProperty CHE_LIMITS_WORKSPACE_IDLE_TIMEOUT
) but there is no way at the moment to automatically shut down Workspaces controlled by the devworkspace operator.
Describe the solution you'd like
Workspaces idling should work with DevWorkspaces too. A possible solution would be to use a mechanism similar to Knative autoscaling system: expose workspaces activity metrics (e.g. editor requests per second) and at che-server level collect those metrics and decide which DevWorkspaces need to be scaled to zero.
Activity metrics should be exposed by editors (theia, jetbrains, vscode) extensions.
Scale to zero for workspaces without an editor or for workspaces with an editors but without metrics is out of the scope of this epic.
Describe alternatives you've considered
Currently the Web Terminal supports idling using activity ticks sent from the Console to the machine-exec activity rest API. This approach has a few drawbacks: couples machine-exec and the component that tracks the activity, machine-exec requires privileges to scale the dw to zero.