Don't count network service requests in metrics
This commit is contained in:
@@ -4,6 +4,7 @@ import (
|
|||||||
"github.com/safing/portbase/api"
|
"github.com/safing/portbase/api"
|
||||||
"github.com/safing/portbase/config"
|
"github.com/safing/portbase/config"
|
||||||
"github.com/safing/portbase/metrics"
|
"github.com/safing/portbase/metrics"
|
||||||
|
"github.com/safing/portmaster/process"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
@@ -105,6 +106,13 @@ func (conn *Connection) addToMetrics() {
|
|||||||
return
|
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.
|
// Only count outgoing connections for now.
|
||||||
if conn.Inbound {
|
if conn.Inbound {
|
||||||
return
|
return
|
||||||
|
|||||||
Reference in New Issue
Block a user