Don't count network service requests in metrics

This commit is contained in:
Daniel 2021-01-28 17:55:59 +01:00
parent c9b89ef2ea
commit 455b1c8bba

View file

@ -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