analytics

package
v0.0.0-...-d6856c1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 4, 2020 License: Apache-2.0 Imports: 17 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddLoggerHook

func AddLoggerHook(c collector.Collector)

AddLoggerHook setup logrus logger to send entries to collector

func MessageBusNotifyTrace

func MessageBusNotifyTrace(ctx context.Context, operation string, obj models.Object) collector.MessageBuilder

MessageBusNotifyTrace sends message with type MessageBusNotifyTrace

func NewCollector

func NewCollector(cfg *Config) (collector.Collector, error)

NewCollector makes a collector

func NewCollectorFromGlobalConfig

func NewCollectorFromGlobalConfig() (collector.Collector, error)

NewCollectorFromGlobalConfig makes a collector using global Viper configuration.

func NewMessageBusProcessor

func NewMessageBusProcessor(collector collector.Collector) error

NewMessageBusProcessor runs etcd events watcher

func RESTAPITrace

func RESTAPITrace(ctx echo.Context, reqBody, resBody []byte) collector.MessageBuilder

RESTAPITrace sends message with type RestApiTrace

func VNCAPIMessage

func VNCAPIMessage(entry *logrus.Entry) collector.MessageBuilder

VNCAPIMessage sends message with type VncApiDebug, VncApiInfo, VncApiNotice or VncApiError depends on level

func VncAPILatencyStatsLog

func VncAPILatencyStatsLog(
	ctx context.Context, operation, application string, responseTime int64,
) collector.MessageBuilder

VncAPILatencyStatsLog sends message with type VncAPILatencyStatsLog

func WithCommitLatencyReporting

func WithCommitLatencyReporting(c collector.Collector) func(driver.Driver) driver.Driver

WithCommitLatencyReporting returns database driver wrapper reporting database commit latency.

Types

type BodyDumpPlugin

type BodyDumpPlugin struct {
	collector.Collector
}

BodyDumpPlugin sends HTTP request and response body to Collector.

func (BodyDumpPlugin) RegisterGRPCAPI

func (BodyDumpPlugin) RegisterGRPCAPI(r apiserver.GRPCRouter)

RegisterGRPCAPI does nothing.

func (BodyDumpPlugin) RegisterHTTPAPI

func (p BodyDumpPlugin) RegisterHTTPAPI(r apiserver.HTTPRouter)

RegisterHTTPAPI registers middleware for all endpoints.

type Config

type Config struct {
	Enabled bool
	URL     string
}

Config represents parameters of Сollector in the config file

type LatencyReportingDoer

type LatencyReportingDoer struct {
	Doer        doer
	Collector   collector.Collector
	Operation   string
	Application string
}

LatencyReportingDoer wraps doer and sends request execution times to collector.

func (LatencyReportingDoer) Do

Do executes the request and sends duration to collector.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL