Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SIG: Add EgressRxQueueFull metric #2239

Merged
merged 1 commit into from
Dec 12, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion go/sig/base/core/as.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import (
"github.com/scionproto/scion/go/lib/ringbuf"
"github.com/scionproto/scion/go/sig/base"
"github.com/scionproto/scion/go/sig/config"
"github.com/scionproto/scion/go/sig/egress"
"github.com/scionproto/scion/go/sig/egress/dispatcher"
"github.com/scionproto/scion/go/sig/egress/router"
"github.com/scionproto/scion/go/sig/egress/session"
Expand Down Expand Up @@ -362,7 +363,7 @@ func (ae *ASEntry) cleanSessions() {
}

func (ae *ASEntry) setupNet() {
ae.egressRing = ringbuf.New(64, nil, "egress",
ae.egressRing = ringbuf.New(egress.EgressRemotePkts, nil, "egress",
prometheus.Labels{"ringId": ae.IAString, "sessId": ""})
go func() {
defer log.LogPanicAndExit()
Expand Down
3 changes: 2 additions & 1 deletion go/sig/egress/interface.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ func Init() {

const (
// FIXME(kormat): these relative sizes will fail if there are lots of egress dispatchers.
EgressFreePktsCap = 1024
EgressFreePktsCap = 2048
EgressRemotePkts = 512
EgressBufPkts = 32
)

Expand Down
4 changes: 2 additions & 2 deletions go/sig/egress/reader/reader.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import (
"github.com/scionproto/scion/go/lib/ringbuf"
"github.com/scionproto/scion/go/sig/egress"
"github.com/scionproto/scion/go/sig/egress/router"
"github.com/scionproto/scion/go/sig/metrics"
)

const (
Expand Down Expand Up @@ -97,8 +98,7 @@ BatchLoop:
if n, _ := dstRing.Write(ringbuf.EntryList{buf}, false); n != 1 {
// Release buffer back to free buffer pool
egress.EgressFreePkts.Write(ringbuf.EntryList{buf}, true)
// FIXME(kormat): replace with metric.
r.log.Error("EgressReader: no space in egress worker queue", "ia", dstIA)
metrics.EgressRxQueueFull.WithLabelValues(dstIA.String()).Inc()
}
}
}
Expand Down
5 changes: 5 additions & 0 deletions go/sig/metrics/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ var (
FramesDiscarded prometheus.Counter
FramesTooOld prometheus.Counter
FramesDuplicated prometheus.Counter

EgressRxQueueFull *prometheus.CounterVec
)

// Version number of loaded config, atomic
Expand Down Expand Up @@ -76,6 +78,9 @@ func Init(elem string) {
FramesTooOld = newC("frames_too_old_total", "Number of frames that are too old.")
FramesDuplicated = newC("frames_duplicated_total", "Number of duplicate frames.")

EgressRxQueueFull = newCVec("egress_recv_queue_full_total",
"Egress packets dropped due to full queues.", []string{"IA"})

// Initialize ringbuf metrics.
ringbuf.InitMetrics("sig", constLabels, []string{"ringId", "sessId"})
// Add handler for ConfigVersion
Expand Down