-
Notifications
You must be signed in to change notification settings - Fork 83
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
Schedule option #573
Schedule option #573
Changes from all commits
bc0b643
b6af281
6657217
e8de757
69410ab
9b419c0
fcc37e9
a286055
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,9 +3,12 @@ | |
#include <memory> | ||
|
||
#include "envoy/common/pure.h" | ||
#include "envoy/common/time.h" | ||
|
||
#include "nighthawk/common/statistic.h" | ||
|
||
#include "absl/types/optional.h" | ||
|
||
namespace Nighthawk { | ||
namespace Client { | ||
|
||
|
@@ -23,10 +26,12 @@ class OutputCollector { | |
* @param statistics Reference to a vector of statistics to add to the output. | ||
* @param counters Reference to a map of counter values, keyed by name, to add to the output. | ||
* @param execution_duration Execution duration associated to the to-be-added result. | ||
* @param first_acquisition_time Timing of the first rate limiter acquisition. | ||
*/ | ||
virtual void addResult(absl::string_view name, const std::vector<StatisticPtr>& statistics, | ||
const std::map<std::string, uint64_t>& counters, | ||
const std::chrono::nanoseconds execution_duration) PURE; | ||
const std::chrono::nanoseconds execution_duration, | ||
const absl::optional<Envoy::SystemTime>& first_acquisition_time) PURE; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. will likely be addressed when the comment is added, but I'm not sure i understand what acquisition means in this context. |
||
/** | ||
* Directly sets the output value. | ||
* | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,7 +24,7 @@ class SequencerFactory { | |
const SequencerTarget& sequencer_target, | ||
TerminationPredicatePtr&& termination_predicate, | ||
Envoy::Stats::Scope& scope, | ||
const Envoy::SystemTime scheduled_starting_time) const PURE; | ||
const Envoy::MonotonicTime scheduled_starting_time) const PURE; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not actionable, just making sure I'm understanding - this is where we're moving back to MonotonicTime to prevent #569 ? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, that is right. |
||
}; | ||
|
||
class StatisticFactory { | ||
|
@@ -46,7 +46,7 @@ class TerminationPredicateFactory { | |
virtual ~TerminationPredicateFactory() = default; | ||
virtual TerminationPredicatePtr | ||
create(Envoy::TimeSource& time_source, Envoy::Stats::Scope& scope, | ||
const Envoy::SystemTime scheduled_starting_time) const PURE; | ||
const Envoy::MonotonicTime scheduled_starting_time) const PURE; | ||
}; | ||
|
||
/** | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -33,6 +33,12 @@ class RateLimiter { | |
* @return Envoy::TimeSource& time_source used to track time. | ||
*/ | ||
virtual Envoy::TimeSource& timeSource() PURE; | ||
|
||
/** | ||
* @return absl::optional<Envoy::SystemTime> Time of the first acquisition, if any. | ||
*/ | ||
virtual absl::optional<Envoy::SystemTime> firstAcquisitionTime() const PURE; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I might have just missed it in this pull request (if so, please point me to the right file), but while I'm seeing code that writes this field or passes it around, I'm not finding where it's actually used functionally. What is its intended purpose? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This gets consumed over at https://github.com/envoyproxy/nighthawk/pull/573/files#diff-e528c3973715873e2ec7fcac6a842e5d9a59d6523a77bf1219d295dd4c7285cdR539 and ends up in the output as |
||
|
||
/** | ||
* @return std::chrono::nanoseconds elapsed since the first call to tryAcquireOne(). Used by some | ||
* rate limiter implementations to compute acquisition rate. | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add comment for first_acquisition_time?