Documentation ¶
Index ¶
- type AggregateQuery
- func (q *AggregateQuery) GetAction() string
- func (q *AggregateQuery) GetActionIf() string
- func (q *AggregateQuery) GetEntities() []string
- func (q *AggregateQuery) GetLabel() string
- func (q *AggregateQuery) GetRange() string
- func (q *AggregateQuery) GetTsEqual() uint32
- func (q *AggregateQuery) GetTsGreater() uint32
- func (q *AggregateQuery) GetTsLess() uint32
- func (q *AggregateQuery) Type() QueryType
- type ClickHouseMetrics
- func (c *ClickHouseMetrics) Aggregate(q *AggregateQuery) (interface{}, error)
- func (c *ClickHouseMetrics) Client() *sql.DB
- func (c *ClickHouseMetrics) Insert(m *Metric) error
- func (c *ClickHouseMetrics) List(q *ListQuery) ([]interface{}, error)
- func (c *ClickHouseMetrics) Query(q string) ([]*Metric, error)
- type Config
- type ListQuery
- func (q *ListQuery) GetAction() string
- func (q *ListQuery) GetActionIf() string
- func (q *ListQuery) GetEntities() []string
- func (q *ListQuery) GetLabel() string
- func (q *ListQuery) GetRange() string
- func (q *ListQuery) GetTsEqual() uint32
- func (q *ListQuery) GetTsGreater() uint32
- func (q *ListQuery) GetTsLess() uint32
- func (q *ListQuery) Type() QueryType
- type Metric
- type QueryType
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AggregateQuery ¶
type AggregateQuery struct { Action string Entities []string Label string Range string ActionIf string }
AggregateQuery defines struct for making aggregation
func (*AggregateQuery) GetAction ¶
func (q *AggregateQuery) GetAction() string
GetAction returns action
func (*AggregateQuery) GetActionIf ¶
func (q *AggregateQuery) GetActionIf() string
GetActionIf returns action if
func (*AggregateQuery) GetEntities ¶
func (q *AggregateQuery) GetEntities() []string
GetEntities returns slice of entities
func (*AggregateQuery) GetTsEqual ¶
func (q *AggregateQuery) GetTsEqual() uint32
GetTsEqual returns timestamp equal param
func (*AggregateQuery) GetTsGreater ¶
func (q *AggregateQuery) GetTsGreater() uint32
GetTsGreater returns timestamp greater param
func (*AggregateQuery) GetTsLess ¶
func (q *AggregateQuery) GetTsLess() uint32
GetTsLess returns timestamp Less param
func (*AggregateQuery) Type ¶
func (q *AggregateQuery) Type() QueryType
Type returns type of the query
type ClickHouseMetrics ¶
type ClickHouseMetrics struct {
// contains filtered or unexported fields
}
ClickHouseMetrics implements the main app
func New ¶
func New(c *Config) (*ClickHouseMetrics, error)
New provides initialization of the project
func (*ClickHouseMetrics) Aggregate ¶
func (c *ClickHouseMetrics) Aggregate(q *AggregateQuery) (interface{}, error)
Aggregate provides operations for aggregation
func (*ClickHouseMetrics) Client ¶
func (c *ClickHouseMetrics) Client() *sql.DB
Client returns current ClickHouse client
func (*ClickHouseMetrics) Insert ¶
func (c *ClickHouseMetrics) Insert(m *Metric) error
Insert provides inserting of the metrics data
func (*ClickHouseMetrics) List ¶
func (c *ClickHouseMetrics) List(q *ListQuery) ([]interface{}, error)
List retruns list of the metrics by the query
type Config ¶
type Config struct { // DBName is a name for metrics database DBName string // Address is a connection address to ClickHouse Address string }
Config applies specification to the app start
type ListQuery ¶
type ListQuery struct { Entities []string Label string TsEqual uint32 TsGreater uint32 TsLess uint32 Range string }
ListQuery provides struct for the query definition
func (*ListQuery) GetActionIf ¶
GetActionIf returns action if
func (*ListQuery) GetEntities ¶
GetEntities returns slice of entities
func (*ListQuery) GetTsEqual ¶
GetTsEqual returns timestamp equal param
func (*ListQuery) GetTsGreater ¶
GetTsGreater returns timestamp greater param