mirror of
https://github.com/drakkan/sftpgo.git
synced 2025-12-07 06:40:54 +03:00
add Prometheus support
some basic counters and gauges are now exposed
This commit is contained in:
@@ -36,6 +36,7 @@ const (
|
||||
activeConnectionsPath = "/api/v1/connection"
|
||||
quotaScanPath = "/api/v1/quota_scan"
|
||||
versionPath = "/api/v1/version"
|
||||
metricsPath = "/metrics"
|
||||
)
|
||||
|
||||
var (
|
||||
@@ -710,6 +711,12 @@ func TestMethodNotAllowedMock(t *testing.T) {
|
||||
checkResponseCode(t, http.StatusMethodNotAllowed, rr.Code)
|
||||
}
|
||||
|
||||
func TestMetricsMock(t *testing.T) {
|
||||
req, _ := http.NewRequest(http.MethodGet, metricsPath, nil)
|
||||
rr := executeRequest(req)
|
||||
checkResponseCode(t, http.StatusOK, rr.Code)
|
||||
}
|
||||
|
||||
func waitTCPListening(address string) {
|
||||
for {
|
||||
conn, err := net.Dial("tcp", address)
|
||||
|
||||
Reference in New Issue
Block a user