Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Recorder ¶
func Recorder() middleware.Middleware
Recorder records telemetry "record" for every request. Note: It must be the last middleware in all the plugins
Types ¶
type SearchResponseBody ¶
type SearchResponseBody struct {
Took float64 `json:"took"`
}
SearchResponseBody represents the response body returned by search
type Telemetry ¶
type Telemetry struct {
// contains filtered or unexported fields
}
Telemetry plugin records the API usage.
func Instance ¶
func Instance() *Telemetry
Instance returns the singleton instance of Telemetry plugin. Note: Only this function must be used (both within and outside the package) to obtain the instance Logs in order to avoid stateless instances of the plugin.
func (*Telemetry) ESMiddleware ¶
func (t *Telemetry) ESMiddleware() []middleware.Middleware
Default empty middleware array function
func (*Telemetry) InitFunc ¶
InitFunc is a part of Plugin interface that gets executed only once, and initializes the dao, i.e. elasticsearch before the plugin is operational.
func (*Telemetry) RSMiddleware ¶
func (t *Telemetry) RSMiddleware() []middleware.Middleware
Default empty middleware array function
type TelemetryRecord ¶
type TelemetryRecord struct { // timestamp in UNIX TimeStamp int64 `json:"timestamp"` CPU int64 `json:"cpu"` URL string `json:"url"` Method string `json:"m"` Category string `json:"cat"` ServerStatusCode int64 `json:"ssc"` RunTime string `json:"rt"` ServerMode string `json:"mode"` Plan string `json:"plan"` ServerVersion string `json:"ver"` // Machine ID ServerID string `json:"sid"` // The following properties may present or not ClientIPv4 *string `json:"cip,omitempty"` ClientIPv6 *string `json:"cip6,omitempty"` FrontEndClient *string `json:"fe,omitempty"` // Memory allocated to service in MB(s) MEMORY *uint64 `json:"mem,omitempty"` // Response time taken by Elasticsearch for search requests in milliseconds SearchResponseTime *int64 `json:"srt,omitempty"` // Response time taken by RS API for search requests in milliseconds AppbaseResponseTime *int64 `json:"art,omitempty"` // Response size in bytes ServerResponseSize *int64 `json:"srs,omitempty"` // Disk Size in MB(s) AvailableDisk *uint64 `json:"disk,omitempty"` Acl *string `json:"acl,omitempty"` }
TelemetryRecord plugin records the API usage.