mirror of
https://github.com/hanzokv/go.git
synced 2026-09-24 00:31:51 +00:00
* ring: remove external rendezvous dependency by inlining implementation Replace usage of github.com/dgryski/go-rendezvous with an internal implementation to eliminate the external dependency and avoid licence propagation concerns. The implementation preserves the exact hashing algorithm and behaviour: - same hash combination: khash ^ nhash - same mixing function (xorshift* variant) - same node ordering semantics No functional changes intended. * Refactor TestRendezvous to remove randomString function Replaced function with inline string generation for test cases. * test: refactor RendezvousHash tests to use Ginkgo and Gomega * test: improve RendezvousHash test for per-instance determinism and distribution balance * test: enhance distribution verification in RendezvousHash tests
Prometheus Metric Collector
This package implements a prometheus.Collector
for collecting metrics about the connection pool used by the various redis clients.
Supported clients are redis.Client, redis.ClusterClient, redis.Ring and redis.UniversalClient.
Example
client := redis.NewClient(options)
collector := redisprometheus.NewCollector(namespace, subsystem, client)
prometheus.MustRegister(collector)
Metrics
| Name | Type | Description |
|---|---|---|
pool_hit_total |
Counter metric | number of times a connection was found in the pool |
pool_miss_total |
Counter metric | number of times a connection was not found in the pool |
pool_timeout_total |
Counter metric | number of times a timeout occurred when getting a connection from the pool |
pool_conn_total_current |
Gauge metric | current number of connections in the pool |
pool_conn_idle_current |
Gauge metric | current number of idle connections in the pool |
pool_conn_stale_total |
Counter metric | number of times a connection was removed from the pool because it was stale |