Documentation
¶
Overview ¶
Package dal is the Data Access Layer between the Application and PostgreSQL database.
Index ¶
- Variables
- type Base
- type TSEvent
- func (ts *TSEvent) AllBandsByClusterIDAndCreatedFromRangeForHighchart(clusterID, from, to int64) ([]shared.TSEventHighchartLinePayload, error)
- func (ts *TSEvent) AllLinesByClusterIDAndCreatedFromRangeForHighchart(clusterID, from, to int64) ([]shared.TSEventHighchartLinePayload, error)
- func (ts *TSEvent) CreateFromJSON(id, clusterID int64, jsonData []byte, ttl time.Duration) (*TSEventRow, error)
- func (ts *TSEvent) DeleteByClusterIDAndID(clusterID, id int64) (err error)
- func (ts *TSEvent) GetByClusterIDAndID(clusterID, id int64) (*TSEventRow, error)
- func (ts *TSEvent) GetByID(id int64) (*TSEventRow, error)
- func (ts *TSEvent) GetCassandraSession() (*gocql.Session, error)
- type TSEventRow
- type TSLog
- func (ts *TSLog) AllByClusterIDAndRange(clusterID int64, from, to int64) ([]*TSLogRow, error)
- func (ts *TSLog) AllByClusterIDRangeAndQuery(clusterID int64, from, to int64, resourcedQuery string) ([]*TSLogRow, error)
- func (ts *TSLog) CountByClusterIDFromTimestampHostAndQuery(clusterID int64, from int64, hostname, resourcedQuery string) (int64, error)
- func (ts *TSLog) Create(clusterID int64, hostname string, tags map[string]string, ...) (err error)
- func (ts *TSLog) CreateFromJSON(clusterID int64, jsonData []byte, ttl time.Duration) error
- func (ts *TSLog) GetCassandraSession() (*gocql.Session, error)
- func (ts *TSLog) LastByClusterID(clusterID int64) (*TSLogRow, error)
- type TSLogRow
- type TSLogRowsWithError
- type TSMetric
- func (ts *TSMetric) AllByMetricIDAndRange(clusterID, metricID int64, from, to int64) ([]*shared.TSMetricRow, error)
- func (ts *TSMetric) AllByMetricIDAndRangeForHighchart(clusterID, metricID, from, to int64) ([]*shared.TSMetricHighchartPayload, error)
- func (ts *TSMetric) AllByMetricIDHostAndRange(clusterID, metricID int64, host string, from, to int64) ([]*shared.TSMetricRow, error)
- func (ts *TSMetric) AllByMetricIDHostAndRangeForHighchart(clusterID, metricID int64, host string, from, to int64) (*shared.TSMetricHighchartPayload, error)
- func (ts *TSMetric) CreateByHostRow(hostRow shared.IHostRow, metricsMap map[string]int64, ttl time.Duration) error
- func (ts *TSMetric) GetAggregateXMinutesByMetricIDAndHostname(clusterID, metricID int64, minutes int, hostname string) (*shared.TSMetricAggregateRow, error)
- func (ts *TSMetric) GetCassandraSession() (*gocql.Session, error)
Constants ¶
This section is empty.
Variables ¶
var PROJECT_EPOCH = 1451606400
Functions ¶
This section is empty.
Types ¶
type Base ¶
func (*Base) NewExplicitID ¶
NewExplicitID uses UNIX timestamp in microseconds as ID.
type TSEvent ¶
type TSEvent struct {
Base
}
func NewTSEvent ¶
func (*TSEvent) AllBandsByClusterIDAndCreatedFromRangeForHighchart ¶
func (ts *TSEvent) AllBandsByClusterIDAndCreatedFromRangeForHighchart(clusterID, from, to int64) ([]shared.TSEventHighchartLinePayload, error)
AllBandsByClusterIDAndCreatedFromRangeForHighchart returns all rows with time stretch between created_from and created_to.
func (*TSEvent) AllLinesByClusterIDAndCreatedFromRangeForHighchart ¶
func (ts *TSEvent) AllLinesByClusterIDAndCreatedFromRangeForHighchart(clusterID, from, to int64) ([]shared.TSEventHighchartLinePayload, error)
AllLinesByClusterIDAndCreatedFromRangeForHighchart returns all rows given created_from range.
func (*TSEvent) CreateFromJSON ¶
func (*TSEvent) DeleteByClusterIDAndID ¶
func (*TSEvent) GetByClusterIDAndID ¶
func (ts *TSEvent) GetByClusterIDAndID(clusterID, id int64) (*TSEventRow, error)
GetByClusterIDAndID returns record by cluster_id and id.
type TSEventRow ¶
type TSLog ¶
type TSLog struct {
Base
}
func (*TSLog) AllByClusterIDAndRange ¶
AllByClusterIDAndRange returns all logs within time range.
func (*TSLog) AllByClusterIDRangeAndQuery ¶
func (ts *TSLog) AllByClusterIDRangeAndQuery(clusterID int64, from, to int64, resourcedQuery string) ([]*TSLogRow, error)
AllByClusterIDRangeAndQuery returns all rows by cluster id, unix timestamp range, and resourced query.
func (*TSLog) CountByClusterIDFromTimestampHostAndQuery ¶
func (ts *TSLog) CountByClusterIDFromTimestampHostAndQuery(clusterID int64, from int64, hostname, resourcedQuery string) (int64, error)
CountByClusterIDFromTimestampHostAndQuery returns count by cluster id, from unix timestamp, host, and resourced query.
func (*TSLog) Create ¶
func (ts *TSLog) Create(clusterID int64, hostname string, tags map[string]string, loglines []shared.AgentLoglinePayload, filename string, ttl time.Duration) (err error)
Create a new record.
func (*TSLog) CreateFromJSON ¶
type TSLogRow ¶
type TSLogRow struct {
ClusterID int64 `db:"cluster_id"`
Created int64 `db:"created"`
Hostname string `db:"hostname"`
Tags map[string]string `db:"tags"`
Filename string `db:"filename"`
Logline string `db:"logline"`
}
func (*TSLogRow) CreatedUnix ¶
type TSLogRowsWithError ¶
type TSMetric ¶
type TSMetric struct {
Base
}
func NewTSMetric ¶
func (*TSMetric) AllByMetricIDAndRange ¶
func (*TSMetric) AllByMetricIDAndRangeForHighchart ¶
func (ts *TSMetric) AllByMetricIDAndRangeForHighchart(clusterID, metricID, from, to int64) ([]*shared.TSMetricHighchartPayload, error)
func (*TSMetric) AllByMetricIDHostAndRange ¶
func (*TSMetric) AllByMetricIDHostAndRangeForHighchart ¶
func (*TSMetric) CreateByHostRow ¶
func (*TSMetric) GetAggregateXMinutesByMetricIDAndHostname ¶
Directories
¶
| Path | Synopsis |
|---|---|
|
Package querybuilder parses ResourceD query and turn it into Cassandra + Lucene query.
|
Package querybuilder parses ResourceD query and turn it into Cassandra + Lucene query. |