mirror of
https://github.com/PrivateCaptcha/PrivateCaptcha.git
synced 2026-02-11 00:08:47 -06:00
Main reason being otter/v2 release with APIs for sliding expiration. - added new cache API to use Loader logic from otter/v2 (fetch from DB) - main direction of work is improving "negative caching" performance (currently it is still intertwined with the main cache) - expose new Prometheus metric for cache hit ratio
32 lines
798 B
Go
32 lines
798 B
Go
package monitoring
|
|
|
|
import (
|
|
"net/http"
|
|
|
|
"github.com/PrivateCaptcha/PrivateCaptcha/pkg/common"
|
|
)
|
|
|
|
type stubMetrics struct{}
|
|
|
|
func NewStub() *stubMetrics {
|
|
return &stubMetrics{}
|
|
}
|
|
|
|
var _ common.PlatformMetrics = (*Service)(nil)
|
|
var _ common.APIMetrics = (*Service)(nil)
|
|
var _ common.PortalMetrics = (*Service)(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) {}
|