mirror of
https://github.com/lukaszraczylo/graphql-monitoring-proxy.git
synced 2026-06-14 02:32:10 +00:00
Compare commits
1 Commits
add-tracing
...
v0.18.13
| Author | SHA1 | Date | |
|---|---|---|---|
| f7babe93d9 |
Vendored
+1
-1
@@ -15,10 +15,10 @@ type CacheConfig struct {
|
||||
Logger *libpack_logger.Logger
|
||||
Client CacheClient
|
||||
Redis struct {
|
||||
Enable bool `json:"enable"`
|
||||
URL string `json:"url"`
|
||||
Password string `json:"password"`
|
||||
DB int `json:"db"`
|
||||
Enable bool `json:"enable"`
|
||||
}
|
||||
TTL int `json:"ttl"`
|
||||
}
|
||||
|
||||
Vendored
+3
-3
@@ -11,10 +11,10 @@ import (
|
||||
)
|
||||
|
||||
type RedisConfig struct {
|
||||
client *redis.Client
|
||||
ctx context.Context
|
||||
prefix string
|
||||
client *redis.Client
|
||||
builderPool *sync.Pool
|
||||
prefix string
|
||||
}
|
||||
|
||||
func (c *RedisConfig) prependKeyName(key string) string {
|
||||
@@ -29,8 +29,8 @@ func (c *RedisConfig) prependKeyName(key string) string {
|
||||
type RedisClientConfig struct {
|
||||
RedisServer string
|
||||
RedisPassword string
|
||||
RedisDB int
|
||||
Prefix string
|
||||
RedisDB int
|
||||
}
|
||||
|
||||
func New(redisClientConfig *RedisClientConfig) *RedisConfig {
|
||||
|
||||
+3
-3
@@ -42,16 +42,16 @@ const (
|
||||
var defaultOutput = os.Stdout
|
||||
|
||||
type Logger struct {
|
||||
output io.Writer
|
||||
format string
|
||||
minLogLevel int
|
||||
showCaller bool
|
||||
output io.Writer
|
||||
}
|
||||
|
||||
type LogMessage struct {
|
||||
Message string
|
||||
Pairs map[string]any
|
||||
output io.Writer
|
||||
Pairs map[string]any
|
||||
Message string
|
||||
}
|
||||
|
||||
func (m *LogMessage) String() string {
|
||||
|
||||
@@ -59,13 +59,13 @@ func (suite *LoggerTestSuite) Test_LogsLevelsPrint() {
|
||||
logger := New().SetOutput(output)
|
||||
|
||||
tests := []struct {
|
||||
pairs map[string]any
|
||||
name string
|
||||
method string
|
||||
message string
|
||||
loggerMinLevel int
|
||||
messageLogLevel int
|
||||
message string
|
||||
pairs map[string]any
|
||||
wantOutput bool // Whether we expect output to be written
|
||||
wantOutput bool
|
||||
}{
|
||||
{
|
||||
name: "Log: Debug, Level: Debug - no pairs",
|
||||
|
||||
@@ -14,8 +14,8 @@ import (
|
||||
|
||||
// Cache for sorted label keys to avoid repeated sorting
|
||||
var sortedLabelKeysCache = struct {
|
||||
sync.RWMutex
|
||||
m map[string][]string
|
||||
sync.RWMutex
|
||||
}{m: make(map[string][]string)}
|
||||
|
||||
func (ms *MetricsSetup) get_metrics_name(name string, labels map[string]string) string {
|
||||
|
||||
@@ -167,9 +167,9 @@ func TestEnsureDefaultLabels(t *testing.T) {
|
||||
libpack_config.PKG_NAME = "example_microservice"
|
||||
|
||||
tests := []struct {
|
||||
name string
|
||||
inputLabels map[string]string
|
||||
expectedLabels map[string]string
|
||||
name string
|
||||
}{
|
||||
{
|
||||
name: "Nil labels",
|
||||
|
||||
Reference in New Issue
Block a user