metrics

package
v1.0.0-beta.10 Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2022 License: Apache-2.0 Imports: 22 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
	QuotaMetrics   tally.Scope
	NetworkMetrics tally.Scope
	AuthMetrics    tally.Scope
)
View Source
var (
	BytesReceived tally.Scope
	BytesSent     tally.Scope
)
View Source
var (
	QuotaUsage     tally.Scope
	QuotaThrottled tally.Scope
	QuotaSet       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 ClearMeasurementContext

func ClearMeasurementContext(ctx context.Context) context.Context

func FormDatadogQuery

func FormDatadogQuery(namespace string, req *api.QueryTimeSeriesMetricsRequest) (string, error)

func FormDatadogQueryNoMeta

func FormDatadogQueryNoMeta(namespace string, noMeta bool, req *api.QueryTimeSeriesMetricsRequest) (string, error)

func GetAuthBaseTags

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

func GetDbCollTagsForReq

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

func GetFdbBaseTags

func GetFdbBaseTags(reqMethodName 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() func()

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 UpdateQuotaCurrentNodeLimit

func UpdateQuotaCurrentNodeLimit(namespaceName string, value int, isWrite bool)

func UpdateQuotaRateThrottled

func UpdateQuotaRateThrottled(namespaceName string, value int, isWrite bool)

func UpdateQuotaStorageThrottled

func UpdateQuotaStorageThrottled(namespaceName string, value int)

func UpdateQuotaUsage

func UpdateQuotaUsage(namespaceName string, value int, isWrite bool)

func UpdateSpanTags

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

Types

type Datadog

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

func InitDatadog

func InitDatadog(cfg *config.Config) *Datadog

func (*Datadog) GetCurrentMetricValue

func (d *Datadog) GetCurrentMetricValue(ctx context.Context, namespace string, metric string, tp api.TigrisOperation, avgLength time.Duration) (int64, error)

func (*Datadog) Query

func (d *Datadog) Query(ctx context.Context, from int64, to int64, query string) (*datadog.MetricsQueryResponse, error)

type Measurement

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

func MeasurementFromContext

func MeasurementFromContext(ctx context.Context) (*Measurement, bool)

func NewMeasurement

func NewMeasurement(serviceName string, resourceName string, spanType string, tags map[string]string) *Measurement

func (*Measurement) AddTags

func (m *Measurement) AddTags(tags map[string]string)

func (*Measurement) CountErrorForScope

func (m *Measurement) CountErrorForScope(scope tally.Scope, tags map[string]string)

func (*Measurement) CountOkForScope

func (m *Measurement) CountOkForScope(scope tally.Scope, tags map[string]string)

func (*Measurement) CountReceivedBytes

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

func (*Measurement) CountSentBytes

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

func (*Measurement) FinishTracing

func (m *Measurement) FinishTracing(ctx context.Context) context.Context

func (*Measurement) FinishWithError

func (m *Measurement) FinishWithError(ctx context.Context, source string, err error) context.Context

func (*Measurement) GetAuthErrorTags

func (m *Measurement) GetAuthErrorTags(err error) map[string]string

func (*Measurement) GetAuthOkTags

func (m *Measurement) GetAuthOkTags() map[string]string

func (*Measurement) GetCollectionSizeTags

func (m *Measurement) GetCollectionSizeTags() map[string]string

func (*Measurement) GetDbSizeTags

func (m *Measurement) GetDbSizeTags() map[string]string

func (*Measurement) GetFdbErrorTags

func (m *Measurement) GetFdbErrorTags(err error) map[string]string

func (*Measurement) GetFdbOkTags

func (m *Measurement) GetFdbOkTags() map[string]string

func (*Measurement) GetNamespaceSizeTags

func (m *Measurement) GetNamespaceSizeTags() map[string]string

func (*Measurement) GetNetworkTags

func (m *Measurement) GetNetworkTags() map[string]string

func (*Measurement) GetRequestErrorTags

func (m *Measurement) GetRequestErrorTags(err error) map[string]string

func (*Measurement) GetRequestOkTags

func (m *Measurement) GetRequestOkTags() map[string]string

func (*Measurement) GetResourceName

func (m *Measurement) GetResourceName() string

func (*Measurement) GetSearchErrorTags

func (m *Measurement) GetSearchErrorTags(err error) map[string]string

func (*Measurement) GetSearchOkTags

func (m *Measurement) GetSearchOkTags() map[string]string

func (*Measurement) GetServiceName

func (m *Measurement) GetServiceName() string

func (*Measurement) GetSessionErrorTags

func (m *Measurement) GetSessionErrorTags(err error) map[string]string

func (*Measurement) GetSessionOkTags

func (m *Measurement) GetSessionOkTags() map[string]string

func (*Measurement) GetSpanOptions

func (m *Measurement) GetSpanOptions() []tracer.StartSpanOption

func (*Measurement) GetTags

func (m *Measurement) GetTags() map[string]string

func (*Measurement) RecordDuration

func (m *Measurement) RecordDuration(scope tally.Scope, tags map[string]string)

func (*Measurement) RecursiveAddTags

func (m *Measurement) RecursiveAddTags(tags map[string]string)

func (*Measurement) SaveMeasurementToContext

func (m *Measurement) SaveMeasurementToContext(ctx context.Context) (context.Context, error)

func (*Measurement) StartTracing

func (m *Measurement) StartTracing(ctx context.Context, childOnly bool) context.Context

type MeasurementCtxKey

type MeasurementCtxKey struct{}

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 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