Skip to content
Open
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
4 changes: 2 additions & 2 deletions h3i/src/client/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ pub(crate) fn execute_action(
// need to rewrite the event time
ev.time = Instant::now()
.duration_since(s.start_time())
.as_secs_f32() *
.as_secs_f64() *
1000.0;
s.add_event(ev).ok();
},
Expand Down Expand Up @@ -190,7 +190,7 @@ pub(crate) fn execute_action(
// need to rewrite the event time
ev.time = Instant::now()
.duration_since(s.start_time())
.as_secs_f32() *
.as_secs_f64() *
1000.0;
s.add_event(ev).ok();
},
Expand Down
2 changes: 1 addition & 1 deletion h3i/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -415,7 +415,7 @@ fn prompt_frames(config: &Config) -> Vec<Action> {
// need to rewrite the event time
ev.time = Instant::now()
.duration_since(streamer.start_time())
.as_secs_f32() *
.as_secs_f64() *
1000.0;
streamer.add_event(ev).ok();
},
Expand Down
2 changes: 1 addition & 1 deletion h3i/src/recordreplay/qlog.rs
Original file line number Diff line number Diff line change
Expand Up @@ -627,7 +627,7 @@ mod tests {
use quiche::h3::Header;
use serde_json;

const NOW: f32 = 123.0;
const NOW: f64 = 123.0;
const H3I_WAIT: &str = "h3i:wait";

#[test]
Expand Down
8 changes: 4 additions & 4 deletions qlog-dancer/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@ pub struct AppConfig {

pub dark_mode: bool,

pub start: Option<f32>,
pub end: Option<f32>,
pub start: Option<f64>,
pub end: Option<f64>,

pub stream_y_max: Option<u64>,
pub cwnd_y_max: Option<u64>,
Expand Down Expand Up @@ -209,8 +209,8 @@ impl AppConfig {
.remove_one::<String>("charts_directory")
.unwrap_or(format!("{filename}-charts"));

let start = matches.remove_one::<f32>("start");
let end = matches.remove_one::<f32>("end");
let start = matches.remove_one::<f64>("start");
let end = matches.remove_one::<f64>("end");

if end.is_some() && end < start {
return Err("End time cannot be earlier than start time.".into());
Expand Down
92 changes: 46 additions & 46 deletions qlog-dancer/src/datastore.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ use crate::trackers::StreamBufferTracker;
use crate::trackers::StreamMaxTracker;
use crate::LogFileData;
use crate::PacketType;
use crate::QlogPointf32;
use crate::QlogPointRtt;
use crate::QlogPointu64;
use crate::RawLogEvents::Netlog;
use netlog;
Expand All @@ -71,8 +71,8 @@ pub type ParseResult<T> = Result<T, serde_json::Error>;
pub struct PacketInfoStub {
pub acked: Option<bool>,
pub raw: Option<RawInfo>,
pub created_time: f32,
pub send_at_time: Option<f32>,
pub created_time: f64,
pub send_at_time: Option<f64>,
pub ty: PacketType,
pub number: u64,
}
Expand All @@ -95,21 +95,21 @@ pub struct PrintStatsConfig {

#[derive(Clone, Copy, Debug, Default)]
pub struct RequestAtServerDeltas {
pub rx_hdr_tx_hdr: NaOption<f32>,
pub rx_hdr_tx_first_data: NaOption<f32>,
pub rx_hdr_tx_last_data: NaOption<f32>,
pub tx_first_data_tx_last_data: NaOption<f32>,
pub rx_hdr_tx_hdr: NaOption<f64>,
pub rx_hdr_tx_first_data: NaOption<f64>,
pub rx_hdr_tx_last_data: NaOption<f64>,
pub tx_first_data_tx_last_data: NaOption<f64>,
}

#[derive(Clone, Copy, Debug, Default)]
pub struct RequestAtClientDeltas {
pub discover_tx_hdr: NaOption<f32>,
pub tx_hdr_rx_hdr: NaOption<f32>,
pub tx_hdr_rx_first_data: NaOption<f32>,
pub tx_hdr_rx_last_data: NaOption<f32>,
pub tx_first_data_tx_last_data: NaOption<f32>,
pub rx_first_data_rx_last_data: NaOption<f32>,
pub rx_hdr_rx_last_data: NaOption<f32>,
pub discover_tx_hdr: NaOption<f64>,
pub tx_hdr_rx_hdr: NaOption<f64>,
pub tx_hdr_rx_first_data: NaOption<f64>,
pub tx_hdr_rx_last_data: NaOption<f64>,
pub tx_first_data_tx_last_data: NaOption<f64>,
pub rx_first_data_rx_last_data: NaOption<f64>,
pub rx_hdr_rx_last_data: NaOption<f64>,
}

#[derive(Debug, Default)]
Expand Down Expand Up @@ -255,7 +255,7 @@ pub struct Datastore {

pub client_quic_tps: TransportParameters,

pub last_event_time: f32,
pub last_event_time: f64,

// There are several packet spaces, so store a map of all packets sent
// according to packet space. Each space then contains a map of packet
Expand All @@ -279,11 +279,11 @@ pub struct Datastore {
pub local_send_rate: Vec<QlogPointu64>,
pub local_ack_rate: Vec<QlogPointu64>,

pub local_min_rtt: Vec<QlogPointf32>,
pub local_latest_rtt: Vec<QlogPointf32>,
pub local_smoothed_rtt: Vec<QlogPointf32>,
pub local_min_rtt: Vec<QlogPointRtt>,
pub local_latest_rtt: Vec<QlogPointRtt>,
pub local_smoothed_rtt: Vec<QlogPointRtt>,

pub congestion_state_updates: Vec<(f32, u64, String)>,
pub congestion_state_updates: Vec<(f64, u64, String)>,

pub received_max_data: Vec<QlogPointu64>,

Expand Down Expand Up @@ -312,25 +312,25 @@ pub struct Datastore {
pub received_reset_stream: BTreeMap<u64, Vec<QuicFrame>>,
pub sent_reset_stream: BTreeMap<u64, Vec<QuicFrame>>,

pub received_stream_frames: BTreeMap<u64, Vec<(f32, StreamDatapoint)>>,
pub received_stream_frames: BTreeMap<u64, Vec<(f64, StreamDatapoint)>>,
pub received_stream_frames_count_based:
BTreeMap<u64, Vec<(u64, StreamDatapoint)>>,
pub total_received_stream_frame_count: u64,

pub sent_stream_frames: BTreeMap<u64, Vec<(f32, QuicFrame)>>,
pub sent_stream_frames: BTreeMap<u64, Vec<(f64, QuicFrame)>>,
pub sent_stream_frames_count_based: BTreeMap<u64, Vec<(u64, QuicFrame)>>,
pub total_sent_stream_frame_count: u64,

pub received_data_frames: BTreeMap<u64, Vec<(f32, u64)>>,
pub received_data_frames: BTreeMap<u64, Vec<(f64, u64)>>,
pub received_data_frames_count_based: BTreeMap<u64, Vec<(u64, u64)>>,
pub total_received_data_frame_count: u64,
pub received_data_cumulative: BTreeMap<u64, Vec<(f32, u64)>>,
pub received_data_cumulative: BTreeMap<u64, Vec<(f64, u64)>>,
pub received_data_cumulative_max: BTreeMap<u64, u64>,

pub sent_data_frames: BTreeMap<u64, Vec<(f32, u64)>>,
pub sent_data_frames: BTreeMap<u64, Vec<(f64, u64)>>,
pub sent_data_frames_count_based: BTreeMap<u64, Vec<(u64, u64)>>,
pub total_sent_data_frame_count: u64,
pub sent_data_cumulative: BTreeMap<u64, Vec<(f32, u64)>>,
pub sent_data_cumulative: BTreeMap<u64, Vec<(f64, u64)>>,
pub sent_data_cumulative_max: BTreeMap<u64, u64>,

pub http_requests: BTreeMap<u64, HttpRequestStub>,
Expand All @@ -343,24 +343,24 @@ pub struct Datastore {
pub peer_init_max_stream_data_bidi_remote: u64,
pub peer_init_max_stream_data_uni: u64,

pub h2_recv_window_updates: BTreeMap<u32, Vec<(f32, i32)>>,
pub h2_recv_window_updates: BTreeMap<u32, Vec<(f64, i32)>>,

// Balance against incoming data to make it easier to plot in some cases
pub h2_send_window_updates_balanced: BTreeMap<u32, Vec<(f32, i32)>>,
pub h2_send_window_updates_balanced: BTreeMap<u32, Vec<(f64, i32)>>,

// Just store raw updates for clear absolute values
pub h2_send_window_updates_absolute: BTreeMap<u32, Vec<(f32, u64)>>,
pub h2_send_window_updates_absolute: BTreeMap<u32, Vec<(f64, u64)>>,

pub netlog_quic_server_window_blocked: BTreeMap<i64, Vec<f32>>,
pub netlog_quic_client_side_window_updates: BTreeMap<i64, Vec<(f32, u64)>>,
pub netlog_quic_server_window_blocked: BTreeMap<i64, Vec<f64>>,
pub netlog_quic_client_side_window_updates: BTreeMap<i64, Vec<(f64, u64)>>,

pub netlog_h2_stream_received_connection_cumulative: Vec<QlogPointu64>,
pub netlog_quic_stream_received_connection_cumulative: Vec<QlogPointu64>,

pub received_packets_netlog: Vec<(f32, PacketInfoStub)>,
pub received_packets_netlog: Vec<(f64, PacketInfoStub)>,
pub discontinuous_packet_number_count: u64,

pub netlog_ack_sent_missing_packets_raw: Vec<(f32, Vec<u64>)>,
pub netlog_ack_sent_missing_packets_raw: Vec<(f64, Vec<u64>)>,

pub total_tx_ack: usize,
pub max_ack_sent_missing_packets_size: usize,
Expand Down Expand Up @@ -411,7 +411,7 @@ impl Datastore {
&mut self, session_start_time: u64, ev_hdr: &netlog::EventHeader,
ev: &quic::Event, constants: &netlog::constants::Constants,
) {
let rel_event_time = (ev_hdr.time_num - session_start_time) as f32;
let rel_event_time = (ev_hdr.time_num - session_start_time) as f64;

match ev {
QuicSessionStreamFrameReceived(e) => {
Expand Down Expand Up @@ -688,7 +688,7 @@ impl Datastore {
&mut self, session_start_time: u64, ev_hdr: &netlog::EventHeader,
ev: &h3::Event, h3_session_requests: Option<&Vec<ReqOverH3>>,
) {
let rel_event_time = (ev_hdr.time_num - session_start_time) as f32;
let rel_event_time = (ev_hdr.time_num - session_start_time) as f64;

match ev {
Http3PriorityUpdateSent(e) => {
Expand All @@ -714,7 +714,7 @@ impl Datastore {
(r.discover_time
.wrapping_sub(session_start_time)
as i64)
as f32,
as f64,
);
break;
}
Expand Down Expand Up @@ -804,7 +804,7 @@ impl Datastore {
ev: &h2::Event, constants: &netlog::constants::Constants,
stream_bind: &StreamBindingMap,
) {
let rel_event_time = (ev_hdr.time_num - session_start_time) as f32;
let rel_event_time = (ev_hdr.time_num - session_start_time) as f64;

match ev {
Http2SessionSendSettings(e) => {
Expand Down Expand Up @@ -842,7 +842,7 @@ impl Datastore {
req.time_discovery = Some(
(sb.request_discovery_time
.wrapping_sub(session_start_time)
as i64) as f32,
as i64) as f64,
);
}

Expand Down Expand Up @@ -1221,7 +1221,7 @@ impl Datastore {
}

fn consume_qlog_packet_received(
&mut self, pr: &qlog::events::quic::PacketReceived, ev_time: f32,
&mut self, pr: &qlog::events::quic::PacketReceived, ev_time: f64,
process_acks: bool,
) {
if let Some(frames) = &pr.frames {
Expand Down Expand Up @@ -1345,7 +1345,7 @@ impl Datastore {
}

fn consume_qlog_packet_sent(
&mut self, ps: &qlog::events::quic::PacketSent, ev_time: f32,
&mut self, ps: &qlog::events::quic::PacketSent, ev_time: f64,
) {
// If there's no packet number we'll have to skip processing.
if ps.header.packet_number.is_none() {
Expand Down Expand Up @@ -1443,7 +1443,7 @@ impl Datastore {
}

fn consume_qlog_data_moved(
&mut self, dm: &qlog::events::quic::DataMoved, ev_time: f32,
&mut self, dm: &qlog::events::quic::DataMoved, ev_time: f64,
) {
if let Some(recipient) = &dm.to {
let tracker = match recipient {
Expand All @@ -1469,7 +1469,7 @@ impl Datastore {
}

fn consume_qlog_metrics_updated(
&mut self, mu: &qlog::events::quic::MetricsUpdated, ev_time: f32,
&mut self, mu: &qlog::events::quic::MetricsUpdated, ev_time: f64,
) {
if let Some(cwnd) = mu.congestion_window {
self.local_cwnd.push((ev_time, cwnd));
Expand Down Expand Up @@ -1519,7 +1519,7 @@ impl Datastore {
}

fn consume_qlog_congestion_state_updated(
&mut self, csu: &qlog::events::quic::CongestionStateUpdated, ev_time: f32,
&mut self, csu: &qlog::events::quic::CongestionStateUpdated, ev_time: f64,
) {
// give this a virtual y-value of the last cwnd value recorded, we
// can choose to use it or not later.
Expand All @@ -1541,7 +1541,7 @@ impl Datastore {
}

fn consume_qlog_h3_frame_created_client(
&mut self, fc: &qlog::events::h3::H3FrameCreated, ev_time: f32,
&mut self, fc: &qlog::events::h3::H3FrameCreated, ev_time: f64,
) {
match &fc.frame {
Http3Frame::Headers { headers } => {
Expand Down Expand Up @@ -1580,7 +1580,7 @@ impl Datastore {
}

fn consume_qlog_h3_frame_created_server(
&mut self, fc: &qlog::events::h3::H3FrameCreated, ev_time: f32,
&mut self, fc: &qlog::events::h3::H3FrameCreated, ev_time: f64,
) {
match &fc.frame {
Http3Frame::Headers { headers } => {
Expand Down Expand Up @@ -1610,7 +1610,7 @@ impl Datastore {
}

fn consume_qlog_h3_frame_parsed_client(
&mut self, fp: &qlog::events::h3::H3FrameParsed, ev_time: f32,
&mut self, fp: &qlog::events::h3::H3FrameParsed, ev_time: f64,
) {
match &fp.frame {
Http3Frame::Headers { headers } => {
Expand Down Expand Up @@ -1647,7 +1647,7 @@ impl Datastore {
}

fn consume_qlog_h3_frame_parsed_server(
&mut self, fp: &qlog::events::h3::H3FrameParsed, ev_time: f32,
&mut self, fp: &qlog::events::h3::H3FrameParsed, ev_time: f64,
) {
match &fp.frame {
Http3Frame::Headers { headers } => {
Expand Down
4 changes: 2 additions & 2 deletions qlog-dancer/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ use serde::ser::Serialize;

use crate::wirefilter::filter_sqlog_events;

pub type QlogPointu64 = (f32, u64);
pub type QlogPointf32 = (f32, f32);
pub type QlogPointu64 = (f64, u64);
pub type QlogPointRtt = (f64, f32);

#[derive(PartialEq, Eq, PartialOrd, Ord, Hash, Debug, Copy, Clone)]
pub enum PacketType {
Expand Down
Loading