Documentation ¶
Index ¶
- Constants
- type ActivationResult
- type Activator
- type Endpoint
- type Measurement
- type Reporter
- func (r *Reporter) ReportRequest(ns, service, config, rev string, v float64) error
- func (r *Reporter) ReportResponseCount(ns, service, config, rev string, responseCode, numTries int, v float64) error
- func (r *Reporter) ReportResponseTime(ns, service, config, rev string, responseCode int, d time.Duration) error
- type StatsReporter
Constants ¶
const ( // K8sServiceName is the name of the activator service K8sServiceName = "activator-service" // RequestCountHTTPHeader is the header key for number of tries RequestCountHTTPHeader string = "knative-activator-num-retries" // RevisionHeaderName is the header key for revision name RevisionHeaderName string = "knative-serving-revision" // RevisionHeaderNamespace is the header key for revision's namespace RevisionHeaderNamespace string = "knative-serving-namespace" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ActivationResult ¶ added in v0.2.0
type ActivationResult struct { Status int Endpoint Endpoint ServiceName string ConfigurationName string Error error }
ActivationResult is used to return the result of an ActivateEndpoint call
type Activator ¶
type Activator interface { ActiveEndpoint(namespace, name string) ActivationResult Shutdown() }
Activator provides an active endpoint for a revision or an error and status code indicating why it could not.
func NewDedupingActivator ¶
NewDedupingActivator creates an Activator that deduplicates activations requests for the same revision id and namespace.
func NewRevisionActivator ¶
func NewRevisionActivator(kubeClient kubernetes.Interface, servingClient clientset.Interface, logger *zap.SugaredLogger, reporter StatsReporter) Activator
NewRevisionActivator creates an Activator that changes revision serving status to active if necessary, then returns the endpoint once the revision is ready to serve traffic.
type Measurement ¶ added in v0.2.0
type Measurement int
Measurement represents the type of the autoscaler metric to be reported
const ( // RequestCountM is the requests count that are routed to the activator RequestCountM Measurement = iota //ResponseCountM is the response count when activator proxy the request ResponseCountM // ResponseTimeInMsecM is the response time in millisecond ResponseTimeInMsecM )
type Reporter ¶ added in v0.2.0
type Reporter struct {
// contains filtered or unexported fields
}
Reporter holds cached metric objects to report autoscaler metrics
func NewStatsReporter ¶ added in v0.2.0
NewStatsReporter creates a reporter that collects and reports activator metrics
func (*Reporter) ReportRequest ¶ added in v0.2.0
ReportRequest captures request metrics
type StatsReporter ¶ added in v0.2.0
type StatsReporter interface { ReportRequest(ns, service, config, rev string, v float64) error ReportResponseCount(ns, service, config, rev string, responseCode, numTries int, v float64) error ReportResponseTime(ns, service, config, rev string, responseCode int, d time.Duration) error }
StatsReporter defines the interface for sending activator metrics