From de8c31ed512c82663c4a4b267ebc2a30614ea165 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gina=20H=C3=A4u=C3=9Fge?= Date: Mon, 11 Jan 2021 19:07:54 +0100 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20Tracking:=20add=20printer=20state?= =?UTF-8?q?=20to=20ping=20event?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit That will allow us to get a general idea of actively used vs idle instances. A huge number of instances in an error state could also be an indicator of problems with a release. Would also be a cool thing to be able to add "this many printers are currently printing" to data.octoprint.org --- src/octoprint/plugins/tracking/__init__.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/octoprint/plugins/tracking/__init__.py b/src/octoprint/plugins/tracking/__init__.py index 077b23855..5543d60a2 100644 --- a/src/octoprint/plugins/tracking/__init__.py +++ b/src/octoprint/plugins/tracking/__init__.py @@ -241,7 +241,8 @@ class TrackingPlugin( return uptime = int(monotonic_time() - self._startup_time) - self._track("ping", octoprint_uptime=uptime) + printer_state = self._printer.get_state_id() + self._track("ping", octoprint_uptime=uptime, printer_state=printer_state) def _track_pong(self): if not self._settings.get_boolean(["events", "pong"]):