MCPcopy
hub / github.com/ContainerSSH/ContainerSSH / ServeHTTP

Method ServeHTTP

internal/metrics/server_handler.go:27–35  ·  view source on GitHub ↗
(writer http.ResponseWriter, request *http.Request)

Source from the content-addressed store, hash-verified

25}
26
27func (h *metricsHandler) ServeHTTP(writer http.ResponseWriter, request *http.Request) {
28 if h.path != request.URL.Path {
29 writer.WriteHeader(404)
30 return
31 }
32 writer.Header().Set("Content-Type", "application/openmetrics-text; version=1.0.0; charset=utf-8")
33 writer.WriteHeader(200)
34 _, _ = writer.Write([]byte(h.collector.String()))
35}

Callers

nothing calls this directly

Calls 3

SetMethod · 0.65
WriteMethod · 0.65
StringMethod · 0.65

Tested by

no test coverage detected