metrics

package
v1.0.0-beta.60 Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2023 License: Apache-2.0 Imports: 27 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
	SchemaMetrics  tally.Scope
	GlobalSt       *GlobalStatus
)
View Source
var (
	BytesReceived tally.Scope
	BytesSent     tally.Scope
)
View Source
var (
	QuotaUsage     tally.Scope
	QuotaThrottled tally.Scope
	QuotaSet       tally.Scope
	QuotaCurRates  tally.Scope
)
View Source
var (
	RequestsOkCount               tally.Scope
	RequestsErrorCount            tally.Scope
	RequestsRespTime              tally.Scope
	RequestsErrorRespTime         tally.Scope
	RequestsReadBytes             tally.Scope
	RequestsReadUnits             tally.Scope
	RequestsWriteBytes            tally.Scope
	RequestsWriteUnits            tally.Scope
	RequestsDDLDropUnits          tally.Scope
	RequestsDDLUpdateUnits        tally.Scope
	RequestsDDLCreateUnits        tally.Scope
	RequestsApiSearchUnits        tally.Scope
	RequestsCollectionSearchUnits 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 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 GetProjectBranchCollTags

func GetProjectBranchCollTags(project string, branch string, collection string) map[string]string

func GetSearchTags

func GetSearchTags(reqMethodName string) map[string]string

func GetSessionTags

func GetSessionTags(sessionMethodName string) map[string]string

func GetTenantNameTagValue

func GetTenantNameTagValue(namespace string, namespaceName string) string

func InitializeMetrics

func InitializeMetrics() func()

func SchemaReadOutdated

func SchemaReadOutdated(project string, branch string, collection string)

func SchemaUpdateRepaired

func SchemaUpdateRepaired(project string, branch string, collection string)

func UpdateCollectionSizeMetrics

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

func UpdateDbSizeMetrics

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

func UpdateNameSpaceSizeMetrics

func UpdateNameSpaceSizeMetrics(namespace string, namespaceName string, size int64)

func UpdateQuotaCurrentNodeLimit

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

func UpdateQuotaCurrentRatesReceivedLimit

func UpdateQuotaCurrentRatesReceivedLimit(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 GlobalStatus

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

func NewGlobalStatus

func NewGlobalStatus() *GlobalStatus

func (*GlobalStatus) Flush

func (*GlobalStatus) RecordRequestToActiveChunk

func (g *GlobalStatus) RecordRequestToActiveChunk(r *RequestStatus, tenantName string)

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

func (m *Measurement) AddProjectBranchCollTags(project string, branch string, coll string)

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

func (m *Measurement) CountUnits(reqStatus *RequestStatus, tags map[string]string)

func (*Measurement) FinishTracing

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

func (*Measurement) FinishWithError

func (m *Measurement) FinishWithError(ctx context.Context, 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) GetProjectCollTags

func (m *Measurement) GetProjectCollTags() 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() []ddtracer.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 RequestStatus

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

func NewRequestStatus

func NewRequestStatus(tenantName string) *RequestStatus

func RequestStatusFromContext

func RequestStatusFromContext(ctx context.Context) (*RequestStatus, bool)

func (*RequestStatus) AddCollectionSearchUnit

func (r *RequestStatus) AddCollectionSearchUnit()

func (*RequestStatus) AddDDLCreateUnit

func (r *RequestStatus) AddDDLCreateUnit()

func (*RequestStatus) AddDDLDropUnit

func (r *RequestStatus) AddDDLDropUnit()

func (*RequestStatus) AddDDLUpdateUnit

func (r *RequestStatus) AddDDLUpdateUnit()

func (*RequestStatus) AddReadBytes

func (r *RequestStatus) AddReadBytes(value int64)

func (*RequestStatus) AddSearchCreateIndexUnit

func (r *RequestStatus) AddSearchCreateIndexUnit()

func (*RequestStatus) AddSearchDeleteDocumentUnit

func (r *RequestStatus) AddSearchDeleteDocumentUnit(count int)

func (*RequestStatus) AddSearchDropIndexUnit

func (r *RequestStatus) AddSearchDropIndexUnit()

func (*RequestStatus) AddSearchUnit

func (r *RequestStatus) AddSearchUnit()

func (*RequestStatus) AddWriteBytes

func (r *RequestStatus) AddWriteBytes(value int64)

func (*RequestStatus) ClearRequestStatusFromContext

func (r *RequestStatus) ClearRequestStatusFromContext(ctx context.Context) context.Context

func (*RequestStatus) GetApiSearchUnits

func (r *RequestStatus) GetApiSearchUnits() int64

func (*RequestStatus) GetCollectionSearchUnits

func (r *RequestStatus) GetCollectionSearchUnits() int64

func (*RequestStatus) GetDDLCreateUnits

func (r *RequestStatus) GetDDLCreateUnits() int64

func (*RequestStatus) GetDDLDropUnits

func (r *RequestStatus) GetDDLDropUnits() int64

func (*RequestStatus) GetDDLUpdateUnits

func (r *RequestStatus) GetDDLUpdateUnits() int64

func (*RequestStatus) GetReadBytes

func (r *RequestStatus) GetReadBytes() int64

func (*RequestStatus) GetSearchCreateIndexUnits

func (r *RequestStatus) GetSearchCreateIndexUnits() int64

func (*RequestStatus) GetSearchDeleteDocumentUnits

func (r *RequestStatus) GetSearchDeleteDocumentUnits() int64

func (*RequestStatus) GetSearchDropIndexUnits

func (r *RequestStatus) GetSearchDropIndexUnits() int64

func (*RequestStatus) GetWriteBytes

func (r *RequestStatus) GetWriteBytes() int64

func (*RequestStatus) IsApiSearch

func (r *RequestStatus) IsApiSearch() bool

func (*RequestStatus) IsCollectionSearch

func (r *RequestStatus) IsCollectionSearch() bool

func (*RequestStatus) IsKeySecondaryIndex

func (r *RequestStatus) IsKeySecondaryIndex(fdbKey []byte) bool

func (*RequestStatus) IsSecondaryIndexFieldIgnored

func (r *RequestStatus) IsSecondaryIndexFieldIgnored(fdbKey []byte) bool

func (*RequestStatus) SaveRequestStatusToContext

func (r *RequestStatus) SaveRequestStatusToContext(ctx context.Context) context.Context

func (*RequestStatus) SetApiSearchType

func (r *RequestStatus) SetApiSearchType()

func (*RequestStatus) SetCollectionSearchType

func (r *RequestStatus) SetCollectionSearchType()

func (*RequestStatus) SetReadBytes

func (r *RequestStatus) SetReadBytes(value int64)

func (*RequestStatus) SetWriteBytes

func (r *RequestStatus) SetWriteBytes(value int64)

type RequestStatusCtxKey

type RequestStatusCtxKey struct{}

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 TenantStatus

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

func NewTenantStatus

func NewTenantStatus() *TenantStatus

type TenantStatusTimeChunk

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

func NewTenantStatusTimeChunk

func NewTenantStatusTimeChunk(startTime time.Time) *TenantStatusTimeChunk

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