Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func New ¶
func New(l *zap.SugaredLogger, r activator.StatsReporter, t *activatornet.Throttler, rl servinglisters.RevisionLister, sl corev1listers.ServiceLister, sksL netlisters.ServerlessServiceLister) http.Handler
New constructs a new http.Handler that deals with revision activation.
Types ¶
type ConcurrencyReporter ¶
type ConcurrencyReporter struct {
// contains filtered or unexported fields
}
ConcurrencyReporter reports stats based on incoming requests and ticks.
func NewConcurrencyReporter ¶
func NewConcurrencyReporter(logger *zap.SugaredLogger, podName string, reqCh chan ReqEvent, reportCh <-chan time.Time, statCh chan *autoscaler.StatMessage, rl servinglisters.RevisionLister, sr activator.StatsReporter) *ConcurrencyReporter
NewConcurrencyReporter creates a ConcurrencyReporter which listens to incoming ReqEvents on reqCh and ticks on reportCh and reports stats on statCh.
func NewConcurrencyReporterWithClock ¶
func NewConcurrencyReporterWithClock(logger *zap.SugaredLogger, podName string, reqCh chan ReqEvent, reportCh <-chan time.Time, statCh chan *autoscaler.StatMessage, rl servinglisters.RevisionLister, sr activator.StatsReporter, clock system.Clock) *ConcurrencyReporter
NewConcurrencyReporterWithClock instantiates a new concurrency reporter which uses the passed clock.
func (*ConcurrencyReporter) Run ¶
func (cr *ConcurrencyReporter) Run(stopCh <-chan struct{})
Run runs until stopCh is closed and processes events on all incoming channels
type HealthHandler ¶
HealthHandler handles responding to kubelet probes with a provided health check.
func (*HealthHandler) ServeHTTP ¶
func (h *HealthHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)
type MetricHandler ¶
type MetricHandler struct {
// contains filtered or unexported fields
}
MetricHandler sends metrics via reporter
func NewMetricHandler ¶
func NewMetricHandler(rl servinglisters.RevisionLister, r activator.StatsReporter, l *zap.SugaredLogger, next http.Handler) *MetricHandler
NewMetricHandler creates a handler collects and reports request metrics
func (*MetricHandler) ServeHTTP ¶
func (h *MetricHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)
type ProbeHandler ¶
ProbeHandler handles responding to Knative internal network probes.
func (*ProbeHandler) ServeHTTP ¶
func (h *ProbeHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)
type ReqEvent ¶
type ReqEvent struct { Key types.NamespacedName EventType ReqEventType }
ReqEvent represents an incoming/finished request with a given key
type ReqEventType ¶
type ReqEventType int
ReqEventType specifies the type of event (In/Out)
const ( // ReqIn represents an incoming request ReqIn ReqEventType = iota // ReqOut represents a finished request ReqOut )
type RequestEventHandler ¶
type RequestEventHandler struct { ReqChan chan ReqEvent // contains filtered or unexported fields }
RequestEventHandler sends events to the given channel.
func NewRequestEventHandler ¶
func NewRequestEventHandler(reqChan chan ReqEvent, next http.Handler) *RequestEventHandler
NewRequestEventHandler creates a handler that sends events about incoming/closed http connections to the given channel.
func (*RequestEventHandler) ServeHTTP ¶
func (h *RequestEventHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)