Documentation ¶
Overview ¶
Package ratelimitmap represents the BPF ratelimit maps in the BPF programs. It contains stats about BPF ratelimiter.
Index ¶
Constants ¶
View Source
const ( // MetricsMapName for ratelimit metrics map. MetricsMapName = "cilium_ratelimit_metrics" // MapName for ratelimit map. MapName = "cilium_ratelimit" // MetricsMaxEntries is the maximum number of keys that can be present in // the Ratelimit Metrics Map. MaxMetricsEntries = 64 // MaxEntries is the maximum number of keys that can be present in the // Ratelimit Map. MaxEntries = 1024 )
View Source
const ( // keep in sync with defines in <bpf/lib/ratelimit.h> ICMPV6 usageType = iota + 1 EVENTS_MAP )
Variables ¶
View Source
var Cell = cell.Module( "ratelimitmap", "eBPF Ratelimit Map", cell.Invoke(RegisterCollector), )
Functions ¶
func RegisterCollector ¶
func RegisterCollector()
Types ¶
type DumpCallback ¶
type DumpCallback func(*MetricsKey, *MetricsValue)
DumpCallback represents the signature of the callback function expected by the DumpWithCallback method, which in turn is used to iterate all the keys/values of a ratelimit metrics map.
type Key ¶
type Key struct { Usage usageType `align:"usage"` Key uint32 `align:"key"` }
Key must be in sync with struct ratelimit_key in <bpf/lib/ratelimit.h>
type MetricsKey ¶
type MetricsKey struct {
Usage usageType `align:"usage"`
}
MetricsKey must be in sync with struct ratelimit_metrics_key in <bpf/lib/ratelimit.h>
func (*MetricsKey) New ¶
func (k *MetricsKey) New() bpf.MapKey
func (*MetricsKey) String ¶
func (k *MetricsKey) String() string
type MetricsValue ¶
type MetricsValue struct {
Dropped uint64 `align:"dropped"`
}
MetricsValue must be in sync with struct ratelimit_metrics_value in <bpf/lib/ratelimit.h>
func (*MetricsValue) New ¶
func (v *MetricsValue) New() bpf.MapValue
func (*MetricsValue) String ¶
func (v *MetricsValue) String() string
type RatelimitMetricsMap ¶
type RatelimitMetricsMap interface {
DumpWithCallback(DumpCallback) error
}
RatelimitMetricsMap interface represents a ratelimit metrics map, and can be reused to implement mock maps for unit tests.
Click to show internal directories.
Click to hide internal directories.