Skip to content

Commit 77f8564

Browse files
authored
reduce log level of "prefix cached servers" to TRACE (#842)
* reduced log level of prefix cached servers to trace. default log level of epp is 4, having this log in debug level bombs the log with this line. Signed-off-by: Nir Rozenbaum <[email protected]> * that's the right line Signed-off-by: Nir Rozenbaum <[email protected]> --------- Signed-off-by: Nir Rozenbaum <[email protected]>
1 parent 97bad77 commit 77f8564

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

pkg/epp/scheduling/plugins/prefix/plugin.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,7 @@ func New(config Config) *Plugin {
119119
return m
120120
}
121121

122+
// Name returns the name of the plugin.
122123
func (m *Plugin) Name() string {
123124
return "prefix-cache"
124125
}
@@ -131,7 +132,7 @@ func (m *Plugin) PreSchedule(ctx *types.SchedulingContext) {
131132
}
132133

133134
ctx.CycleState.Write(types.StateKey(m.Name()), state)
134-
ctx.Logger.V(logutil.DEBUG).Info(fmt.Sprintf("PreSchedule, cached servers: %+v", state.PrefixCacheServers), "hashes", state.PrefixHashes)
135+
ctx.Logger.V(logutil.TRACE).Info(fmt.Sprintf("PreSchedule, cached servers: %+v", state.PrefixCacheServers), "hashes", state.PrefixHashes)
135136
}
136137

137138
// If a request was routed to a server, record it in the cache:
@@ -148,6 +149,7 @@ func (m *Plugin) PostSchedule(ctx *types.SchedulingContext, res *types.Result) {
148149
metrics.RecordPrefixCacheMatch(matchLen*m.HashBlockSize, total*m.HashBlockSize)
149150
}
150151

152+
// Score returns the scoring result for the given list of pods based on context.
151153
func (m *Plugin) Score(ctx *types.SchedulingContext, pods []types.Pod) map[types.Pod]float64 {
152154
scores := make(map[types.Pod]float64, len(pods))
153155

@@ -184,7 +186,7 @@ func (m *Plugin) matchLongestPrefix(ctx *types.SchedulingContext, hashes []Block
184186
hash := hashes[i]
185187
cachedServers := m.indexer.Get(hash)
186188
if len(cachedServers) > 0 {
187-
ctx.Logger.V(logutil.DEBUG).Info("Found cached servers", "cachedServers", cachedServers, "total # blocks", len(hashes), "longest prefix", i)
189+
ctx.Logger.V(logutil.TRACE).Info("Found cached servers", "cachedServers", cachedServers, "total # blocks", len(hashes), "longest prefix", i)
188190
for server := range cachedServers {
189191
// Update servers with their longest prefix match.
190192
// If we already found this server with longer prefix match, don't update it.

0 commit comments

Comments
 (0)