metrics

package
v1.0.0-beta.1 Latest Latest
Warning

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

Go to latest
Published: Sep 20, 2022 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	KvTracingServiceName      string = "kv"
	TraceServiceName          string = "tigris.grpc.server"
	SessionManagerServiceName string = "session"
	GrpcSpanType              string = "grpc"
	FdbSpanType               string = "fdb"
	SearchSpanType            string = "search"
	SessionSpanType           string = "session"
	AuthSpanType              string = "auth"
)

Variables

View Source
var (
	AuthOkCount       tally.Scope
	AuthErrorCount    tally.Scope
	AuthRespTime      tally.Scope
	AuthErrorRespTime tally.Scope
)
View Source
var (
	FdbOkCount       tally.Scope
	FdbErrorCount    tally.Scope
	FdbRespTime      tally.Scope
	FdbErrorRespTime tally.Scope
)
View Source
var (
	Reporter       promreporter.Reporter
	Requests       tally.Scope
	FdbMetrics     tally.Scope
	SearchMetrics  tally.Scope
	SessionMetrics tally.Scope
	SizeMetrics    tally.Scope
	NetworkMetrics tally.Scope
	AuthMetrics    tally.Scope
)
View Source
var (
	BytesReceived tally.Scope
	BytesSent     tally.Scope
)
View Source
var (
	RequestsOkCount       tally.Scope
	RequestsErrorCount    tally.Scope
	RequestsRespTime      tally.Scope
	RequestsErrorRespTime tally.Scope
)
View Source
var (
	SearchOkCount       tally.Scope
	SearchErrorCount    tally.Scope
	SearchRespTime      tally.Scope
	SearchErrorRespTime tally.Scope
)
View Source
var (
	SessionOkCount       tally.Scope
	SessionErrorCount    tally.Scope
	SessionRespTime      tally.Scope
	SessionErrorRespTime tally.Scope
)
View Source
var (
	NamespaceSize  tally.Scope
	DbSize         tally.Scope
	CollectionSize tally.Scope
)

Functions

func ClearSpanMetaContext

func ClearSpanMetaContext(ctx context.Context) context.Context

func GetAuthBaseTags

func GetAuthBaseTags(ctx context.Context) map[string]string

func GetDbCollTagsForReq

func GetDbCollTagsForReq(req interface{}) map[string]string

func GetFdbBaseTags

func GetFdbBaseTags(reqMthodName string) map[string]string

func GetFdbErrorTags

func GetFdbErrorTags(reqMethodName string, code string) map[string]string

func GetFdbOkTags

func GetFdbOkTags(reqMethodName string) map[string]string

func GetGlobalTags

func GetGlobalTags() map[string]string

func GetNamespace

func GetNamespace(ctx context.Context) string

func GetSearchTags

func GetSearchTags(reqMethodName string) map[string]string

func GetSessionTags

func GetSessionTags(sessionMethodName string) map[string]string

func InitializeMetrics

func InitializeMetrics() io.Closer

func UpdateCollectionSizeMetrics

func UpdateCollectionSizeMetrics(namespaceName string, dbName string, collectionName string, size int64)

func UpdateDbSizeMetrics

func UpdateDbSizeMetrics(namespaceName string, dbName string, size int64)

func UpdateNameSpaceSizeMetrics

func UpdateNameSpaceSizeMetrics(namespaceName string, size int64)

func UpdateSpanTags

func UpdateSpanTags(ctx context.Context, qm QueryMetrics) context.Context

Types

type QueryMetrics

type QueryMetrics interface {
	GetTags() map[string]string
}

type SearchQueryMetrics

type SearchQueryMetrics struct {
	// contains filtered or unexported fields
}

func (*SearchQueryMetrics) GetTags

func (s *SearchQueryMetrics) GetTags() map[string]string

func (*SearchQueryMetrics) SetSearchType

func (s *SearchQueryMetrics) SetSearchType(value string)

func (*SearchQueryMetrics) SetSort

func (s *SearchQueryMetrics) SetSort(value bool)

type SpanMeta

type SpanMeta struct {
	// contains filtered or unexported fields
}

func NewSpanMeta

func NewSpanMeta(serviceName string, resourceName string, spanType string, tags map[string]string) *SpanMeta

func SpanMetaFromContext

func SpanMetaFromContext(ctx context.Context) (*SpanMeta, bool)

func (*SpanMeta) AddTags

func (s *SpanMeta) AddTags(tags map[string]string)

func (*SpanMeta) CountErrorForScope

func (s *SpanMeta) CountErrorForScope(scope tally.Scope, tags map[string]string)

func (*SpanMeta) CountOkForScope

func (s *SpanMeta) CountOkForScope(scope tally.Scope, tags map[string]string)

func (*SpanMeta) CountReceivedBytes

func (s *SpanMeta) CountReceivedBytes(scope tally.Scope, tags map[string]string, size int)

func (*SpanMeta) CountSentBytes

func (s *SpanMeta) CountSentBytes(scope tally.Scope, tags map[string]string, size int)

func (*SpanMeta) FinishTracing

func (s *SpanMeta) FinishTracing(ctx context.Context) context.Context

func (*SpanMeta) FinishWithError

func (s *SpanMeta) FinishWithError(ctx context.Context, source string, err error) context.Context

func (*SpanMeta) GetAuthErrorTags

func (s *SpanMeta) GetAuthErrorTags(err error) map[string]string

func (*SpanMeta) GetAuthOkTags

func (s *SpanMeta) GetAuthOkTags() map[string]string

func (*SpanMeta) GetCollectionSizeTags

func (s *SpanMeta) GetCollectionSizeTags() map[string]string

func (*SpanMeta) GetDbSizeTags

func (s *SpanMeta) GetDbSizeTags() map[string]string

func (*SpanMeta) GetFdbErrorTags

func (s *SpanMeta) GetFdbErrorTags(err error) map[string]string

func (*SpanMeta) GetFdbOkTags

func (s *SpanMeta) GetFdbOkTags() map[string]string

func (*SpanMeta) GetNamespaceSizeTags

func (s *SpanMeta) GetNamespaceSizeTags() map[string]string

func (*SpanMeta) GetNetworkTags

func (s *SpanMeta) GetNetworkTags() map[string]string

func (*SpanMeta) GetRequestErrorTags

func (s *SpanMeta) GetRequestErrorTags(err error) map[string]string

func (*SpanMeta) GetRequestOkTags

func (s *SpanMeta) GetRequestOkTags() map[string]string

func (*SpanMeta) GetResourceName

func (s *SpanMeta) GetResourceName() string

func (*SpanMeta) GetSearchErrorTags

func (s *SpanMeta) GetSearchErrorTags(err error) map[string]string

func (*SpanMeta) GetSearchOkTags

func (s *SpanMeta) GetSearchOkTags() map[string]string

func (*SpanMeta) GetServiceName

func (s *SpanMeta) GetServiceName() string

func (*SpanMeta) GetSessionErrorTags

func (s *SpanMeta) GetSessionErrorTags(err error) map[string]string

func (*SpanMeta) GetSessionOkTags

func (s *SpanMeta) GetSessionOkTags() map[string]string

func (*SpanMeta) GetSpanOptions

func (s *SpanMeta) GetSpanOptions() []tracer.StartSpanOption

func (*SpanMeta) GetTags

func (s *SpanMeta) GetTags() map[string]string

func (*SpanMeta) RecordDuration

func (s *SpanMeta) RecordDuration(scope tally.Scope, tags map[string]string)

func (*SpanMeta) RecursiveAddTags

func (s *SpanMeta) RecursiveAddTags(tags map[string]string)

func (*SpanMeta) SaveSpanMetaToContext

func (s *SpanMeta) SaveSpanMetaToContext(ctx context.Context) (context.Context, error)

func (*SpanMeta) StartTracing

func (s *SpanMeta) StartTracing(ctx context.Context, childOnly bool) context.Context

type SpanMetaCtxKey

type SpanMetaCtxKey struct {
}

type StreamingQueryMetrics

type StreamingQueryMetrics struct {
	// contains filtered or unexported fields
}

func (*StreamingQueryMetrics) GetTags

func (s *StreamingQueryMetrics) GetTags() map[string]string

func (*StreamingQueryMetrics) SetReadType

func (s *StreamingQueryMetrics) SetReadType(value string)

func (*StreamingQueryMetrics) SetSort

func (s *StreamingQueryMetrics) SetSort(value bool)

type WriteQueryMetrics

type WriteQueryMetrics struct {
	// contains filtered or unexported fields
}

func (*WriteQueryMetrics) GetTags

func (w *WriteQueryMetrics) GetTags() map[string]string

func (*WriteQueryMetrics) SetWriteType

func (w *WriteQueryMetrics) SetWriteType(value string)

Jump to

Keyboard shortcuts

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