monitoring

package
v0.17.0 Latest Latest
Warning

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

Go to latest
Published: Jun 17, 2025 License: MIT Imports: 14 Imported by: 0

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