Documentation
¶
Index ¶
- func StartMetricsServer(ctx context.Context, addr string, exporter *MetricsExporter) error
- type MetricsExporter
- func (m *MetricsExporter) GetMetrics() map[string]interface{}
- func (m *MetricsExporter) RecordRequest(success bool, responseTime float64)
- func (m *MetricsExporter) ServeHTTP(w http.ResponseWriter, r *http.Request)
- func (m *MetricsExporter) SetConcurrentAttacks(count int64)
- func (m *MetricsExporter) SetQueueDepth(depth int64)
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
Click to show internal directories.
Click to hide internal directories.