Documentation
¶
Index ¶
- Variables
- func IsEnabled(ctx context.Context) bool
- func ShouldTrackHTTPGRPCResponse(r *httpgrpc.HTTPResponse) bool
- type Stats
- func (s *Stats) AddWallTime(t time.Duration)
- func (*Stats) Descriptor() ([]byte, []int)
- func (this *Stats) Equal(that interface{}) bool
- func (m *Stats) GetWallTime() time.Duration
- func (this *Stats) GoString() string
- func (s *Stats) LoadWallTime() time.Duration
- func (m *Stats) Marshal() (dAtA []byte, err error)
- func (m *Stats) MarshalTo(dAtA []byte) (int, error)
- func (m *Stats) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (s *Stats) Merge(other *Stats)
- func (*Stats) ProtoMessage()
- func (m *Stats) Reset()
- func (m *Stats) Size() (n int)
- func (this *Stats) String() string
- func (m *Stats) Unmarshal(dAtA []byte) error
- func (m *Stats) XXX_DiscardUnknown()
- func (m *Stats) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Stats) XXX_Merge(src proto.Message)
- func (m *Stats) XXX_Size() int
- func (m *Stats) XXX_Unmarshal(b []byte) error
- type WallTimeMiddleware
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrInvalidLengthStats = fmt.Errorf("proto: negative length found during unmarshaling")
ErrIntOverflowStats = fmt.Errorf("proto: integer overflow")
)
Functions ¶
func IsEnabled ¶ added in v1.7.0
func IsEnabled(ctx context.Context) bool
IsEnabled returns whether stats tracking is enabled in the context.
func ShouldTrackHTTPGRPCResponse ¶
func ShouldTrackHTTPGRPCResponse(r *httpgrpc.HTTPResponse) bool
Types ¶
type Stats ¶
type Stats struct {
// The sum of all wall time spent in the querier to execute the query.
WallTime time.Duration `protobuf:"bytes,1,opt,name=wall_time,json=wallTime,proto3,stdduration" json:"wall_time"`
}
func ContextWithEmptyStats ¶
func ContextWithEmptyStats(ctx context.Context) (*Stats, context.Context)
ContextWithEmptyStats returns a context with empty stats.
func FromContext ¶
func FromContext(ctx context.Context) *Stats
FromContext gets the Stats out of the Context. Returns nil if stats have not been initialised in the context.
func (*Stats) AddWallTime ¶
func (s *Stats) AddWallTime(t time.Duration)
AddWallTime adds some time to the counter.
func (*Stats) Descriptor ¶
func (*Stats) Descriptor() ([]byte, []int)
func (*Stats) GetWallTime ¶
func (m *Stats) GetWallTime() time.Duration
func (*Stats) LoadWallTime ¶
func (s *Stats) LoadWallTime() time.Duration
LoadWallTime returns current wall time.
func (*Stats) MarshalToSizedBuffer ¶
func (m *Stats) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*Stats) ProtoMessage ¶
func (*Stats) ProtoMessage()
func (*Stats) XXX_DiscardUnknown ¶
func (m *Stats) XXX_DiscardUnknown()
func (*Stats) XXX_Marshal ¶
func (m *Stats) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*Stats) XXX_Unmarshal ¶
func (m *Stats) XXX_Unmarshal(b []byte) error
type WallTimeMiddleware ¶
type WallTimeMiddleware struct{}
WallTimeMiddleware tracks the wall time.
func NewWallTimeMiddleware ¶
func NewWallTimeMiddleware() WallTimeMiddleware
NewWallTimeMiddleware makes a new WallTimeMiddleware.
Click to show internal directories.
Click to hide internal directories.