breakdown scorer to modular files #2
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request introduces several new helper modules and refactors the SLO-aware router in the scheduling framework to improve configurability, prediction handling, and internal data management. The main changes include adding support for environment-based configuration, modularizing prediction and selection logic, and making the SLO context store thread-safe.
Key changes:
Configuration and Environment Variable Support
config.goto provide environment-variable-driven configuration for SLO-aware routing, including weights, selection strategies, and exploration parameters. This makes the router highly configurable without code changes.Prediction and Selection Logic Modularization
prediction.goto encapsulate prediction generation, validation, and SLO headroom calculation for candidate pods, improving code clarity and separation of concerns.helpers.gowith composite scoring and weighted random/max selection logic for pod selection, supporting new composite strategies and selection modes.Request Header Parsing
headers.gowith utility functions for robust parsing of float and boolean headers from requests, including error handling for invalid or missing values.SLO Context Store Refactor
sync.Mapinstead of a plain map, and updated all accessors to useLoad,Store, andDeletemethods for concurrency safety.SLO Request Context Enhancements
SLORequestContextnow pre-initializes maps for prefix cache scores and prediction results, and records the request received timestamp for improved tracking and metrics. [1] [2]