Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Run ¶
func Run(ctx context.Context, tx *sqlx.Tx, prom PromQuerier, queryName string, from time.Time, options ...Option) error
Run executes a prometheus query loaded from queries with using the `queryName` and the timestamp. The results of the query are saved in the facts table.
func RunRange ¶
func RunRange(ctx context.Context, database *sqlx.DB, prom PromQuerier, queryName string, from time.Time, until time.Time, options ...Option) (int, error)
RunRange executes prometheus queries like Run() until the `until` timestamp is reached or an error occurred. Returns the number of reports run and a possible error.
Types ¶
type Option ¶
type Option interface {
// contains filtered or unexported methods
}
Option represents a report option.
func WithProgressReporter ¶
WithProgressReporter allows setting a callback function. The callback receives a progress report when generating multiple reports.
func WithPrometheusQueryTimeout ¶
WithPrometheusQueryTimeout allows setting a timout when querying prometheus.
Click to show internal directories.
Click to hide internal directories.