metricmeta

package
v1.3.0-rc Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2021 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	InfluxFormat = "influx"
	DotFormat    = "dot"
)

formats .

View Source
const (
	NumberType      = "number"
	BoolType        = "bool"
	StringType      = "string"
	NumberArrayType = "number_array"
	StringArrayType = "string_array"
	BoolArrayType   = "bool_array"
)

type names

View Source
const (
	TableMetricMeta = "sp_metric_meta"
)

tables name

Variables

This section is empty.

Functions

This section is empty.

Types

type DatabaseGroupProvider

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

func NewDatabaseGroupProvider

func NewDatabaseGroupProvider(db *gorm.DB, log logs.Logger) (*DatabaseGroupProvider, error)

func (*DatabaseGroupProvider) Groups

func (p *DatabaseGroupProvider) Groups(langCodes i18n.LanguageCodes, t i18n.Translator, scope, scopeID string, ms map[string]*pb.MetricMeta) (groups []*pb.Group, err error)

func (*DatabaseGroupProvider) MappingsByID

func (p *DatabaseGroupProvider) MappingsByID(id, scope, scopeID string, names []string, ms map[string]*pb.MetricMeta) (gmm []*GroupMetricMap, err error)

type DatabaseMetaProvider

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

func NewDatabaseMetaProvider

func NewDatabaseMetaProvider(db *gorm.DB, log logs.Logger) (*DatabaseMetaProvider, error)

func (*DatabaseMetaProvider) MetricMeta

func (p *DatabaseMetaProvider) MetricMeta(langCodes i18n.LanguageCodes, i18n i18n.I18n, scope, scopeID string, names ...string) (map[string]*pb.MetricMeta, error)

type FileGroupProvider

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

FileGroupProvider .

func NewFileGroupProvider

func NewFileGroupProvider(files []string, log logs.Logger) (*FileGroupProvider, error)

NewFileGroupProvider .

func (*FileGroupProvider) Groups

func (p *FileGroupProvider) Groups(langCodes i18n.LanguageCodes, t i18n.Translator, scope, scopeID string, ms map[string]*pb.MetricMeta) (groups []*pb.Group, err error)

Groups .

func (*FileGroupProvider) MappingsByID

func (p *FileGroupProvider) MappingsByID(id, scope, scopeID string, metric []string, ms map[string]*pb.MetricMeta) (gmm []*GroupMetricMap, err error)

MappingsByID .

type FileMetricMetaProvider

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

FileMetricMetaProvider .

func NewFileMetricMetaProvider

func NewFileMetricMetaProvider(path string, log logs.Logger) (*FileMetricMetaProvider, error)

NewFileMetricMetaProvider .

func (*FileMetricMetaProvider) MetricMeta

func (p *FileMetricMetaProvider) MetricMeta(langCodes i18n.LanguageCodes, i i18n.I18n, scope, scopeID string, names ...string) (map[string]*pb.MetricMeta, error)

MetricMeta .

type GroupMetricMap

type GroupMetricMap struct {
	Name            string          `json:"name"`
	Filters         []*pb.TagFilter `json:"filters"`
	Fields          []string        `json:"fields"`
	Tags            []string        `json:"tags"`
	AddTagsToFields bool            `json:"add_tags_to_fields"`
}

GroupMetricMap .

type GroupProvider

type GroupProvider interface {
	MappingsByID(id, scope, scopeID string, metric []string, ms map[string]*pb.MetricMeta) ([]*GroupMetricMap, error)
	Groups(langCodes i18n.LanguageCodes, t i18n.Translator, scope, scopeID string, ms map[string]*pb.MetricMeta) ([]*pb.Group, error)
}

GroupProvider .

type IndexMappingsGroupProvider

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

IndexMappingsGroupProvider .

func NewIndexMappingsGroupProvider

func NewIndexMappingsGroupProvider(index indexmanager.Index) (*IndexMappingsGroupProvider, error)

NewIndexMappingsGroupProvider .

func (*IndexMappingsGroupProvider) Groups

func (p *IndexMappingsGroupProvider) Groups(langCodes i18n.LanguageCodes, t i18n.Translator, scope, scopeID string, ms map[string]*pb.MetricMeta) (groups []*pb.Group, err error)

Groups .

func (*IndexMappingsGroupProvider) MappingsByID

func (p *IndexMappingsGroupProvider) MappingsByID(id, scope, scopeID string, names []string, ms map[string]*pb.MetricMeta) (gmm []*GroupMetricMap, err error)

MappingsByID .

type IndexMappingsMetricMetaProvider

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

IndexMappingsMetricMetaProvider .

func NewIndexMappingsMetricMetaProvider

func NewIndexMappingsMetricMetaProvider(index indexmanager.Index) (*IndexMappingsMetricMetaProvider, error)

NewIndexMappingsMetricMetaProvider .

func (*IndexMappingsMetricMetaProvider) MetricMeta

func (p *IndexMappingsMetricMetaProvider) MetricMeta(langCodes i18n.LanguageCodes, i i18n.I18n, scope, scopeID string, names ...string) (map[string]*pb.MetricMeta, error)

MetricMeta .

type Manager

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

Manager .

func NewManager

func NewManager(ms []string, db *gorm.DB, index indexmanager.Index, metaPath string, groupFiles []string, i18n i18n.I18n, log logs.Logger) *Manager

NewManager .

func (*Manager) AggName

func (m *Manager) AggName(langCodes i18n.LanguageCodes, text string) string

AggName .

func (*Manager) GetSingleAggregationMeta

func (m *Manager) GetSingleAggregationMeta(langCodes i18n.LanguageCodes, mode, name string) (agg *pb.Aggregation, err error)

GetSingleAggregationMeta .

func (*Manager) GetSingleMetricsMeta

func (m *Manager) GetSingleMetricsMeta(langCodes i18n.LanguageCodes, scope string, scopeID string, metric string) (*pb.MetricMeta, error)

func (*Manager) Init

func (m *Manager) Init() error

Init .

func (*Manager) MetricGroup

func (m *Manager) MetricGroup(langCodes i18n.LanguageCodes, scope, scopeID, id, mode, format string, appendTags bool) (*pb.MetricGroup, error)

func (*Manager) MetricGroups

func (m *Manager) MetricGroups(langs i18n.LanguageCodes, scope, scopeID, mode string) ([]*pb.Group, error)

func (*Manager) MetricMeta

func (m *Manager) MetricMeta(langCodes i18n.LanguageCodes, scope, scopeID string, names ...string) ([]*pb.MetricMeta, error)

func (*Manager) MetricNames

func (m *Manager) MetricNames(langCodes i18n.LanguageCodes, scope, scopeID string) (names []*pb.NameDefine, err error)

func (*Manager) RegeistMetricMeta

func (m *Manager) RegeistMetricMeta(scope, scopeID, group string, metrics ...*pb.MetricMeta) error

func (*Manager) UnregeistMetricMeta

func (m *Manager) UnregeistMetricMeta(scope, scopeID, group string, metrics ...string) error

type MetaIndexGroupProvider

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

MetaIndexGroupProvider .

func NewMetaIndexGroupProvider

func NewMetaIndexGroupProvider(index indexmanager.Index) (*MetaIndexGroupProvider, error)

NewMetaIndexGroupProvider .

func (*MetaIndexGroupProvider) Groups

func (p *MetaIndexGroupProvider) Groups(langCodes i18n.LanguageCodes, t i18n.Translator, scope, scopeID string, ms map[string]*pb.MetricMeta) (groups []*pb.Group, err error)

Groups .

func (*MetaIndexGroupProvider) MappingsByID

func (p *MetaIndexGroupProvider) MappingsByID(id, scope, scopeID string, names []string, ms map[string]*pb.MetricMeta) (gmm []*GroupMetricMap, err error)

MappingsByID .

type MetaIndexMetricMetaProvider

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

MetaIndexMetricMetaProvider .

func NewMetaIndexMetricMetaProvider

func NewMetaIndexMetricMetaProvider(index indexmanager.Index, log logs.Logger) (*MetaIndexMetricMetaProvider, error)

NewMetaIndexMetricMetaProvider .

func (*MetaIndexMetricMetaProvider) MetricMeta

func (p *MetaIndexMetricMetaProvider) MetricMeta(langCodes i18n.LanguageCodes, i i18n.I18n, scope, scopeID string, names ...string) (map[string]*pb.MetricMeta, error)

MetricMeta .

type MetaSource

type MetaSource string

MetaSource .

const (
	MappingsMetaSource MetaSource = "mappings"
	IndexMetaSource    MetaSource = "index"
	FileMetaSource     MetaSource = "file"
	DatabaseMetaSource MetaSource = "database"
)

MetaSource values

type MetricMeta

type MetricMeta struct {
	ID         int       `gorm:"column:id"`
	Scope      string    `gorm:"column:scope"`
	ScopeID    string    `gorm:"column:scope_id"`
	Group      string    `gorm:"column:group"`
	Metric     string    `gorm:"column:metric"`
	Name       string    `gorm:"column:name"`
	Tags       string    `gorm:"column:tags"`
	Fields     string    `gorm:"column:fields"`
	CreateTime time.Time `gorm:"column:create_time"`
	UpdateTime time.Time `gorm:"column:update_time"`
}

func (MetricMeta) TableName

func (MetricMeta) TableName() string

type MetricMetaProvider

type MetricMetaProvider interface {
	MetricMeta(langCodes i18n.LanguageCodes, i i18n.I18n, scope, scopeID string, names ...string) (map[string]*pb.MetricMeta, error)
}

Jump to

Keyboard shortcuts

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