Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Qlog version 8 #8

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
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
44 changes: 19 additions & 25 deletions TypeScript/draft-01/QLog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,31 +4,25 @@

export interface IQLog {
qlog_version: string,
qlog_format?: string,
title?:string,
description?: string,
summary?:any,

traces: Array<ITrace | ITraceError>
}

export interface ITraceError {
error_description: string,
uri: string,
uri?: string,

vantage_point?: IVantagePoint
}

export interface ITrace {
vantage_point: IVantagePoint,
vantage_point?: IVantagePoint,
title?:string,
description?: string,

configuration?: IConfiguration,

common_fields?: ICommonFields,
event_fields: string[],

events: Array<Array<EventField>>
events: Array<IEvent>
}

export interface IVantagePoint{
Expand All @@ -44,16 +38,6 @@ export enum VantagePointType {
unknown = "unknown",
}

export interface IConfiguration{
time_units?:"ms"|"us",
time_offset?:string,

original_uris?: Array<string>,

// allow additional properties. This way, we can enforce proper types for the ones defined in the spec, see other properties
[additionalUserSpecifiedProperty: string]: any
}

export interface ICommonFields{
group_id?: string | Array<any>,
protocol_type?: string,
Expand All @@ -78,13 +62,21 @@ export enum IDefaultEventFieldNames {
export type EventType = ConnectivityEventType | TransportEventType | SecurityEventType | RecoveryEventType | HTTP3EventType | QPACKEventType | GenericEventType;

// FIXME: TODO: add something for the DATA definitions!
export type EventField = EventCategory | EventType | EventData | number | string; // number = for the time values, string = for unknown, user-specified fields
export interface IEvent {
time: number,
name: EventCategoryAndType,
data: EventData,
text?: string
}
// export type EventField = EventCategory | EventType | EventData | number | string; // number = for the time values, string = for unknown, user-specified fields


// ================================================================== //
// Based on QUIC draft 23
// ================================================================== //

export type EventCategoryAndType = string; // e.g., "connectivity:connection_started"

export enum EventCategory {
connectivity = "connectivity",
security = "security",
Expand Down Expand Up @@ -167,8 +159,8 @@ export type EventData = IEventServerListening | IEventConnectionStarted | IEvent
IEventKeyUpdated | IEventKeyRetired |
IEventTransportParametersSet | IEventDatagramsReceived | IEventDatagramsSent | IEventDatagramDropped | IEventPacketReceived | IEventPacketSent | IEventPacketDropped | IEventPacketBuffered | IEventStreamStateUpdated | IEventFramesProcessed |
IEventRecoveryParametersSet | IEventMetricsUpdated | IEventCongestionStateUpdated | IEventLossTimerSet | IEventLossTimerExpired | IEventPacketLost | IEventMarkedForRetransmit |
HTTP3EventData |
QPACKEventData |
HTTP3EventData |
QPACKEventData |
GenericEventData ;

// ================================================================== //
Expand Down Expand Up @@ -486,7 +478,9 @@ export enum HTTP3EventType {
stream_type_set = "stream_type_set",
frame_created = "frame_created",
frame_parsed = "frame_parsed",
data_moved = "data_moved"
data_moved = "data_moved",
datagram_received = "data_received",
dependency_update = "dependency_update"
}

export interface IEventH3ParametersSet {
Expand Down Expand Up @@ -888,7 +882,7 @@ export interface IConnectionCloseFrame{
error_space:ErrorSpace;
error_code:TransportError | ApplicationError | CryptoError | string | number;
raw_error_code:number;
reason:string; // hex
reason:string;

trigger_frame_type?:number; // TODO: should be more defined, but we don't have a FrameType enum atm...
}
Expand Down
10 changes: 5 additions & 5 deletions TypeScript/draft-01/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,10 @@ export class QUtil {
// if there is just one, we expect there to be a "group_id" in the common_fields
// if there are more, we expect "group_id" in the event_fields
// if there isn't a group_id anywhere, we currently also assume there is just 1 connection
if( trace.event_fields.indexOf("group_id") >= 0 ){
return false;
}
else
return true;
// if( trace.event_fields.indexOf("group_id") >= 0 ){
// return false;
// }
// else
return true;
}
}