From 455b1c8bbaad69b2d6584b66befb2598017ee7fe Mon Sep 17 00:00:00 2001 From: Daniel Date: Thu, 28 Jan 2021 17:55:59 +0100 Subject: [PATCH] Don't count network service requests in metrics --- network/metrics.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/network/metrics.go b/network/metrics.go index 1744de7b..d8972bda 100644 --- a/network/metrics.go +++ b/network/metrics.go @@ -4,6 +4,7 @@ import ( "github.com/safing/portbase/api" "github.com/safing/portbase/config" "github.com/safing/portbase/metrics" + "github.com/safing/portmaster/process" ) var ( @@ -105,6 +106,13 @@ func (conn *Connection) addToMetrics() { return } + // Don't count requests serviced to the network, + // as we have an incomplete view here. + if conn.Process() != nil && + conn.Process().Pid == process.NetworkHostProcessID { + return + } + // Only count outgoing connections for now. if conn.Inbound { return