feat(common,server): add ProtocolMode and route server through protocol dispatch

This commit is contained in:
2026-02-26 14:50:49 +02:00
parent 0ea39e7663
commit 6198e3ab2e
11 changed files with 79 additions and 47 deletions

View File

@@ -1,5 +1,3 @@
//! Common types and utilities for the TLS benchmark harness
pub mod cert;
pub mod error;
pub mod prelude;
@@ -10,7 +8,7 @@ use serde::{Deserialize, Serialize};
use std::fmt;
use strum::{Display, EnumString};
/// TLS key exchange mode
/// TLS 1.3 key exchange mode used for benchmark runs
#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize, EnumString, Display)]
#[strum(serialize_all = "lowercase")]
#[serde(rename_all = "lowercase")]
@@ -21,6 +19,23 @@ pub enum KeyExchangeMode {
X25519Mlkem768,
}
/// Application protocol carried over TLS in benchmark runs.
///
/// `Raw` is a minimal custom framing protocol (8-byte LE length request, then N payload bytes)
/// used for low-overhead microbenchmarks.
///
/// `Http1` is an HTTP/1.1 request/response mode (`GET /bytes/{n}`) used for realism-oriented
/// comparisons where HTTP parsing and headers are part of measured overhead.
#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize, EnumString, Display)]
#[strum(serialize_all = "lowercase")]
#[serde(rename_all = "lowercase")]
pub enum ProtocolMode {
/// Minimal custom framing protocol for primary microbenchmarks.
Raw,
/// HTTP/1.1 mode for realism-oriented comparisons.
Http1,
}
/// A single benchmark measurement record, output as NDJSON
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct BenchRecord {