Documentation ¶
Index ¶
Constants ¶
View Source
const ( DispatcherReceived = "received" DispatcherExecuted = "executed" )
Variables ¶
View Source
var ( // Views OpenCensusExecCount = &view.View{ Name: "execution_count", Measure: ocExecCount, Description: "Number of command executions", Aggregation: view.Count(), } OpenCensusErrCount = &view.View{ Name: "error_count", Measure: ocErrCount, Description: "Number of command error", Aggregation: view.Count(), } OpenCensusExecCountByCommand = &view.View{ Name: "execution_count_by_command", Measure: ocExecCount, Description: "Number of command executions by command", TagKeys: []tag.Key{commandName}, Aggregation: view.Count(), } OpenCensusErrCountByCommand = &view.View{ Name: "error_count_by_command", Measure: ocErrCount, Description: "Number of command error by command", TagKeys: []tag.Key{commandName}, Aggregation: view.Count(), } )
View Source
var DefaultOpenCensusConfig = OpenCensusConfig{ Views: []*view.View{ OpenCensusExecCount, OpenCensusErrCount, OpenCensusExecCountByCommand, OpenCensusErrCountByCommand, }, }
DefaultOpenCensusConfig is the default OpenCensus middleware config.
Functions ¶
func Dispatcher ¶
func Dispatcher(d dispatcher.Dispatcher) commandbus.MiddlewareFunc
Dispatcher will dispatch events when a command was received and executed.
func OpenCensus ¶
func OpenCensus() commandbus.MiddlewareFunc
OpenCensus returns a middleware that collect the command metrics.
func OpenCensusWithConfig ¶
func OpenCensusWithConfig(cfg OpenCensusConfig) commandbus.MiddlewareFunc
OpenCensusWithConfig returns a OpenCensus middleware with config. See: `OpenCensus()`.
Types ¶
type OpenCensusConfig ¶
OpenCensusConfig defines the config for OpenCensus middleware.
Click to show internal directories.
Click to hide internal directories.