tests running

This commit is contained in:
Ravi Prasad
2025-05-01 01:14:16 -05:00
parent 9d97283f82
commit 00519f0420
12 changed files with 25204 additions and 2293 deletions
+37
View File
@@ -0,0 +1,37 @@
package metrics
import (
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/client_golang/prometheus/promauto"
)
// Define metrics
var (
// HTTPRequestsTotal counts the number of HTTP requests processed
HTTPRequestsTotal = promauto.NewCounterVec(
prometheus.CounterOpts{
Name: "nba_http_requests_total",
Help: "Total number of HTTP requests",
},
[]string{"method", "endpoint", "status"},
)
// HTTPRequestDuration measures the duration of HTTP requests
HTTPRequestDuration = promauto.NewHistogramVec(
prometheus.HistogramOpts{
Name: "nba_http_request_duration_seconds",
Help: "HTTP request duration in seconds",
Buckets: prometheus.DefBuckets,
},
[]string{"method", "endpoint"},
)
// DBOperationsTotal counts database operations
DBOperationsTotal = promauto.NewCounterVec(
prometheus.CounterOpts{
Name: "nba_db_operations_total",
Help: "Total number of database operations",
},
[]string{"operation", "entity"},
)
)