monitoring

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jun 20, 2025 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func StartMetricsServer

func StartMetricsServer(ctx context.Context, addr string, exporter *MetricsExporter) error

StartMetricsServer starts the metrics HTTP server

Types

type MetricsExporter

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

MetricsExporter exports metrics for Prometheus

func NewMetricsExporter

func NewMetricsExporter() *MetricsExporter

NewMetricsExporter creates a new metrics exporter

func (*MetricsExporter) GetMetrics

func (m *MetricsExporter) GetMetrics() map[string]interface{}

GetMetrics returns current metrics as JSON

func (*MetricsExporter) RecordRequest

func (m *MetricsExporter) RecordRequest(success bool, responseTime float64)

RecordRequest records a request with its outcome

func (*MetricsExporter) ServeHTTP

func (m *MetricsExporter) ServeHTTP(w http.ResponseWriter, r *http.Request)

ServeHTTP implements http.Handler for metrics endpoint

func (*MetricsExporter) SetConcurrentAttacks

func (m *MetricsExporter) SetConcurrentAttacks(count int64)

SetConcurrentAttacks updates the current concurrent attacks count

func (*MetricsExporter) SetQueueDepth

func (m *MetricsExporter) SetQueueDepth(depth int64)

SetQueueDepth updates the current queue depth

Jump to

Keyboard shortcuts

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