monitoring

package
v0.19.0 Latest Latest
Warning

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

Go to latest
Published: Dec 11, 2025 License: MIT Imports: 14 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// MetricRequestDuration measures the latency of successful requests,
	// grouped by workflow and query.
	MetricRequestDuration = promauto.NewHistogramVec(prometheus.HistogramOpts{
		Name: "drk_request_duration",
		Buckets: []float64{
			0.001,
			0.005,
			0.01,
			0.025,
			0.05,
			0.1,
			0.25,
			0.5,
			1.0,
			2.5,
			5.0,
		},
	},
		[]string{
			"workflow",
			"query",
		})

	// MetricErrorDuration measures the latency of failed requests,
	// grouped by workflow and query.
	MetricErrorDuration = promauto.NewHistogramVec(prometheus.HistogramOpts{
		Name: "drk_error_duration",
		Buckets: []float64{
			0.001,
			0.005,
			0.01,
			0.025,
			0.05,
			0.1,
			0.25,
			0.5,
			1.0,
			2.5,
			5.0,
		},
	},
		[]string{
			"workflow",
			"query",
		})

	// MetricRequestCount is a running total of the successful requests,
	// grouped by workflow and query.
	MetricRequestCount = promauto.NewCounterVec(prometheus.CounterOpts{
		Name: "drk_request_count",
	},
		[]string{
			"workflow",
			"query",
		})

	// MetricErrorCount is a running total of the failed requests,
	// grouped by workflow and query.
	MetricErrorCount = promauto.NewCounterVec(prometheus.CounterOpts{
		Name: "drk_error_count",
	},
		[]string{
			"workflow",
			"query",
		})
)
View Source
var (
	ValidPrintModes = map[string]struct{}{
		string(PrintModeTable): {},
		string(PrintModeLog):   {},
	}
)

Functions

This section is empty.

Types

type PrintMode

type PrintMode string
const (
	PrintModeTable PrintMode = "table"
	PrintModeLog   PrintMode = "log"
)

type Printer

type Printer struct {
	// contains filtered or unexported fields
}

func NewPrinter

func NewPrinter(mode PrintMode, clear bool, vuStarted chan struct{}, logger *zerolog.Logger) *Printer

func (*Printer) Print

func (p *Printer) Print(counts, errors map[string]int, latencies map[string]*ring.Ring[time.Duration])

func (*Printer) PrintConfig

func (p *Printer) PrintConfig(cfg *model.Drk)

PrintConfig displays the applications configuration in the terminal.

func (*Printer) PrintLine

func (p *Printer) PrintLine(counts, errors map[string]int, latencies map[string]*ring.Ring[time.Duration])

PrintLine adds new lines to the terminal containing a summary of requests.

func (*Printer) PrintTable

func (p *Printer) PrintTable(counts, errors map[string]int, latencies map[string]*ring.Ring[time.Duration])

PrintTable clears the terminal and prints a summary of requests.

Jump to

Keyboard shortcuts

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