Skip to content

Latest commit

 

History

History
177 lines (143 loc) · 6.58 KB

navigating_the_codebase.md

File metadata and controls

177 lines (143 loc) · 6.58 KB

Navigating the Nighthawk codebase

This document outlines how to navigate the Nighthawk codebase. The top level directory structure of Nighthawk's repository looks as follows:

.
├── api
├── benchmarks
├── ci
├── docs
├── extensions_build_config.bzl
├── include
├── internal_proto
├── samples
├── source
├── support
├── test
├── tools
└── WORKSPACE

The api directory contains the public protocol buffer APIs of Nighthawk and its components. See the API section for more details on the exposed APIs.

The benchmarks directory contains a test suite built on top of Nighthawk's integration tests that allows users to develop their own benchmarks. See the benchmarks documentation for more details.

The ci directory contains configuration and scripts used when executing continuous integration pipelines for Nighthawk.

The docs contain Nighthawk's documentation.

The extensions_build_config.bzl selects the extensions the Envoy used by Nighthawk is built with. See Building Envoy with Bazel for details. Nighthawk uses Envoy both in the client code to send requests and the in the Nighthawk test server to respond to requests.

The include directory contains C++ header files (declarations) of Nighthawk components. These aren't considered to be part of the public API and may change as Nighthawk develops. See the include section for more details about this directory.

The internal_proto directory contains protocol buffer messages that are internal to Nighthawk.

The samples directory contains samples in the fortio data format. See the README.md for more details.

The source directory contains C++ implementations (definitions) of Nighthawk components declared in the include directory as well as the build targets for the Nighthawk binaries. See the source section for more details about this directory.

The support directory contains tools used when developing Nighthawk, e.g. git pre-commit hooks. See its README.md for more details.

The test contains Nighthawk's unit and integration tests. The integration tests are located in the integration subdirectory.

The tools directory contains utilities used to upkeep the Nighthawk codebase, e.g. tools that enforce file formatting rules, etc.

The WORKSPACE file contains Bazel workspace rules that define dependencies external to this repository.

The APIs

The api directory has the following subdirectories:

.
└── api
    ├── adaptive_load
    ├── client
    ├── distributor
    ├── request_source
    ├── server
    └── sink

The adaptive_load directory contains protocol buffer messages that are used to configure the adaptive load controller.

The client directory contains the main API for Nighthawk's traffic/load generation - both the CLI and the gRPC service definition. The CLI is used when Nighthawk runs locally and the gRPC service definition is used when Nighthawk runs as a gRPC server. See overview for more details.

The distributor and sink directories are related to an ongoing effort to allow Nighthawk to scale horizontally. See #369 for more details.

The request_source directory contains the APIs of the request source when using its plugin or gRPC service implementation. See the overview for a list of available request source implementation and its role in the architecture of Nighthawk.

The server directory contains options that can be sent to the Nighthawk test server.

The include and source directories

The include directory has the following subdirectories:

.
└── include
    └── nighthawk
        ├── adaptive_load
        ├── client
        ├── common
        ├── distributor
        ├── request_source
        └── sink

The source directory has the following subdirectories:

.
└── source
    ├── adaptive_load
    ├── client
    ├── common
    ├── distributor
    ├── exe
    ├── request_source
    ├── server
    └── sink

The adaptive_load directories (include, source) contain the declarations and definitions of components belonging to the adaptive load controller.

The client directories (include, source) contain the declarations and definitions of the main Nighthawk components as outlined in the overview.

The common directories (include, source) contain code that is used by the Nighthawk client and at least one other component, e.g. the Nighthawk test server, the request source, etc.

The distributor (include, source) and sink (include, source) directories are related to an ongoing effort to allow Nighthawk to scale horizontally. See #369 for more details.

The exe directory contains build targets for the main Nighthawk binaries.

The request_source directories (include, source) contain the declarations and definitions of components belonging to the implementations of the request source.

The server directory contains code belonging to the Nighthawk test server.