Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adaptive Load fake time source #491

Merged
merged 40 commits into from
Aug 27, 2020

Conversation

eric846
Copy link
Contributor

@eric846 eric846 commented Aug 27, 2020

A fake Envoy::TimeSource that ticks forward every time it is called, starting from 1970-01-01 00:00:00. Only monotonicTime() is implemented.

This simple autonomous behavior is needed because the adaptive load controller checks the clock many times automatically and can't be interrupted in the middle of the run to update the fake time.

Part 2 of splitting PR #483.

eric846 added 30 commits June 1, 2020 17:23
Signed-off-by: eric846 <[email protected]>
Signed-off-by: eric846 <[email protected]>
Signed-off-by: eric846 <[email protected]>
Signed-off-by: eric846 <[email protected]>
Signed-off-by: eric846 <[email protected]>
Signed-off-by: eric846 <[email protected]>
Signed-off-by: eric846 <[email protected]>
Signed-off-by: eric846 <[email protected]>
Signed-off-by: eric846 <[email protected]>
Signed-off-by: eric846 <[email protected]>
Signed-off-by: eric846 <[email protected]>
…ent.Output turns out not to include the status

Signed-off-by: eric846 <[email protected]>
…plugin names, log thresholds only once per session

Signed-off-by: eric846 <[email protected]>
Signed-off-by: eric846 <[email protected]>
@eric846 eric846 added the waiting-for-review A PR waiting for a review. label Aug 27, 2020
oschaaf
oschaaf previously approved these changes Aug 27, 2020
Copy link
Member

@oschaaf oschaaf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, LGTM

@dubious90 dubious90 self-assigned this Aug 27, 2020
dubious90
dubious90 previously approved these changes Aug 27, 2020
Copy link
Contributor

@dubious90 dubious90 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@@ -0,0 +1,17 @@
#include "test/adaptive_load/fake_time_source.h"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh sorry, I was looking at this in the context of ThreadSafeMonoticTimeSource which might also be coming up, to see where this ended up in terms of physical location. I wonder if instead of placing this under test/adaptive_load/, moving it into a shared directory like test/common/ would be possible?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

('common' might not be the best name actually, but imho this ends up in a place where in terms of directory layout this and a new non-test time source would both end up with a consistent location, test/foo and source/foo)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This makes sense. Holding off on merging until Eric weighs in on where this should live.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moved to test/common.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you think of test/common?

  • It's parallel to source/common
  • It definitely makes more sense than test/adaptive_load since a fake time source has nothing to do with adaptive load.
  • I don't want to add something directly in test/.
  • test/test_common looks like something we are forced to have by Envoy precedent but didn't make sense for other Nighthawk stuff?
  • It would be alongside tests for ThreadSafeMonotonicTimeSource and could be used from them if it made sense.

If we rearrange the whole test/ directory later, we can easily eliminate test/common if there's an alternative.

@eric846 eric846 dismissed stale reviews from dubious90 and oschaaf via 13b5dc2 August 27, 2020 19:39
Copy link
Contributor

@dubious90 dubious90 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@dubious90 dubious90 merged commit 42344c1 into envoyproxy:master Aug 27, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
waiting-for-review A PR waiting for a review.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants