mometric

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Jun 30, 2023 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MetricDBConst    = metric.MetricDBConst
	SqlCreateDBConst = "create database if not exists " + MetricDBConst
	SqlDropDBConst   = "drop database if exists " + MetricDBConst
	ALL_IN_ONE_MODE  = "monolithic"
)
View Source
const CHAN_CAPACITY = 10000

Variables

View Source
var SingleMetricTable = &table.Table{
	Account:          table.AccountSys,
	Database:         MetricDBConst,
	Table:            `metric`,
	Columns:          []table.Column{metricNameColumn, metricCollectTimeColumn, metricValueColumn, metricNodeColumn, metricRoleColumn, metricAccountColumn, metricTypeColumn},
	PrimaryKeyColumn: []table.Column{},
	ClusterBy:        []table.Column{metricCollectTimeColumn, metricNameColumn, metricAccountColumn},
	Engine:           table.NormalTableEngine,
	Comment:          `metric data`,
	PathBuilder:      table.NewAccountDatePathBuilder(),
	AccountColumn:    &metricAccountColumn,

	SupportUserAccess: true,

	SupportConstAccess: true,
}

Functions

func GetMetricViewWithLabels

func GetMetricViewWithLabels(ctx context.Context, tbl string, lbls []string) *table.View

func GetSchemaForAccount

func GetSchemaForAccount(ctx context.Context, account string) []string

GetSchemaForAccount return account's table, and view's schema

func InitMetric

func InitMetric(ctx context.Context, ieFactory func() ie.InternalExecutor, SV *config.ObservabilityParameters, nodeUUID, role string, opts ...InitOption)

func InitSchema

func InitSchema(ctx context.Context, ieFactory func() ie.InternalExecutor) error

func NewMetricView

func NewMetricView(tbl string, opts ...table.ViewOption) *table.View

func NewMetricViewWithLabels

func NewMetricViewWithLabels(ctx context.Context, tbl string, lbls []string) *table.View

func StopMetricSync

func StopMetricSync()

Types

type ExportMultiTable

type ExportMultiTable bool

func (ExportMultiTable) ApplyTo

func (x ExportMultiTable) ApplyTo(o *collectorOpts)

type InitOption

type InitOption func(*InitOptions)

func WithInitAction

func WithInitAction(init bool) InitOption

func WithWriterFactory

func WithWriterFactory(factory table.WriterFactory) InitOption

func (InitOption) ApplyTo

func (f InitOption) ApplyTo(opts *InitOptions)

type InitOptions

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

type MetricCollector

type MetricCollector interface {
	SendMetrics(context.Context, []*pb.MetricFamily) error
	Start(context.Context) bool
	Stop(graceful bool) (<-chan struct{}, bool)
}

type StatsLogWriter

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

func (*StatsLogWriter) Start

func (e *StatsLogWriter) Start(inputCtx context.Context) bool

func (*StatsLogWriter) Stop

func (e *StatsLogWriter) Stop(_ bool) (<-chan struct{}, bool)

type WithFlushInterval

type WithFlushInterval time.Duration

func (WithFlushInterval) ApplyTo

func (x WithFlushInterval) ApplyTo(o *collectorOpts)

type WithMetricThreshold

type WithMetricThreshold int

func (WithMetricThreshold) ApplyTo

func (x WithMetricThreshold) ApplyTo(o *collectorOpts)

type WithSampleThreshold

type WithSampleThreshold int

func (WithSampleThreshold) ApplyTo

func (x WithSampleThreshold) ApplyTo(o *collectorOpts)

type WithSqlWorkerNum

type WithSqlWorkerNum int

func (WithSqlWorkerNum) ApplyTo

func (x WithSqlWorkerNum) ApplyTo(o *collectorOpts)

Jump to

Keyboard shortcuts

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