logqlbench

package
v0.16.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 6, 2024 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Overview

Package logqlbench defines utilities to benchmark LogQL queries.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConfigQuery

type ConfigQuery struct {
	Title       string        `yaml:"title,omitempty"`
	Description string        `yaml:"description,omitempty"`
	Start       string        `yaml:"start,omitempty"`
	End         string        `yaml:"end,omitempty"`
	Step        time.Duration `yaml:"step,omitempty"`
	Query       string        `yaml:"query,omitempty"`
	Match       []string      `yaml:"match,omitempty"`
}

ConfigQuery defines LogQL query parameters.

type Input

type Input struct {
	Instant []ConfigQuery `yaml:"instant"`
	Range   []ConfigQuery `yaml:"range"`
	Series  []ConfigQuery `yaml:"series"`
}

Input defines queries config.

type LogQLBenchmark

type LogQLBenchmark struct {
	Addr   string
	Count  int
	Warmup int

	StartTime  string
	EndTime    string
	AllowEmpty bool

	TrackerOptions chtracker.SetupOptions

	Input          string
	Output         string
	RequestTimeout time.Duration
	// contains filtered or unexported fields
}

func (*LogQLBenchmark) Run

func (p *LogQLBenchmark) Run(ctx context.Context) error

Run starts the benchmark.

func (*LogQLBenchmark) Setup

func (p *LogQLBenchmark) Setup(cmd *cobra.Command) error

Setup setups benchmark using given flags.

type LogQLReport

type LogQLReport struct {
	Queries []LogQLReportQuery `json:"queries"`
}

type LogQLReportQuery

type LogQLReportQuery struct {
	ID            int                     `yaml:"id,omitempty"`
	Query         string                  `yaml:"query,omitempty"`
	Title         string                  `yaml:"title,omitempty"`
	Description   string                  `yaml:"description,omitempty"`
	DurationNanos int64                   `yaml:"duration_nanos,omitempty"`
	Matchers      []string                `yaml:"matchers,omitempty"`
	Queries       []chtracker.QueryReport `yaml:"queries,omitempty"`
	Timeout       bool                    `yaml:"timeout,omitempty"`
}

type Query

type Query struct {
	ID   int
	Type string

	Title       string
	Description string
	Start       time.Time
	End         time.Time
	Step        time.Duration
	Query       string
	Match       []string
}

Query is a benchmarked query.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL