Skip to content

Commit

Permalink
[usm] reliability, preparation for pool of objects, add usm.ebpfProgr…
Browse files Browse the repository at this point in the history
…am.releaseProtocolStats()
  • Loading branch information
yuri-lipnesh committed Dec 18, 2024
1 parent 8a260ae commit 5a403aa
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
4 changes: 4 additions & 0 deletions pkg/network/usm/ebpf_main.go
Original file line number Diff line number Diff line change
Expand Up @@ -544,6 +544,10 @@ func (e *ebpfProgram) getProtocolStats() map[protocols.ProtocolType]interface{}
return ret
}

// releaseProtocolStats release stats objects for enabled protocols.
func (e *ebpfProgram) releaseProtocolStats(_ *network.Connections) {
}

// executePerProtocol runs the given callback (`cb`) for every protocol in the given list (`protocolList`).
// If the callback failed, then we call the error callback (`errorCb`). Eventually returning a list of protocols which
// successfully executed the callback.
Expand Down
7 changes: 5 additions & 2 deletions pkg/network/usm/monitor.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ import (
"syscall"
"time"

"github.com/DataDog/datadog-agent/pkg/network"
"github.com/cilium/ebpf"
"go.uber.org/atomic"

manager "github.com/DataDog/ebpf-manager"

ddebpf "github.com/DataDog/datadog-agent/pkg/ebpf"
"github.com/DataDog/datadog-agent/pkg/network"
"github.com/DataDog/datadog-agent/pkg/network/config"
filterpkg "github.com/DataDog/datadog-agent/pkg/network/filter"
"github.com/DataDog/datadog-agent/pkg/network/protocols"
Expand Down Expand Up @@ -198,7 +198,10 @@ func (m *Monitor) GetProtocolStats() map[protocols.ProtocolType]interface{} {
}

// ReleaseProtocolStats release stats related objects.
func (m *Monitor) ReleaseProtocolStats(_ *network.Connections) {
func (m *Monitor) ReleaseProtocolStats(conns *network.Connections) {
if m.ebpfProgram != nil {
m.ebpfProgram.releaseProtocolStats(conns)
}
}

// Stop HTTP monitoring
Expand Down

0 comments on commit 5a403aa

Please sign in to comment.