From 9fe01e82d959721e94ba47597a02eaf2cdf3d0ac Mon Sep 17 00:00:00 2001
From: Thulinma <jaron@vietors.com>
Date: Mon, 10 Apr 2023 13:24:27 +0200
Subject: [PATCH] Fix viewer protocol counts in prometheus output

---
 src/controller/controller_statistics.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/controller/controller_statistics.cpp b/src/controller/controller_statistics.cpp
index df8c645d..805f0075 100644
--- a/src/controller/controller_statistics.cpp
+++ b/src/controller/controller_statistics.cpp
@@ -1588,9 +1588,9 @@ void Controller::handlePrometheus(HTTP::Parser &H, Socket::Connection &conn, int
       totUnspecified++;
     }else if (thisSessId[0] == 'O'){
       totOutputs++;
-      outputs[statComm.getConnector(idx)]++;
     }else{
       totViewers++;
+      outputs[statComm.getConnector(idx)]++;
     }
   }