metajournal

package
v1.0.0-beta1 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2022 License: MPL-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultMetaTimeout = 2 * time.Second
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AggLog

type AggLog func(typ string, key0 string, key1 string, key2 string, key3 string, key4 string, key5 string, message string)

type ApplyEvent

type ApplyEvent func(newEntries []tlmetadata.Event)

type ApplyPromConfig

type ApplyPromConfig func(configString string, version int64)

type GroupWithMetricsList

type GroupWithMetricsList struct {
	Group   *format.MetricsGroup
	Metrics []string
}

type Journal

type Journal struct {
	MetricsMu sync.Mutex

	BuiltinLongPollImmediateOK    data_model.ItemValue
	BuiltinLongPollImmediateError data_model.ItemValue
	BuiltinLongPollEnqueue        data_model.ItemValue
	BuiltinLongPollDelayedOK      data_model.ItemValue
	BuiltinLongPollDelayedError   data_model.ItemValue

	BuiltinJournalUpdateOK    data_model.ItemValue
	BuiltinJournalUpdateError data_model.ItemValue
	// contains filtered or unexported fields
}

func MakeJournal

func MakeJournal(namespaceSuffix string, dc *pcache.DiskCache, applyEvent ApplyEvent) *Journal

func (*Journal) HandleGetMetrics

func (ms *Journal) HandleGetMetrics(_ context.Context, hctx *rpc.HandlerContext, args tlstatshouse.GetMetrics2) error

func (*Journal) HandleGetMetrics3

func (ms *Journal) HandleGetMetrics3(_ context.Context, hctx *rpc.HandlerContext, args tlstatshouse.GetMetrics3) error

func (*Journal) LoadJournal

func (ms *Journal) LoadJournal(ctx context.Context, lastVersion int64, returnIfEmpty bool) ([]tlmetadata.Event, int64, error)

func (*Journal) Start

func (ms *Journal) Start(sh2 *agent.Agent, a AggLog, metaLoader MetricsStorageLoader)

func (*Journal) StateHash

func (ms *Journal) StateHash() string

func (*Journal) Version

func (ms *Journal) Version() int64

func (*Journal) WaitVersion

func (ms *Journal) WaitVersion(ctx context.Context, version int64) error

type MetadataMock

type MetadataMock struct {
	Data map[string]int32
	// contains filtered or unexported fields
}

func NewMetadataMock

func NewMetadataMock() *MetadataMock

func (*MetadataMock) Handle

func (m *MetadataMock) Handle(ctx context.Context, hctx *rpc.HandlerContext) error

type MetricMetaLoader

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

func NewMetricMetaLoader

func NewMetricMetaLoader(client *tlmetadata.Client, loadTimeout time.Duration) *MetricMetaLoader

func (*MetricMetaLoader) GetTagMapping

func (l *MetricMetaLoader) GetTagMapping(ctx context.Context, tag string, metricName string, create bool) (int32, int32, time.Duration, error)

func (*MetricMetaLoader) LoadJournal

func (l *MetricMetaLoader) LoadJournal(ctx context.Context, lastVersion int64, returnIfEmpty bool) ([]tlmetadata.Event, int64, error)

func (*MetricMetaLoader) LoadOrCreateMapping

func (l *MetricMetaLoader) LoadOrCreateMapping(ctxParent context.Context, key string, metricName interface{}) (pcache.Value, time.Duration, error)

adapter for disk cache

func (*MetricMetaLoader) PutTagMapping

func (l *MetricMetaLoader) PutTagMapping(ctx context.Context, tag string, id int32) error

func (*MetricMetaLoader) ResetFlood

func (l *MetricMetaLoader) ResetFlood(ctx context.Context, metricName string) (bool, error)

func (*MetricMetaLoader) SaveDashboard

func (l *MetricMetaLoader) SaveDashboard(ctx context.Context, value format.DashboardMeta, create, remove bool) (format.DashboardMeta, error)

func (*MetricMetaLoader) SaveMetric

func (*MetricMetaLoader) SaveMetricsGroup

func (l *MetricMetaLoader) SaveMetricsGroup(ctx context.Context, value format.MetricsGroup, create, delete bool) (g format.MetricsGroup, _ error)

func (*MetricMetaLoader) SavePromConfig

func (l *MetricMetaLoader) SavePromConfig(ctx context.Context, version int64, config string) (tlmetadata.Event, error)

type MetricsStorage

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

func MakeMetricsStorage

func MakeMetricsStorage(namespaceSuffix string, dc *pcache.DiskCache, applyPromConfig ApplyPromConfig) *MetricsStorage

func (*MetricsStorage) ApplyEvent

func (ms *MetricsStorage) ApplyEvent(newEntries []tlmetadata.Event)

func (*MetricsStorage) GetDashboardList

func (ms *MetricsStorage) GetDashboardList() []*format.DashboardMeta

func (*MetricsStorage) GetDashboardMeta

func (ms *MetricsStorage) GetDashboardMeta(dashboardID int32) *format.DashboardMeta

func (*MetricsStorage) GetGroup

func (ms *MetricsStorage) GetGroup(id int32) *format.MetricsGroup

func (*MetricsStorage) GetGroupWithMetricsList

func (ms *MetricsStorage) GetGroupWithMetricsList(id int32) (GroupWithMetricsList, bool)

func (*MetricsStorage) GetGroupsList

func (ms *MetricsStorage) GetGroupsList() []*format.MetricsGroup

func (*MetricsStorage) GetMetaMetric

func (ms *MetricsStorage) GetMetaMetric(metricID int32) *format.MetricMetaValue

func (*MetricsStorage) GetMetaMetricByName

func (ms *MetricsStorage) GetMetaMetricByName(metricName string) *format.MetricMetaValue

func (*MetricsStorage) GetMetaMetricByNameBytes

func (ms *MetricsStorage) GetMetaMetricByNameBytes(metric []byte) *format.MetricMetaValue

func (*MetricsStorage) GetMetaMetricList

func (ms *MetricsStorage) GetMetaMetricList(includeInvisible bool) []*format.MetricMetaValue

func (*MetricsStorage) Journal

func (ms *MetricsStorage) Journal() *Journal

func (*MetricsStorage) PromConfig

func (ms *MetricsStorage) PromConfig() tlmetadata.Event

func (*MetricsStorage) StateHash

func (ms *MetricsStorage) StateHash() string

func (*MetricsStorage) Version

func (ms *MetricsStorage) Version() int64

satisfy format.MetaStorageInterface

type MetricsStorageLoader

type MetricsStorageLoader func(ctx context.Context, lastVersion int64, returnIfEmpty bool) ([]tlmetadata.Event, int64, error)

type MetricsVersionClient

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

type MetricsVersionClient3

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

Jump to

Keyboard shortcuts

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