Documentation ¶
Index ¶
- Constants
- Variables
- func ColumnNameSwap(args []interface{}) func(result *common.Result) error
- func FormatInnerTime(m *view.Model)
- func FormatLimit(m *view.Model)
- func FormatModel(m *view.Model)
- func GetDatabases() *common.Result
- func GetDefaultAlias(name string, args []string) string
- func GetMetricIDFilter(db, table string) (view.Node, error)
- func GetNotNullFilter(name string, asTagMap map[string]string, db, table string) (view.Node, bool)
- func GetPrometheusAllTagTranslator(table string) (string, string, error)
- func GetPrometheusFilter(promTag, table, op, value string) (string, error)
- func GetPrometheusGroup(name, table string, asTagMap map[string]string) string
- func GetPrometheusNotNullFilter(name, table string, asTagMap map[string]string) (view.Node, bool)
- func GetPrometheusSingleTagTranslator(tag, table string) (string, string, error)
- func GetRemoteReadFilter(promTag, table, op, value, originFilter string, e *CHEngine) (string, error)
- func GetTables(db string, ctx context.Context) *common.Result
- func GetVirtualTableFilter(db, table string) (view.Node, bool)
- func LoadDbDescriptions(dbDescriptions map[string]interface{}) error
- func MacTranslate(args []interface{}) func(result *common.Result) error
- func TimeFill(args []interface{}) func(result *common.Result) error
- func TransWhereTagFunction(db string, name string, args []string) (filter string)
- type AggFunction
- type BinaryFunction
- type CHEngine
- func (e *CHEngine) AddGroup(group string) error
- func (e *CHEngine) AddTable(table string)
- func (e *CHEngine) AddTag(tag string, alias string) (string, error)
- func (e *CHEngine) ExecuteQuery(args *common.QuerierParams) (*common.Result, map[string]interface{}, error)
- func (e *CHEngine) Init()
- func (e *CHEngine) ParseShowSql(sql string) (*common.Result, []string, bool, error)
- func (e *CHEngine) ParseSlimitSql(sql string) (string, map[string]func(*common.Result) error, map[string]*common.ColumnSchema, ...)
- func (e *CHEngine) ParseWithSql(sql string) (string, map[string]func(*common.Result) error, map[string]*common.ColumnSchema, ...)
- func (e *CHEngine) QuerySlimitSql(sql string, args *common.QuerierParams) (*common.Result, map[string]interface{}, error)
- func (e *CHEngine) QueryWithSql(sql string, args *common.QuerierParams) (*common.Result, map[string]interface{}, error)
- func (e *CHEngine) SetLevelFlag(flag int)
- func (e *CHEngine) ToSQLString() string
- func (e *CHEngine) TransDerivativeGroupBy(groups sqlparser.GroupBy) error
- func (e *CHEngine) TransFrom(froms sqlparser.TableExprs) error
- func (e *CHEngine) TransGroupBy(groups sqlparser.GroupBy) error
- func (e *CHEngine) TransHaving(node *sqlparser.Where) error
- func (e *CHEngine) TransLimit(limit *sqlparser.Limit) error
- func (e *CHEngine) TransOrderBy(orders sqlparser.OrderBy) error
- func (e *CHEngine) TransPrometheusTargetIDFilter(expr view.Node) (view.Node, error)
- func (e *CHEngine) TransSelect(tags sqlparser.SelectExprs) error
- func (e *CHEngine) TransWhere(node *sqlparser.Where) error
- type Callback
- type Field
- type FieldFunction
- type Function
- type GroupTag
- type Having
- type PrometheusSubqueryCache
- type SelectTag
- type Statement
- func GetAggFunc(name string, args []string, alias string, db string, table string, ...) (Statement, int, string, error)
- func GetDefaultTag(name string, alias string) Statement
- func GetGroup(name string, asTagMap map[string]string, db, table string) ([]Statement, error)
- func GetMetricsTag(name string, alias string, db string, table string, ctx context.Context) (Statement, error)
- func GetTagFunction(name string, args []string, alias, db, table string) (Statement, error)
- func GetTagTranslator(name, alias, db, table string) ([]Statement, string, error)
- func GetTopKTrans(name string, args []string, alias string, db string, table string, ...) (Statement, int, string, error)
- type Table
- type TagFunction
- type TargetLabelFilter
- type Time
- type TimeIntervalField
- type TimeTag
- type Where
- type WhereFunction
- type WhereStatement
- type WhereTag
Constants ¶
View Source
const ( TAG_FUNCTION_NODE_TYPE = "node_type" TAG_FUNCTION_ICON_ID = "icon_id" TAG_FUNCTION_MASK = "mask" TAG_FUNCTION_TIME = "time" TAG_FUNCTION_TO_UNIX_TIMESTAMP_64_MICRO = "toUnixTimestamp64Micro" TAG_FUNCTION_TO_UNIX_TIMESTAMP = "toUnixTimestamp" TAG_FUNCTION_TO_STRING = "toString" TAG_FUNCTION_IF = "if" TAG_FUNCTION_UNIQ = "uniq" TAG_FUNCTION_ANY = "any" TAG_FUNCTION_TOPK = "topK" TAG_FUNCTION_NEW_TAG = "newTag" TAG_FUNCTION_ENUM = "enum" TAG_FUNCTION_FAST_FILTER = "FastFilter" TAG_FUNCTION_FAST_TRANS = "FastTrans" )
View Source
const INTERVAL_1D = 86400
Variables ¶
View Source
var DEFAULT_LIMIT = "10000"
View Source
var INVALID_PROMETHEUS_SUBQUERY_CACHE_ENTRY = "-1"
View Source
var TAG_FUNCTIONS = []string{ TAG_FUNCTION_NODE_TYPE, TAG_FUNCTION_ICON_ID, TAG_FUNCTION_MASK, TAG_FUNCTION_TIME, TAG_FUNCTION_TO_UNIX_TIMESTAMP_64_MICRO, TAG_FUNCTION_TO_STRING, TAG_FUNCTION_IF, TAG_FUNCTION_UNIQ, TAG_FUNCTION_ANY, TAG_FUNCTION_TOPK, TAG_FUNCTION_TO_UNIX_TIMESTAMP, TAG_FUNCTION_NEW_TAG, TAG_FUNCTION_ENUM, TAG_FUNCTION_FAST_FILTER, TAG_FUNCTION_FAST_TRANS, }
View Source
var TIME_FILL_LIMIT_DEFAULT = 20
Functions ¶
func ColumnNameSwap ¶
func FormatInnerTime ¶
func FormatLimit ¶
func FormatModel ¶
func GetDatabases ¶
func GetDefaultAlias ¶
func GetNotNullFilter ¶
func GetPrometheusFilter ¶
func GetPrometheusGroup ¶
func GetRemoteReadFilter ¶
func LoadDbDescriptions ¶
func MacTranslate ¶
Types ¶
type AggFunction ¶
type AggFunction struct { // 指标量内容 Metrics *metrics.Metrics // 解析获得的参数 Name string Args []string Alias string IsDerivative bool DerivativeArgs []string DerivativeGroupBy []string }
func (*AggFunction) Format ¶
func (f *AggFunction) Format(m *view.Model)
func (*AggFunction) FormatInnerTag ¶
func (f *AggFunction) FormatInnerTag(m *view.Model) (innerAlias string)
func (*AggFunction) SetAlias ¶
func (f *AggFunction) SetAlias(alias string)
type BinaryFunction ¶
func GetBinaryFunc ¶
func GetBinaryFunc(name string, args []Function) (*BinaryFunction, error)
func (*BinaryFunction) Format ¶
func (f *BinaryFunction) Format(m *view.Model)
func (*BinaryFunction) SetAlias ¶
func (f *BinaryFunction) SetAlias(alias string)
type CHEngine ¶
type CHEngine struct { Model *view.Model Statements []Statement DB string Table string DataSource string AsTagMap map[string]string ColumnSchemas []*common.ColumnSchema View *view.View Context context.Context TargetLabelFilters []TargetLabelFilter NoPreWhere bool IsDerivative bool DerivativeGroupBy []string }
func (*CHEngine) ExecuteQuery ¶
func (*CHEngine) ParseShowSql ¶
func (*CHEngine) ParseSlimitSql ¶
func (*CHEngine) ParseWithSql ¶
func (*CHEngine) QuerySlimitSql ¶
func (*CHEngine) QueryWithSql ¶
func (*CHEngine) SetLevelFlag ¶
func (*CHEngine) TransDerivativeGroupBy ¶
func (*CHEngine) TransPrometheusTargetIDFilter ¶
func (*CHEngine) TransSelect ¶
func (e *CHEngine) TransSelect(tags sqlparser.SelectExprs) error
type Callback ¶
type FieldFunction ¶
type FieldFunction interface { Function }
func GetFieldFunc ¶
func GetFieldFunc(name string) (FieldFunction, error)
type PrometheusSubqueryCache ¶
type PrometheusSubqueryCache struct {
PrometheusSubqueryCache *lru.Cache[string, common.EntryValue]
}
func GetPrometheusSubqueryCache ¶
func GetPrometheusSubqueryCache() *PrometheusSubqueryCache
type Statement ¶
翻译单元,翻译结果写入view.Model
func GetAggFunc ¶
func GetDefaultTag ¶
func GetMetricsTag ¶
func GetTagFunction ¶
func GetTagTranslator ¶
type TagFunction ¶
type TagFunction struct { Name string Args []string Alias string Withs []view.Node Value string DB string Table string }
func (*TagFunction) Check ¶
func (f *TagFunction) Check() error
func (*TagFunction) Format ¶
func (f *TagFunction) Format(m *view.Model)
func (*TagFunction) SetAlias ¶
func (f *TagFunction) SetAlias(alias string)
type TargetLabelFilter ¶
type Time ¶
type TimeIntervalField ¶
type TimeIntervalField struct {
FieldFunction
}
func (*TimeIntervalField) Format ¶
func (f *TimeIntervalField) Format(m *view.Model)
func (*TimeIntervalField) SetAlias ¶
func (f *TimeIntervalField) SetAlias(alias string)
type WhereFunction ¶
type WhereStatement ¶
func GetWhere ¶
func GetWhere(name, value string) WhereStatement
Source Files ¶
Click to show internal directories.
Click to hide internal directories.