mirror of
https://github.com/PrivateCaptcha/PrivateCaptcha.git
synced 2026-02-09 07:19:08 -06:00
38 lines
1.1 KiB
Go
38 lines
1.1 KiB
Go
package monitoring
|
|
|
|
import (
|
|
"net/http"
|
|
|
|
"github.com/PrivateCaptcha/PrivateCaptcha/pkg/common"
|
|
)
|
|
|
|
type stubMetrics struct{}
|
|
|
|
func NewStub() *stubMetrics {
|
|
return &stubMetrics{}
|
|
}
|
|
|
|
var _ common.PlatformMetrics = (*stubMetrics)(nil)
|
|
var _ common.APIMetrics = (*stubMetrics)(nil)
|
|
var _ common.PortalMetrics = (*stubMetrics)(nil)
|
|
var _ common.BaseMetrics = (*stubMetrics)(nil)
|
|
|
|
func (sm *stubMetrics) Handler(h http.Handler) http.Handler {
|
|
return h
|
|
}
|
|
func (sm *stubMetrics) HandlerIDFunc(func() string) func(http.Handler) http.Handler {
|
|
return common.NoopMiddleware
|
|
}
|
|
|
|
func (sm *stubMetrics) ObservePuzzleCreated(userID int32) {}
|
|
|
|
func (sm *stubMetrics) ObservePuzzleVerified(userID int32, result string, isStub bool) {}
|
|
|
|
func (sm *stubMetrics) ObserveHealth(postgres, clickhouse bool) {}
|
|
func (sm *stubMetrics) ObserveCacheHitRatio(ratio float64) {}
|
|
|
|
func (sm *stubMetrics) ObserveHttpError(handlerID string, method string, code int) {}
|
|
func (sm *stubMetrics) ObserveApiError(handlerID string, method string, code int) {}
|
|
|
|
func (sm *stubMetrics) ObserveEventDropped(eventType common.MetricEventType) {}
|