mirror of
https://github.com/aptly-dev/aptly.git
synced 2026-07-16 12:08:04 +00:00
Add functional test for metrics endpoint
This commit is contained in:
committed by
Benj Fassbind
parent
6539e1b856
commit
db19a56458
@@ -142,6 +142,7 @@ class BaseTest(object):
|
||||
"gpgDisableSign": False,
|
||||
"ppaDistributorID": "ubuntu",
|
||||
"ppaCodename": "",
|
||||
"enableMetricsEndpoint": True,
|
||||
}
|
||||
configOverride = {}
|
||||
environmentOverride = {}
|
||||
|
||||
@@ -24,5 +24,5 @@
|
||||
"SwiftPublishEndpoints": {},
|
||||
"AzurePublishEndpoints": {},
|
||||
"AsyncAPI": false,
|
||||
"enableMetricsEndpoint": false
|
||||
"enableMetricsEndpoint": true
|
||||
}
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
from api_lib import APITest
|
||||
|
||||
|
||||
class MetricsEnabledAPITest(APITest):
|
||||
"""
|
||||
GET /metrics
|
||||
"""
|
||||
|
||||
def check(self):
|
||||
resp = self.get("/api/metrics")
|
||||
self.check_equal(resp.status_code, 200)
|
||||
|
||||
apiRequestsInFlightGauge = "# TYPE aptly_api_http_requests_in_flight gauge"
|
||||
self.check_in(apiRequestsInFlightGauge, resp.text)
|
||||
|
||||
apiRequestsTotalCounter = "# TYPE aptly_api_http_requests_total counter"
|
||||
self.check_in(apiRequestsTotalCounter, resp.text)
|
||||
|
||||
apiRequestSizeSummary = "# TYPE aptly_api_http_request_size_bytes summary"
|
||||
self.check_in(apiRequestSizeSummary, resp.text)
|
||||
|
||||
apiResponseSizeSummary = "# TYPE aptly_api_http_response_size_bytes summary"
|
||||
self.check_in(apiResponseSizeSummary, resp.text)
|
||||
|
||||
apiRequestsDurationSummary = "# TYPE aptly_api_http_request_duration_seconds summary"
|
||||
self.check_in(apiRequestsDurationSummary, resp.text)
|
||||
Reference in New Issue
Block a user