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 main loop #483

Closed
wants to merge 32 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
8ea442d
Merge pull request #5 from envoyproxy/master
eric846 Jun 1, 2020
5ac755a
Merge pull request #6 from envoyproxy/master
eric846 Jun 28, 2020
b8c25a5
Merge pull request #7 from envoyproxy/master
eric846 Jul 7, 2020
9907bf9
Merge pull request #11 from envoyproxy/master
eric846 Jul 20, 2020
651e699
Merge remote-tracking branch 'upstream/master' into master
eric846 Jul 29, 2020
3df3d13
Merge remote-tracking branch 'upstream/master' into master
eric846 Jul 31, 2020
28e5056
Merge remote-tracking branch 'upstream/master'
eric846 Aug 8, 2020
8ae837c
Merge remote-tracking branch 'upstream/master'
eric846 Aug 13, 2020
3522ba9
Merge remote-tracking branch 'upstream/master'
eric846 Aug 14, 2020
3500924
Merge remote-tracking branch 'upstream/master'
eric846 Aug 18, 2020
6a83fbc
Merge remote-tracking branch 'upstream/master'
eric846 Aug 18, 2020
9b65e56
Merge remote-tracking branch 'upstream/master'
eric846 Aug 21, 2020
f0289ac
Merge remote-tracking branch 'upstream/master'
eric846 Aug 21, 2020
62e47b5
Merge remote-tracking branch 'upstream/master'
eric846 Aug 24, 2020
ce68103
adaptive load main loop initial commit
eric846 Aug 24, 2020
d870cf2
add assertions for conditions impossible after input validation
eric846 Aug 24, 2020
9d7769b
edit comments
eric846 Aug 24, 2020
3b102c1
fix format
eric846 Aug 24, 2020
28ae670
fix typo
eric846 Aug 24, 2020
ecf6cfe
extract some helper functions, support input setting failure in FakeS…
eric846 Aug 25, 2020
2fc3d7a
fix comments
eric846 Aug 25, 2020
d5dfbcc
fix open loop setting, update API to use StatusOr, catch more gRPC er…
eric846 Aug 26, 2020
8af55a4
assert that Nighthawk Service sends only one message on the gRPC chan…
eric846 Aug 26, 2020
c80b882
improve readability of AnalyzeNighthawkBenchmark
eric846 Aug 26, 2020
d779f30
rename unix_time_ to seconds_since_epoch_
eric846 Aug 26, 2020
5e995f8
remove open_loop enforcement, implement and comment open_loop default…
eric846 Aug 26, 2020
898843c
Write, WritesDone else if
eric846 Aug 26, 2020
a7fa07f
delete proto error status fields, update FakeStepController to stop r…
eric846 Aug 26, 2020
42db212
delete obsolete handling of for error status in BenchmarkResult, whic…
eric846 Aug 26, 2020
5b1474b
enhance FakeStepController to return input setter errors after a coun…
eric846 Aug 26, 2020
771a50d
fix broken unit test
eric846 Aug 26, 2020
76986d3
add pre-countdown fixed rps value to failed input value setter FakeSt…
eric846 Aug 26, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 11 additions & 9 deletions api/adaptive_load/adaptive_load.proto
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,17 @@ message AdaptiveLoadSessionSpec {
// A proto describing Nighthawk Service traffic. See
// https://github.com/envoyproxy/nighthawk/blob/master/api/client/options.proto
//
// The adaptive load controller will return an error if the |duration| or
// |open_loop| fields are set within |nighthawk_traffic_options|. The
// controller will also be configured to overwrite at least one of the
// numerical fields during the search, such as requests_per_second, so any
// value of those fields specified here will be ignored.
// The adaptive load controller will return an error if the |duration| field is set within
// |nighthawk_traffic_options|.
//
// If |open_loop| is unset, it will be overridden to true by the adaptive load controller. This is
// to support the typical case where the controller needs full control over attempted requests per
// second, which could conflict with the backpressure mechanism of closed-loop mode. Note that in
// standalone Nighthawk clients, closed-loop mode is the default so |open_loop| defaults to false.
//
// The controller will override at least one field in this proto to vary the load, such as the
// requests_per_second field or headers. Any existing value for such a field in the template will
// be ignored.
//
// All other fields in |nighthawk_traffic_options| are passed through to the
// Nighthawk Service.
Expand Down Expand Up @@ -65,10 +71,6 @@ message AdaptiveLoadSessionSpec {
// Complete description of an adaptive load session, including metric scores
// for every degree of load attempted during the adjusting stage.
message AdaptiveLoadSessionOutput {
// Overall status of the session with error detail. INVALID_ARGUMENT if the input spec contained
// errors, DEADLINE_EXCEEDED if convergence did not occur before the deadline, ABORTED if the step
// controller determined it can never converge.
google.rpc.Status session_status = 1;
// Results of each short benchmark performed during the adjusting stage.
repeated BenchmarkResult adjusting_stage_results = 2;
// Result of the single benchmark of the testing stage.
Expand Down
3 changes: 0 additions & 3 deletions api/adaptive_load/benchmark_result.proto
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,6 @@ message BenchmarkResult {
// Raw Nighthawk Service output. Includes start/end times and full Nighthawk
// Service input spec.
nighthawk.client.Output nighthawk_service_output = 1;
// Execution status of this call to the Nighthawk Service. This will record errors connecting to
// the Nighthawk Service and internal errors returned from the Nighthawk Service.
google.rpc.Status status = 2;
// Status of all declared metrics during this benchmark session. Not present
// in the event of Nighthawk Service errors.
repeated MetricEvaluation metric_evaluations = 3;
Expand Down
1 change: 1 addition & 0 deletions api/client/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ cc_grpc_library(
srcs = [
":base",
],
generate_mocks = True,
grpc_only = True,
proto_only = False,
use_external = False,
Expand Down
1 change: 1 addition & 0 deletions include/nighthawk/adaptive_load/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ envoy_basic_cc_library(
"@envoy//include/envoy/common:base_includes",
"@envoy//include/envoy/common:time_interface",
"@envoy//include/envoy/config:typed_config_interface",
"@envoy//source/common/common:statusor_lib_with_external_headers",
],
)

Expand Down
9 changes: 5 additions & 4 deletions include/nighthawk/adaptive_load/adaptive_load_controller.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

#include "envoy/common/time.h"

#include "external/envoy/source/common/common/statusor.h"

#include "api/adaptive_load/adaptive_load.pb.h"
#include "api/client/service.grpc.pb.h"

Expand All @@ -23,11 +25,10 @@ namespace Nighthawk {
* Envoy-based process, there may be an existing TimeSource or TimeSystem to use. If calling
* from a test, pass a fake TimeSource.
*
* @return AdaptiveLoadSessionOutput a proto logging the result of all traffic attempted and all
* corresponding metric values and scores. Any errors that occur will be recorded in the
* |session_status| field.
* @return StatusOr<AdaptiveLoadSessionOutput> A proto logging the result of all traffic attempted
* and all corresponding metric values and scores, or an overall error status if the session failed.
*/
nighthawk::adaptive_load::AdaptiveLoadSessionOutput PerformAdaptiveLoadSession(
absl::StatusOr<nighthawk::adaptive_load::AdaptiveLoadSessionOutput> PerformAdaptiveLoadSession(
nighthawk::client::NighthawkService::StubInterface* nighthawk_service_stub,
const nighthawk::adaptive_load::AdaptiveLoadSessionSpec& spec, Envoy::TimeSource& time_source);

Expand Down
34 changes: 34 additions & 0 deletions source/adaptive_load/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,40 @@ licenses(["notice"]) # Apache 2

envoy_package()

envoy_cc_library(
name = "adaptive_load",
repository = "@envoy",
visibility = ["//visibility:public"],
deps = [
":adaptive_load_controller_impl",
":input_variable_setter_impl",
":metrics_plugin_impl",
":scoring_function_impl",
":step_controller_impl",
],
)

envoy_cc_library(
name = "adaptive_load_controller_impl",
srcs = [
"adaptive_load_controller_impl.cc",
],
repository = "@envoy",
visibility = ["//visibility:public"],
deps = [
":metrics_plugin_impl",
":plugin_loader",
"//api/adaptive_load:adaptive_load_proto_cc_proto",
"//api/client:base_cc_proto",
"//api/client:grpc_service_lib",
"//include/nighthawk/adaptive_load:adaptive_load_controller",
"//include/nighthawk/adaptive_load:scoring_function",
"//include/nighthawk/adaptive_load:step_controller",
"@envoy//source/common/common:minimal_logger_lib_with_external_headers",
"@envoy//source/common/event:real_time_system_lib_with_external_headers",
],
)

envoy_cc_library(
name = "config_validator_impl",
srcs = [
Expand Down
Loading