2019-04-10 21:08:22 +00:00
|
|
|
package metric
|
|
|
|
|
|
|
|
import (
|
|
|
|
"context"
|
|
|
|
|
2021-03-30 18:10:02 +00:00
|
|
|
"github.com/influxdata/influxdb/v2/kit/platform"
|
2019-04-10 21:08:22 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
// EventRecorder records meta-data associated with http requests.
|
|
|
|
type EventRecorder interface {
|
|
|
|
Record(ctx context.Context, e Event)
|
|
|
|
}
|
|
|
|
|
|
|
|
// Event represents the meta data associated with an API request.
|
|
|
|
type Event struct {
|
2021-03-30 18:10:02 +00:00
|
|
|
OrgID platform.ID
|
2019-04-10 21:08:22 +00:00
|
|
|
Endpoint string
|
|
|
|
RequestBytes int
|
|
|
|
ResponseBytes int
|
|
|
|
Status int
|
|
|
|
}
|
2019-09-12 18:39:24 +00:00
|
|
|
|
|
|
|
// NopEventRecorder never records events.
|
|
|
|
type NopEventRecorder struct{}
|
|
|
|
|
|
|
|
// Record never records events.
|
|
|
|
func (n *NopEventRecorder) Record(ctx context.Context, e Event) {}
|