Documentation ¶
Overview ¶
Copyright (c) Microsoft Corporation. Licensed under the MIT license.
Copyright (c) Microsoft Corporation. Licensed under the MIT license.
Package metrics is a generated GoMock package.
Copyright (c) Microsoft Corporation. Licensed under the MIT license.
Index ¶
- Constants
- Variables
- func DefaultCtxOptions() []string
- func DefaultMetrics() []string
- type AdvMetricsInterface
- type ContextOptions
- type ContextOptionsInterface
- type DNSMetrics
- type DirtyCachePod
- type DropCountMetrics
- type ForwardMetrics
- type IModule
- type LatencyMetrics
- type MockAdvMetricsInterface
- type MockAdvMetricsInterfaceMockRecorder
- type MockContextOptionsInterface
- type MockContextOptionsInterfaceMockRecorder
- type MockIModule
- type MockIModuleMockRecorder
- type Module
- type TCPMetrics
- type TCPRetransMetrics
Constants ¶
const ( // Metric descriptions DNSRequestCountDesc = "Total number of DNS query packets" DNSResponseCountDesc = "Total number of DNS response packets" )
const ( TotalDropCountName = "adv_drop_count" TotalDropBytesName = "adv_drop_bytes" TotalDropCountDesc = "Total number of dropped packets" TotalDropBytesDesc = "Total number of dropped bytes" )
const ( TotalCountName = "adv_forward_count" // TODO remove bytes as it is not being populated TotalBytesName = "adv_forward_bytes" TotalCountDesc = "Total number of forwarded packets" TotalBytesDesc = "Total number of forwarded bytes" )
const ( TTL time.Duration = 500 * time.Millisecond LIMIT uint64 = 100000 )
const ( // Metric names TCPFlagsCountName = "adv_tcpflags_count" // Metric descriptions TCPFlagsCountDesc = "Total number of packets by TCP flag" )
const ( // Metric names TCPRetransCountName = "adv_tcpretrans_count" // Metric descriptions TCPRetransCountDesc = "Total number of TCP retransmitted packets" )
Variables ¶
var ( DNSRequestCountName = fmt.Sprintf("adv_%s", utils.DNSRequestCounterName) DNSResponseCountName = fmt.Sprintf("adv_%s", utils.DNSResponseCounterName) )
Functions ¶
func DefaultCtxOptions ¶
func DefaultCtxOptions() []string
DefaultCtxOptions used for enableAnnotations where it sets the source and destination labels so users will not have to manually define.
func DefaultMetrics ¶
func DefaultMetrics() []string
DefaultMetrics used for enableAnnotations where it sets enabled advanced metrics so users will not have to manually define. For any new advanced metrics we want to have enabled by default for annotation based solution, add it here.
Types ¶
type AdvMetricsInterface ¶
type ContextOptions ¶
type ContextOptions struct { IP bool Namespace bool Podname bool Workload bool Service bool Port bool // contains filtered or unexported fields }
func NewCtxOption ¶
func NewCtxOption(opts []string, option ctxOptionType) *ContextOptions
type ContextOptionsInterface ¶
type ContextOptionsInterface interface {
// contains filtered or unexported methods
}
type DNSMetrics ¶
type DNSMetrics struct {
// contains filtered or unexported fields
}
func NewDNSMetrics ¶
func NewDNSMetrics(ctxOptions *api.MetricsContextOptions, fl *log.ZapLogger, isLocalContext enrichmentContext) *DNSMetrics
func (*DNSMetrics) Clean ¶
func (d *DNSMetrics) Clean()
func (*DNSMetrics) Init ¶
func (d *DNSMetrics) Init(metricName string)
func (*DNSMetrics) ProcessFlow ¶
func (d *DNSMetrics) ProcessFlow(flow *v1.Flow)
type DirtyCachePod ¶
type DropCountMetrics ¶
type DropCountMetrics struct {
// contains filtered or unexported fields
}
func NewDropCountMetrics ¶
func NewDropCountMetrics(ctxOptions *api.MetricsContextOptions, fl *log.ZapLogger, isLocalContext enrichmentContext) *DropCountMetrics
func (*DropCountMetrics) Clean ¶
func (d *DropCountMetrics) Clean()
func (*DropCountMetrics) Init ¶
func (d *DropCountMetrics) Init(metricName string)
func (*DropCountMetrics) ProcessFlow ¶
func (d *DropCountMetrics) ProcessFlow(flow *v1.Flow)
TODO: update ProcessFlow with bytes metrics. We are only accounting for count. bytes metrics needs some additional work in ebpf and in this func to get the skb length
type ForwardMetrics ¶
type ForwardMetrics struct {
// contains filtered or unexported fields
}
func NewForwardCountMetrics ¶
func NewForwardCountMetrics(ctxOptions *api.MetricsContextOptions, fl *log.ZapLogger, isLocalContext enrichmentContext) *ForwardMetrics
func (*ForwardMetrics) Clean ¶
func (f *ForwardMetrics) Clean()
func (*ForwardMetrics) Init ¶
func (f *ForwardMetrics) Init(metricName string)
func (*ForwardMetrics) ProcessFlow ¶
func (f *ForwardMetrics) ProcessFlow(flow *v1.Flow)
TODO: update ProcessFlow with bytes metrics. We are only accounting for count. bytes metrics needs some additional work in ebpf and in this func to get the skb length
type IModule ¶
type IModule interface {
Reconcile(spec *api.MetricsSpec) error
}
type LatencyMetrics ¶
type LatencyMetrics struct {
// contains filtered or unexported fields
}
func NewLatencyMetrics ¶
func NewLatencyMetrics(ctxOptions *api.MetricsContextOptions, fl *log.ZapLogger, isLocalContext enrichmentContext) *LatencyMetrics
func (*LatencyMetrics) Clean ¶
func (lm *LatencyMetrics) Clean()
func (*LatencyMetrics) Init ¶
func (lm *LatencyMetrics) Init(metricName string)
func (*LatencyMetrics) ProcessFlow ¶
func (lm *LatencyMetrics) ProcessFlow(f *v1.Flow)
type MockAdvMetricsInterface ¶
type MockAdvMetricsInterface struct {
// contains filtered or unexported fields
}
MockAdvMetricsInterface is a mock of AdvMetricsInterface interface.
func NewMockAdvMetricsInterface ¶
func NewMockAdvMetricsInterface(ctrl *gomock.Controller) *MockAdvMetricsInterface
NewMockAdvMetricsInterface creates a new mock instance.
func (*MockAdvMetricsInterface) Clean ¶
func (m *MockAdvMetricsInterface) Clean()
Clean mocks base method.
func (*MockAdvMetricsInterface) EXPECT ¶
func (m *MockAdvMetricsInterface) EXPECT() *MockAdvMetricsInterfaceMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockAdvMetricsInterface) Init ¶
func (m *MockAdvMetricsInterface) Init(metricName string)
Init mocks base method.
func (*MockAdvMetricsInterface) ProcessFlow ¶
func (m *MockAdvMetricsInterface) ProcessFlow(f *flow.Flow)
ProcessFlow mocks base method.
type MockAdvMetricsInterfaceMockRecorder ¶
type MockAdvMetricsInterfaceMockRecorder struct {
// contains filtered or unexported fields
}
MockAdvMetricsInterfaceMockRecorder is the mock recorder for MockAdvMetricsInterface.
func (*MockAdvMetricsInterfaceMockRecorder) Clean ¶
func (mr *MockAdvMetricsInterfaceMockRecorder) Clean() *gomock.Call
Clean indicates an expected call of Clean.
func (*MockAdvMetricsInterfaceMockRecorder) Init ¶
func (mr *MockAdvMetricsInterfaceMockRecorder) Init(metricName any) *gomock.Call
Init indicates an expected call of Init.
func (*MockAdvMetricsInterfaceMockRecorder) ProcessFlow ¶
func (mr *MockAdvMetricsInterfaceMockRecorder) ProcessFlow(f any) *gomock.Call
ProcessFlow indicates an expected call of ProcessFlow.
type MockContextOptionsInterface ¶
type MockContextOptionsInterface struct {
// contains filtered or unexported fields
}
MockContextOptionsInterface is a mock of ContextOptionsInterface interface.
func NewMockContextOptionsInterface ¶
func NewMockContextOptionsInterface(ctrl *gomock.Controller) *MockContextOptionsInterface
NewMockContextOptionsInterface creates a new mock instance.
func (*MockContextOptionsInterface) EXPECT ¶
func (m *MockContextOptionsInterface) EXPECT() *MockContextOptionsInterfaceMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
type MockContextOptionsInterfaceMockRecorder ¶
type MockContextOptionsInterfaceMockRecorder struct {
// contains filtered or unexported fields
}
MockContextOptionsInterfaceMockRecorder is the mock recorder for MockContextOptionsInterface.
type MockIModule ¶
type MockIModule struct {
// contains filtered or unexported fields
}
MockIModule is a mock of IModule interface.
func NewMockIModule ¶
func NewMockIModule(ctrl *gomock.Controller) *MockIModule
NewMockIModule creates a new mock instance.
func (*MockIModule) EXPECT ¶
func (m *MockIModule) EXPECT() *MockIModuleMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockIModule) Reconcile ¶
func (m *MockIModule) Reconcile(spec *v1alpha1.MetricsSpec) error
Reconcile mocks base method.
type MockIModuleMockRecorder ¶
type MockIModuleMockRecorder struct {
// contains filtered or unexported fields
}
MockIModuleMockRecorder is the mock recorder for MockIModule.
type Module ¶
func InitModule ¶
func InitModule(ctx context.Context, conf *kcfg.Config, pubsub pubsub.PubSubInterface, enricher enricher.EnricherInterface, fm filtermanager.IFilterManager, cache cache.CacheInterface, ) *Module
func (*Module) PodCallBackFn ¶
func (m *Module) PodCallBackFn(obj interface{})
type TCPMetrics ¶
type TCPMetrics struct {
// contains filtered or unexported fields
}
func NewTCPMetrics ¶
func NewTCPMetrics(ctxOptions *api.MetricsContextOptions, fl *log.ZapLogger, isLocalContext enrichmentContext) *TCPMetrics
func (*TCPMetrics) Clean ¶
func (t *TCPMetrics) Clean()
func (*TCPMetrics) Init ¶
func (t *TCPMetrics) Init(metricName string)
func (*TCPMetrics) ProcessFlow ¶
func (t *TCPMetrics) ProcessFlow(flow *v1.Flow)
type TCPRetransMetrics ¶
type TCPRetransMetrics struct {
// contains filtered or unexported fields
}
func NewTCPRetransMetrics ¶
func NewTCPRetransMetrics(ctxOptions *api.MetricsContextOptions, fl *log.ZapLogger, isLocalContext enrichmentContext) *TCPRetransMetrics
func (*TCPRetransMetrics) Clean ¶
func (t *TCPRetransMetrics) Clean()
func (*TCPRetransMetrics) Init ¶
func (t *TCPRetransMetrics) Init(metricName string)
func (*TCPRetransMetrics) ProcessFlow ¶
func (t *TCPRetransMetrics) ProcessFlow(flow *v1.Flow)