Documentation ¶
Index ¶
Constants ¶
View Source
const ( CEInferenceRequest = "org.kubeflow.serving.inference.request" CEInferenceResponse = "org.kubeflow.serving.inference.response" // cloud events extension attributes have to be lowercase alphanumeric //TODO: ideally request id would have its own header but make do with ce-id for now InferenceServiceAttr = "inferenceservicename" NamespaceAttr = "namespace" ComponentAttr = "component" //endpoint would be either default or canary EndpointAttr = "endpoint" LoggerWorkerQueueSize = 100 CloudEventsIdHeader = "Ce-Id" )
Variables ¶
View Source
var WorkQueue = make(chan LogRequest, LoggerWorkerQueueSize)
A buffered channel that we can send work requests on.
View Source
var WorkerQueue chan chan LogRequest
Functions ¶
func QueueLogRequest ¶
func QueueLogRequest(req LogRequest) error
func StartDispatcher ¶
func StartDispatcher(nworkers int, logger *zap.SugaredLogger)
Types ¶
type LogRequest ¶
type LogRequestType ¶
type LogRequestType string
const ( InferenceRequest LogRequestType = "Request" InferenceResponse LogRequestType = "Response" )
type LoggerHandler ¶
type LoggerHandler struct {
// contains filtered or unexported fields
}
func (*LoggerHandler) ServeHTTP ¶
func (eh *LoggerHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)
call svc and add send request/responses to logUrl
type Worker ¶
type Worker struct { Log *zap.SugaredLogger ID int Work chan LogRequest WorkerQueue chan chan LogRequest QuitChan chan bool Client http.Client CeCtx context.Context CeTransport transport.Transport }
func NewWorker ¶
func NewWorker(id int, workerQueue chan chan LogRequest, logger *zap.SugaredLogger) Worker
NewWorker creates, and returns a new Worker object. Its only argument is a channel that the worker can add itself to whenever it is done its work.
Click to show internal directories.
Click to hide internal directories.