Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
16 changes: 16 additions & 0 deletions .vscode/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Developing Nighthawk using VSCode

Install VSCode and click `file->open workspace` in the menu.
Next, open [nighthawk.code-workspace](../nighthawk.code-workspace).

You can now use `shift+ctrl+p` or `shitf-command+p` (osx) to run
various [tasks](tasks.json) associated to Nighthawk development,
by selecting `Tasks: run task` in the dropdown:

![VSCode tasks dropdown](./tasks.png)

It's recommended to check out the plug-in gallery for facilitating
work with bazel, python and c++.

We are happy to answer any questions on getting started on
[Slack](https://envoyproxy.slack.com/archives/CDX3CGTT9).
45 changes: 45 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
{
"version": "0.2.0",
"configurations": [
{
"name": "(gdb) test-server tests",
"type": "cppdbg",
"request": "launch",
"preLaunchTask": "Direct/Dbg: build tests",
"program": "${workspaceRoot}/bazel-bin/test/server/http_test_server_filter_integration_test",
"args": [],
"stopAtEntry": false,
"cwd": "${workspaceFolder}/",
"environment": [
{
"name": "TEST_TMPDIR",
"value": "/tmp/foo"
},
{
"name": "TEST_WORKSPACE",
"value": "."
},
{
"name": "TEST_SRCDIR",
"value": "${workspaceRoot}/"
},
{
"name": "ENVOY_IP_TEST_VERSIONS",
"value": ""
}
],
"externalConsole": false,
"MIMode": "gdb",
"sourceFileMap": {
"/proc/self/cwd/external": "${workspaceFolder}/bazel-nighthawk/external/"
},
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
}
]
}
]
}
9 changes: 9 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"python.pythonPath": "/usr/bin/python3",
"python.analysis.logLevel": "Warning",
"python.formatting.provider": "yapf",
"python.formatting.yapfArgs": ["--style", "nighthawk/tools/.style.yapf"],
"python.linting.pylintEnabled": false,
"python.linting.flake8Enabled": true,
"python.linting.enabled": true
}
253 changes: 253 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,253 @@
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Does this comment format work in JSON files? I.e. was this tested after the addition of the comment?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Yes that works. json on steroids ;-)

// for the documentation about the tasks.json format
"version": "2.0.0",
"tasks": [
{
"label": "Refresh compilation database.",
"type": "shell",
"command": "tools/gen_compilation_database.py --vscode --include_external --include_genfiles --include_headers",
"problemMatcher": ["$gcc"],
"group": {
"kind": "build",
"isDefault": true
}
},
{
"label": "Direct Update CLI README.md docs",
"type": "shell",
"command": "BAZEL_BUILD_OPTIONS=\"-c fastbuild\" tools/update_cli_readme_documentation.sh --mode fix",
"problemMatcher": ["$gcc"],
"group": {
"kind": "build",
"isDefault": true
}
},
{
"label": "Build Nighthawk-dev dockage",
"type": "shell",
"command": "ci/do_ci.sh docker",
"problemMatcher": ["$gcc"],
"group": {
"kind": "build",
"isDefault": true
}
},
{
"label": "Docker Fix Format",
"type": "shell",
"command": "ci/run_envoy_docker.sh 'ci/do_ci.sh check_format'",
"problemMatcher": ["$gcc"],
"group": {
"kind": "build",
"isDefault": true
}
},
{
"label": "Direct Fix Format",
"type": "shell",
"command": "ci/do_ci.sh fix_format",
"problemMatcher": ["$gcc"],
"group": {
"kind": "build",
"isDefault": true
}
},
{
"label": "Direct/Dbg: binaries",
"type": "shell",
"command": "bazel build -c dbg //:nighthawk",
"problemMatcher": ["$gcc"],
"group": {
"kind": "build",
"isDefault": true
}
},
{
"label": "Direct/Dbg: build tests",
"type": "shell",
"command": "bazel build -c dbg //test/...",
"problemMatcher": ["$gcc"],
"group": {
"kind": "build",
"isDefault": true
}
},
{
"label": "Direct/Opt: binaries",
"type": "shell",
"command": "bazel build -c opt //:nighthawk",
"problemMatcher": ["$gcc"],
"group": {
"kind": "build",
"isDefault": true
}
},
{
"label": "Docker/Coverage tests",
"type": "shell",
"command": "ci/run_envoy_docker.sh 'ci/do_ci.sh coverage'",
"problemMatcher": ["$gcc"],
"group": {
"kind": "test",
"isDefault": true
}
},
{
"label": "Docker/TSAN tests",
"type": "shell",
"command": "ci/run_envoy_docker.sh 'ci/do_ci.sh tsan'",
"problemMatcher": ["$gcc"],
"group": {
"kind": "test",
"isDefault": true
}
},
{
"label": "Docker/ASAN tests",
"type": "shell",
"command": "ci/run_envoy_docker.sh 'ci/do_ci.sh asan'",
"problemMatcher": ["$gcc"],
"group": {
"kind": "test",
"isDefault": true
}
},
{
"label": "Docker/clang-tidy",
"type": "shell",
"command": "ci/run_envoy_docker.sh 'ci/do_ci.sh clang_tidy'",
"problemMatcher": ["$gcc"],
"group": {
"kind": "test",
"isDefault": true
}
},
{
"label": "Direct/ASAN tests",
"type": "shell",
"command": "ci/do_ci.sh asan",
"problemMatcher": ["$gcc"],
"group": {
"kind": "test",
"isDefault": true
}
},
{
"label": "Direct/TSAN tests",
"type": "shell",
"command": "ci/do_ci.sh tsan",
"group": {
"kind": "test",
"isDefault": true
}
},
{
"label": "Direct/Opt tests",
"type": "shell",
"command": "bazel test -c opt //test:nighthawk_test",
"problemMatcher": ["$gcc"],
"group": {
"kind": "test",
"isDefault": true
}
},
{
"label": "Build benchmarks",
"type": "shell",
"command": "bazel build -c fastbuild \"//benchmarks:*\"",
"problemMatcher": ["$gcc"],
"group": {
"kind": "test",
"isDefault": true
}
},
{
"label": "Benchmark execution with binaries from this repo",
"type": "shell",
"command": "bazel test --test_summary=detailed --test_output=all --test_arg=--log-cli-level=info --test_env=ENVOY_IP_TEST_VERSIONS=v4only --test_env=HEAPPROFILE= --test_env=HEAPCHECK= --cache_test_results=no --compilation_mode=opt --cxxopt=-g --cxxopt=-ggdb3 //benchmarks:*",
"options": {
"cwd": "${workspaceRoot}/nighthawk",
"env": {
"TMPDIR": "${workspaceRoot}/nighthawk/benchmarks/tmp",
"ENVOY_IP_TEST_VERSIONS": "v4only"
}
},
"group": {
"kind": "test",
"isDefault": true
}
},
{
"label": "Benchmark execution with NH & Envoy docker images",
"type": "shell",
"command": "benchmarks/run_benchmark.sh",
"group": {
"kind": "test",
"isDefault": true
}
},
{
"label": "Direct repeat tests 1000x",
"type": "shell",
"command": "bazel test --cache_test_results=no --test_env=ENVOY_IP_TEST_VERSIONS=all --runs_per_test=1000 --jobs 50 -c dbg --local_resources 20000,20,0.25 //test:*",
"problemMatcher": ["$gcc"],
"group": {
"kind": "test",
"isDefault": true
}
},
{
"label": "Direct/Fastbuild: run test(s)",
"type": "shell",
"command": "bazel",
"args": [
"test",
"-c",
"fastbuild",
"--test_env=ENVOY_IP_TEST_VERSIONS=v4only",
"--cache_test_results=no",
"${input:testTarget}"
],
"group": {
"kind": "test",
"isDefault": true
}
}
],
"inputs": [
{
"type": "pickString",
"id": "testTarget",
"description": "type",
"options": [
"//test:benchmark_http_client_test",
"//test:client_test",
"//test:client_worker_test",
"//test:factories_test",
"//test:frequency_test",
"//test:options_test",
"//test:output_formatter_test",
"//test:output_transform_main_test",
"//test:platform_util_test",
"//test:process_test",
"//test:python_test",
"//test:rate_limiter_test",
"//test:request_generator_test",
"//test:sequencer_test",
"//test:service_main_test",
"//test:service_test",
"//test:statistic_test",
"//test:stream_decoder_test",
"//test:termination_predicate_test",
"//test:utility_test",
"//test:worker_test",
"//test:sni_utility_test",
"//test/server:http_test_server_filter_integration_test",
"//test/server:http_dynamic_delay_filter_integration_test",
"//test/..."
],
"default": "//test/..."
}
]
}
Binary file added .vscode/tasks.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 10 additions & 0 deletions include/nighthawk/adaptive_load/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ envoy_basic_cc_library(
include_prefix = "nighthawk/adaptive_load",
deps = [
"//api/adaptive_load:adaptive_load_proto_cc_proto",
"//api/client:grpc_service_lib",
"@envoy//include/envoy/common:time_interface",
],
)

Expand All @@ -27,6 +29,8 @@ envoy_basic_cc_library(
include_prefix = "nighthawk/adaptive_load",
deps = [
"//api/adaptive_load:adaptive_load_proto_cc_proto",
"@envoy//include/envoy/common:base_includes",
"@envoy//include/envoy/config:typed_config_interface",
],
)

Expand All @@ -38,6 +42,8 @@ envoy_basic_cc_library(
include_prefix = "nighthawk/adaptive_load",
deps = [
"//api/adaptive_load:adaptive_load_proto_cc_proto",
"@envoy//include/envoy/common:base_includes",
"@envoy//include/envoy/config:typed_config_interface",
],
)

Expand All @@ -49,6 +55,8 @@ envoy_basic_cc_library(
include_prefix = "nighthawk/adaptive_load",
deps = [
"//api/adaptive_load:adaptive_load_proto_cc_proto",
"@envoy//include/envoy/common:base_includes",
"@envoy//include/envoy/config:typed_config_interface",
],
)

Expand All @@ -60,5 +68,7 @@ envoy_basic_cc_library(
include_prefix = "nighthawk/adaptive_load",
deps = [
"//api/adaptive_load:adaptive_load_proto_cc_proto",
"@envoy//include/envoy/common:base_includes",
"@envoy//include/envoy/config:typed_config_interface",
],
)
8 changes: 8 additions & 0 deletions nighthawk.code-workspace
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"folders": [
{
"path": "."
}
],
"settings": {}
}
Loading