Skip to content
Snippets Groups Projects
Unverified Commit 5b8043f8 authored by capossele's avatar capossele
Browse files

:chart_with_upwards_trend: Add AnalysisOutboundBytes metric

parent 2f09da20
No related branches found
No related tags found
No related merge requests found
......@@ -4,6 +4,7 @@ import "github.com/iotaledger/hive.go/events"
// CollectionEvents defines the events fot the metrics package
type CollectionEvents struct {
AnalysisOutboundBytes *events.Event
FPCInboundBytes *events.Event
FPCOutboundBytes *events.Event
CPUUsage *events.Event
......
......@@ -13,6 +13,7 @@ var (
func new() *CollectionEvents {
return &CollectionEvents{
AnalysisOutboundBytes: events.NewEvent(uint64Caller),
FPCInboundBytes: events.NewEvent(uint64Caller),
FPCOutboundBytes: events.NewEvent(uint64Caller),
CPUUsage: events.NewEvent(float64Caller),
......
......@@ -6,6 +6,7 @@ import (
"sync"
"time"
"github.com/iotaledger/goshimmer/packages/metrics"
"github.com/iotaledger/goshimmer/packages/shutdown"
"github.com/iotaledger/goshimmer/plugins/analysis/packet"
"github.com/iotaledger/goshimmer/plugins/autopeering"
......@@ -100,6 +101,8 @@ func getEventDispatchers(conn *network.ManagedConnection) *EventDispatchers {
if _, err = conn.Write(data); err != nil {
log.Debugw("Error while writing to connection", "Description", err)
}
// trigger AnalysisOutboundBytes event
metrics.Events().AnalysisOutboundBytes.Trigger(uint64(len(data)))
},
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment