Documentation ¶
Index ¶
Constants ¶
View Source
const ( // ResultError is a shared result tag value for error. ResultError = "error" // ResultOK is a shared result tag value for success. ResultOK = "success" )
Variables ¶
View Source
var ( // LatencyMs measures the latency in milliseconds for the CloudEvents // client methods. LatencyMs = stats.Float64("cloudevents.io/sdk-go/client/latency", "The latency in milliseconds for the CloudEvents client methods.", "ms") // KeyMethod is the tag used for marking method on a metric. KeyMethod, _ = tag.NewKey("method") // KeyResult is the tag used for marking result on a metric. KeyResult, _ = tag.NewKey("result") // LatencyView is an OpenCensus view that shows client method latency. LatencyView = &view.View{ Name: "client/latency", Measure: LatencyMs, Description: "The distribution of latency inside of client for CloudEvents.", Aggregation: view.Distribution(0, .01, .1, 1, 10, 100, 1000, 10000), TagKeys: LatencyTags(), } )
Functions ¶
func EventTraceAttributes ¶
func EventTraceAttributes(e event.EventReader) []trace.Attribute
func LatencyTags ¶
func New ¶
func New() client.ObservabilityService
Types ¶
type Observable ¶
type Observable interface { MethodName() string LatencyMs() *stats.Float64Measure }
Observable represents the the customization used by the Reporter for a given measurement and trace for a single method.
type Reporter ¶
type Reporter interface { Error() OK() }
Reporter represents a running latency counter. When Error or OK are called, the latency is calculated. Error or OK are only allowed to be called once.
func NewReporter ¶
NewReporter creates and returns a reporter wrapping the provided Observable.
Click to show internal directories.
Click to hide internal directories.