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
69 changes: 69 additions & 0 deletions .github/workflows/cmake.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
name: CMake

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]

env:
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
BUILD_TYPE: Release

jobs:
format-check:
name: Format Check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: jidicula/clang-format-action@v4.13.0
with:
clang-format-version: '18'
exclude-regex: '(dependencies)'

build:
# The CMake configure and build commands are platform agnostic and should work equally well on Windows or Mac.
# You can convert this to a matrix build if you need cross-platform coverage.
# See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
strategy:
matrix:
os: [ macos-latest, ubuntu-22.04 ]

runs-on: ${{ matrix.os }}
continue-on-error: true

steps:
- uses: actions/checkout@v4
with:
submodules: recursive

- name: Install Packages (macOS)
run: |
brew install llvm go
ln -s "$(brew --prefix llvm)/bin/clang-tidy" "/usr/local/bin/clang-tidy"
if: matrix.os == 'macos-latest'

- name: Install Packages (Ubuntu)
run: |
sudo apt-get install -y clang-tidy-15
if: matrix.os == 'ubuntu-22.04'

- name: Configure CMake (Ubuntu)
if: matrix.os == 'ubuntu-22.04'
env:
CC: "/usr/bin/gcc-12"
CXX: "/usr/bin/g++-12"
# Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make.
# See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type
run: cmake -B ${{github.workspace}}/build -DLINT=ON -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DBUILD_TESTING=ON -DBUILD_BENCHMARKING=ON

- name: Configure CMake (macOS)
if: matrix.os == 'macos-latest'
# Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make.
# See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type
run: cmake -B ${{github.workspace}}/build -DLINT=ON -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DBUILD_TESTING=ON -DBUILD_BENCHMARKING=ON

- name: Build
# Build your program with the given configuration
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} -j $(getconf _NPROCESSORS_ONLN)

59 changes: 59 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,60 @@
# Compiled Object files
*.slo
*.lo
*.o
*.obj
*.d
*.tmp

# Precompiled Headers
*.gch
*.pch

# Compiled Dynamic libraries
*.so
*.dylib
*.dll

# Compiled Static libraries
*.lai
*.la
*.a
*.lib

# Executables
*.exe
*.out
*.app

# Temp Files
.DS_Store
*.swp
*~
/build

# log files
*.log

# IDEA
.idea
cmake-build-debug
cmake-build-release

# Editor files/directories
/.vscode
/.vs
/CMakeSettings.json
.projections.json

# vcpkg
/vcpkg_installed

# Other
.tmp.dprobes.h
libquicr.spdx

# Python
.venv
.vscode/
__pycache__/

3 changes: 3 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ set(CPM_USE_LOCAL_PACKAGES ON)

include(cmake/CPM.cmake)

## hack fix for picotls and other older submodules of libquicr
set(CMAKE_POLICY_VERSION_MINIMUM 3.5)

CPMAddPackage("gh:Quicr/libquicr#main")
CPMAddPackage("gh:jarro2783/cxxopts@3.3.1")

Expand Down
44 changes: 43 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,45 @@
# qperf

Performance Measurement for Relay
Utility to evaluate relay performance.

## Command Line Programs

### > src/qperf_pub

**qperf_pub** is a publisher that publishes based on the `-c <config.ini>` profile.

### > src/qperf_sub

**qperf_sub** is a subscriber that consumes the tracks based on the `-c <config.ini>` profile.

It is intended that the same `config.ini` file be used for both pub and sub. This way they have
the same settings.

## config.ini

Profile configuration per track is configured in a `config.ini` file that is provided to the program using
the `-c` option. See the [config.ini template](templates/config.template.ini) for an example configuration.

Each section in the `config.ini` defines a test for a publish track and subscribe track.
The `namespace` and `name` together should be **unique** for the section, which is the track.


> [!IMPORTANT]
> Each section **MUST** not share the same `namespace + name`. If namespace is the same, the name
> should be different.

## Building

Configure cmake using the following:

```
cmake -B ./build -DLINT=ON -DCMAKE_BUILD_TYPE=Release
```

Build the programs using the following:

```
cmake --build build -j 4
```

The binaries will be under `./build`
8 changes: 7 additions & 1 deletion src/qperf_pub.cc
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,12 @@ namespace qperf {
case Status::kSendingUnannounce:
SPDLOG_INFO("PerfPublishTrackeHandler - status kSendingUnannounce");
break;
case Status::kPaused:
SPDLOG_INFO("PerfPublishTrackeHandler - status kPaused");
break;
case Status::kNewGroupRequested:
SPDLOG_INFO("PerfPublishTrackeHandler - status kNewGroupRequested");
break;
default:
SPDLOG_INFO("PerfPublishTrackeHandler - status UNKNOWN");
break;
Expand Down Expand Up @@ -247,7 +253,7 @@ namespace qperf {
auto transmit_time_ms = std::chrono::milliseconds(perf_config_.total_test_time);
auto end_transmit_time = start_transmit_time + transmit_time_ms;

// Delay befor trasnmitting
// Delay before transmitting
if (perf_config_.start_delay > 0) {
std::this_thread::sleep_for(std::chrono::milliseconds(33));
test_mode_ = qperf::TestMode::kWaitPreTest;
Expand Down
13 changes: 13 additions & 0 deletions templates/config-audio.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[Audio]
namespace = perf/1 ; track namespace
name = 1 ; track name
track_mode = datagram ; track mode {datagram,stream}
priority = 2 ; priority (0-255)
ttl = 5000 ; ttl in ms
time_interval = 20 ; transmit interval in floating point ms
objs_per_group = 1 ; objects per group count >=1
bytes_per_group_start = 120 ; size of a group 0 object
bytes_per_group = 120 ; size of a group <> 0 object
start_delay = 5000 ; start delay in ms - after subscribes
total_test_time = 40000 ; total transmit time in ms - including startdelay
; (not configured): total_transmit_time - is calculated total_transmit_time = total_test_time - start_delay
26 changes: 26 additions & 0 deletions templates/config-av.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
[Audio]
namespace = perf/1 ; track namespace
name = 1 ; track name
track_mode = datagram ; track mode {datagram,stream}
priority = 2 ; priority (0-255)
ttl = 5000 ; ttl in ms
time_interval = 20 ; transmit interval in floating point ms
objs_per_group = 1 ; objects per group count >=1
bytes_per_group_start = 120 ; size of a group 0 object
bytes_per_group = 120 ; size of a group <> 0 object
start_delay = 5000 ; start delay in ms - after subscribes
total_test_time = 40000 ; total transmit time in ms - including start delay
; (not configured): total_transmit_time - is calculated total_transmit_time = total_test_time - start_delay

[360p Video]
namespace = perf/2 ; track namespace
name = 1 ; track name
track_mode = stream ; track mode {datagram,stream}
priority = 3 ; priority (0-255)
ttl = 5000 ; ttl in ms
time_interval = 33.33 ; transmit interval in floating point ms
objs_per_group = 150 ; objects per group count >=1
bytes_per_group_start = 21333 ; size of a group 0 object
bytes_per_group = 2666 ; size of a group <> 0 object
start_delay = 5000 ; start delay in ms - after subscribes
total_test_time = 40000 ; total transmit time in ms - including start delay
22 changes: 17 additions & 5 deletions templates/config.template.ini
Original file line number Diff line number Diff line change
@@ -1,13 +1,25 @@
[TRACK Name]
namespace = perf/1 ; track namespace
name = 1 ; track name
[TRACK 1]
namespace = perf/1 ; track namespace - can be the same or different than other section tracks
name = 1 ; track name - Should be different than other section tracks
track_mode = datagram ; track mode {datagram,stream}
priority = 1 ; priority (0-255)
ttl = 5000 ; ttl in ms
time_interval = 20.00 ; transmit interval in floating point ms
objs_per_group = 1 ; objects per group count >=1
bytes_per_group_start = 60 ; size of a group 0 object
bytes_per_group = 60 ; size of a group <> 0 object
end_delay = 5000 ; start delay in ms - after subscribes
start_delay = 10000 ; start delay in ms - after subscribes
total_test_time = 35000 ; total transmit time in ms - including startdelay
total_test_time = 35000 ; total transmit time in ms - including start delay

[TRACK 2]
namespace = perf/1 ; track namespace - can be the same or different than other section tracks
name = 2 ; track name - Should be different than other section tracks
track_mode = stream ; track mode {datagram,stream}
priority = 2 ; priority (0-255)
ttl = 5000 ; ttl in ms
time_interval = 33.33 ; transmit interval in floating point ms
objs_per_group = 150 ; objects per group count >=1
bytes_per_group_start = 22000 ; size of a group 0 object
bytes_per_group = 2500 ; size of a group <> 0 object
start_delay = 10000 ; start delay in ms - after subscribes
total_test_time = 35000 ; total transmit time in ms - including start delay