-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
metrics: compute interval metrics without GetInternalIntervalMetrics
Remove dependence on the `GetInternalIntervalMetrics` as this method resets the interval following each call. This results in issues if two clients interact with `GetInternalIntervalMetrics` as they will reset the other client’s interval. Ex: Client A calls every 5 seconds and Client B calls every 10 seconds. Client B will end up getting metrics at a 5-second interval since `GetInternalIntervalMetrics` resets the interval on each call. The `admission.StoreMetrics` are updated to remove the `InternalIntervalField` as these metrics need to be computed based off the current metrics `admission.StoreMetrics.Metrics` and the previous metrics. The storage of the previous metrics is left up to the client. Removing the field was chosen instead of setting it to a `nil` value as it would be confusing to return the `StoreMetrics` and require the client to populate the field when they compute the nesscary metrics. For the admission control use case in `SetPebbleMetricsProvider` the last metrics are initialized at the start of `SetPebbleMetricsProvider`. `SetPebbleMetricsProvder` starts a go routine that retrieves and process new metrics. This go routine has been updated to compute the `InternalIntervalMetrics` between the previous metrics and the current metrics. Additionally it update the previous metrics to the current metrics. In order to pass the computed metrics a wrapper struct is used: ```go type StoreMetricsWithDiff struct { *StoreMetrics *pebble.InternalIntervalMetrics } ``` Additionally, make a copy of the `pebble.InternalIntervalMetrics` in order to move away from using the `pebble` version of the interval metrics as these metrics are now the responsibility of the caller to compute. Release note: None
- Loading branch information
1 parent
b5e54ff
commit c72f41d
Showing
9 changed files
with
114 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters