Documentation ¶
Overview ¶
Package metrics implements Relay's integration with OpenCensus.
This is an internal package; application code for specific Relay distributions should not need to reference it directly, only the core code.
Index ¶
- Variables
- func WithCount(ctx context.Context, userAgent string, f func(), measure Measure)
- func WithGauge(ctx context.Context, userAgent string, f func(), measure Measure)
- func WithRouteCount(ctx context.Context, userAgent, route, method string, f func(), ...)
- type EnvironmentManager
- type Manager
- type Measure
Constants ¶
This section is empty.
Variables ¶
var ( // BrowserConns is a Measure representing the current number of active stream connections from browsers. BrowserConns = Measure{/* contains filtered or unexported fields */} // MobileConns is a Measure representing the current number of active stream connections from mobile SDKs. MobileConns = Measure{/* contains filtered or unexported fields */} // ServerConns is a is a Measure representing the current number of active stream connections from server-side SDKs. ServerConns = Measure{/* contains filtered or unexported fields */} // NewBrowserConns is a Measure representing the cumulative number of stream connections from browsers. NewBrowserConns = Measure{/* contains filtered or unexported fields */} // NewMobileConns is a Measure representing the cumulative number of stream connections from mobile SDKs. NewMobileConns = Measure{/* contains filtered or unexported fields */} // NewServerConns is a Measure representing the cumulative number of stream connections from server-side SDKs. NewServerConns = Measure{/* contains filtered or unexported fields */} // BrowserRequests is a Measure representing the number of HTTP requests from browsers. BrowserRequests = Measure{/* contains filtered or unexported fields */} // MobileRequests is a Measure representing the number of HTTP requests from mobile SDKs. MobileRequests = Measure{/* contains filtered or unexported fields */} // ServerRequests is a Measure representing the number of HTTP requests from server-side SDKs. ServerRequests = Measure{/* contains filtered or unexported fields */} )
Functions ¶
func WithCount ¶
WithCount runs a function and records a single-unit increment for the specified metric.
Types ¶
type EnvironmentManager ¶
type EnvironmentManager struct {
// contains filtered or unexported fields
}
EnvironmentManager controls the metrics exporter activity for a specific LD environment.
func (*EnvironmentManager) FlushEventsExporter ¶
func (em *EnvironmentManager) FlushEventsExporter()
FlushEventsExporter is used in testing to trigger the events exporter to post data to the event publisher.
func (*EnvironmentManager) GetOpenCensusContext ¶
func (em *EnvironmentManager) GetOpenCensusContext() context.Context
GetOpenCensusContext returns the Context for this EnvironmentManager's OpenCensus operations.
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager is the top-level object that controls all of our metrics exporter activity. It should be created and retained by the Relay instance, and closed when the Relay instance is closed.
func NewManager ¶
func NewManager( metricsConfig config.MetricsConfig, flushInterval time.Duration, loggers ldlog.Loggers, ) (*Manager, error)
NewManager creates a Manager instance.
func (*Manager) AddEnvironment ¶
func (m *Manager) AddEnvironment(envName string, publisher events.EventPublisher) (*EnvironmentManager, error)
AddEnvironment creates a new EnvironmentManager with its own OpenCensus context that includes a tag for the environment name, and registers its exporter.
func (*Manager) Close ¶
func (m *Manager) Close()
Close shuts down the Manager and all of its EnvironmentManager instances.
func (*Manager) RemoveEnvironment ¶
func (m *Manager) RemoveEnvironment(em *EnvironmentManager)
RemoveEnvironment shuts down this EnvironmentManager and removes it from the Manager.