Documentation ¶
Overview ¶
writer provides our stdout writers for promql query results
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func WriteInstant ¶
func WriteInstant(i InstantWriter, format string, noHeaders bool) error
WriteInstant writes out the results of the query to an output buffer and prints it to stdout
func WriteRange ¶
func WriteRange(r RangeWriter, format string, noHeaders bool) error
WriteRange writes out the results of the query to an output buffer and prints it to stdout
Types ¶
type InstantResult ¶
InstantResult is wrapper of the prometheus model.Matrix type returned from instant queries Satisfies the InstantWriter interface
func (*InstantResult) Csv ¶
func (r *InstantResult) Csv(noHeaders bool) (bytes.Buffer, error)
Csv returns the repsonse from an instant query as a csv
type InstantWriter ¶
InstantWriter extends the Writer interface by adding a Table method Use specifically for writing the results of instant queries
type LabelsResult ¶
LabelsResult is the result of an instant query It's really the same as an InstantResult with different methods for parsing the unique labels present in a query result.
func (*LabelsResult) Csv ¶
func (r *LabelsResult) Csv(noHeaders bool) (bytes.Buffer, error)
Csv returns the labels from an instant query as a single column csv
type MetricsResult ¶
type MetricsResult struct {
model.LabelValues
}
MetricsResult is the result of our metrics query It satisfies the InstantWriter interface as it's a point in time (e.g. what metrics are currently queryable)
func (*MetricsResult) Csv ¶
func (r *MetricsResult) Csv(noHeaders bool) (bytes.Buffer, error)
Csv returns the repsonse from a metrics query as a single column csv
type RangeResult ¶
RangeResult is wrapper of the prometheus model.Matrix type returned from range queries Satisfies the RangeWriter interface
func (*RangeResult) Csv ¶
func (r *RangeResult) Csv(noHeaders bool) (bytes.Buffer, error)
Csv returns the response from a range query as a csv
func (*RangeResult) Graph ¶
func (r *RangeResult) Graph(dim util.TermDimensions) (bytes.Buffer, error)
Graph returns an ascii graph using https://github.com/guptarohit/asciigraph
type RangeWriter ¶
RangeWriter extends the Writer interface by adding a Graph method Used specifically for writing the results of range queries