Open
Conversation
4f5c32c to
df517da
Compare
df517da to
0b59e5b
Compare
BenjaminPelletier
approved these changes
Feb 12, 2026
|
|
||
| # Check in a moving windows of 10s, that NetMinUasLocRefreshPercentage | ||
| # samples are >= NetMinUasLocRefreshFrequency | ||
| if len(rates) < 10: |
Member
There was a problem hiding this comment.
Since this value (10s window) is used in 4 places, it's important to understand exactly what it is, and we may want to change it, let's make it a constant defined and documented once and then used in all applicable places. We probably also want to type-annotate it as an int since a float value would not work even though conceptually it seems like that would be ok.
Comment on lines
+252
to
+259
| current = start + datetime.timedelta(seconds=2) | ||
|
|
||
| while current < end: | ||
| bucket = int((current - start).total_seconds()) | ||
| rates.append( | ||
| (buckets[bucket] + buckets[bucket - 1] + buckets[bucket - 2]) / 3.0 | ||
| ) | ||
| current += datetime.timedelta(seconds=1) |
Member
There was a problem hiding this comment.
Since we've already quantized to buckets, wouldn't it be simpler to do this computation in that quantized frame?
Suggested change
| current = start + datetime.timedelta(seconds=2) | |
| while current < end: | |
| bucket = int((current - start).total_seconds()) | |
| rates.append( | |
| (buckets[bucket] + buckets[bucket - 1] + buckets[bucket - 2]) / 3.0 | |
| ) | |
| current += datetime.timedelta(seconds=1) | |
| last_bucket = int((end - start).total_seconds()) | |
| bucket = 2 | |
| while bucket <= last_bucket: | |
| rates.append( | |
| (buckets[bucket] + buckets[bucket - 1] + buckets[bucket - 2]) / 3.0 | |
| ) | |
| bucket += 1 |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Follow #1333
Improve slow update check in mock_uss by doing a proper slow update check.
This also make notification coming faster instead of having arbitrarily in the middle of the flight.
Idea is the following:
Notifications are created for each "non-compliant bucket", and placed in time at the end of the bucket, making them more realistic. However, windows spans are quite arbitrary.