Skip to content

Adaptive Load fake time source#491

Merged
dubious90 merged 40 commits intoenvoyproxy:masterfrom
eric846:adaptive-rps-fake-time-source
Aug 27, 2020
Merged

Adaptive Load fake time source#491
dubious90 merged 40 commits intoenvoyproxy:masterfrom
eric846:adaptive-rps-fake-time-source

Conversation

@eric846
Copy link
Copy Markdown
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 <56563761+eric846@users.noreply.github.com>
Signed-off-by: eric846 <56563761+eric846@users.noreply.github.com>
Signed-off-by: eric846 <56563761+eric846@users.noreply.github.com>
Signed-off-by: eric846 <56563761+eric846@users.noreply.github.com>
Signed-off-by: eric846 <56563761+eric846@users.noreply.github.com>
Signed-off-by: eric846 <56563761+eric846@users.noreply.github.com>
Signed-off-by: eric846 <56563761+eric846@users.noreply.github.com>
Signed-off-by: eric846 <56563761+eric846@users.noreply.github.com>
Signed-off-by: eric846 <56563761+eric846@users.noreply.github.com>
Signed-off-by: eric846 <56563761+eric846@users.noreply.github.com>
Signed-off-by: eric846 <56563761+eric846@users.noreply.github.com>
Signed-off-by: eric846 <56563761+eric846@users.noreply.github.com>
Signed-off-by: eric846 <56563761+eric846@users.noreply.github.com>
…double

Signed-off-by: eric846 <56563761+eric846@users.noreply.github.com>
…variable_setter

Signed-off-by: eric846 <56563761+eric846@users.noreply.github.com>
Signed-off-by: eric846 <56563761+eric846@users.noreply.github.com>
Signed-off-by: eric846 <56563761+eric846@users.noreply.github.com>
Signed-off-by: eric846 <56563761+eric846@users.noreply.github.com>
Signed-off-by: eric846 <56563761+eric846@users.noreply.github.com>
Signed-off-by: eric846 <56563761+eric846@users.noreply.github.com>
Signed-off-by: eric846 <56563761+eric846@users.noreply.github.com>
Signed-off-by: eric846 <56563761+eric846@users.noreply.github.com>
…ent.Output turns out not to include the status

Signed-off-by: eric846 <56563761+eric846@users.noreply.github.com>
…plugin names, log thresholds only once per session

Signed-off-by: eric846 <56563761+eric846@users.noreply.github.com>
Signed-off-by: eric846 <56563761+eric846@users.noreply.github.com>
Signed-off-by: eric846 <56563761+eric846@users.noreply.github.com>
eric846 added 9 commits July 21, 2020 21:42
Signed-off-by: eric846 <56563761+eric846@users.noreply.github.com>
Signed-off-by: eric846 <56563761+eric846@users.noreply.github.com>
Signed-off-by: eric846 <56563761+eric846@users.noreply.github.com>
…e a reference, add file comments

Signed-off-by: eric846 <56563761+eric846@users.noreply.github.com>
Signed-off-by: eric846 <56563761+eric846@users.noreply.github.com>
Signed-off-by: eric846 <56563761+eric846@users.noreply.github.com>
Signed-off-by: eric846 <56563761+eric846@users.noreply.github.com>
Signed-off-by: eric846 <56563761+eric846@users.noreply.github.com>
Signed-off-by: eric846 <56563761+eric846@users.noreply.github.com>
@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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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.

Signed-off-by: eric846 <56563761+eric846@users.noreply.github.com>
@eric846 eric846 dismissed stale reviews from dubious90 and oschaaf via 13b5dc2 August 27, 2020 19:39
Copy link
Copy Markdown
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