{
	"name": "stats_lifecycle",
	"events": [
		{
			"type": "connection.connectRequested",
			"options": {
				"url": "wss://voice.example.test",
				"token": "token-1"
			}
		},
		{"type": "connection.connectSucceeded", "operationId": 1},
		{"type": "stats.collectRequested"},
		{
			"type": "stats.collected",
			"operationId": 2,
			"stats": {
				"rttMs": 24,
				"outbound": [
					{
						"trackSid": "mic-track",
						"source": "microphone",
						"kind": "audio",
						"bitrateKbps": 42,
						"packetsLost": 1,
						"packetsSent": 100
					},
					{
						"trackSid": "screen-track",
						"source": "screenshare",
						"kind": "video",
						"codec": "video/H265",
						"bitrateKbps": 3500,
						"packetsLost": 0,
						"effectiveFps": 58.5,
						"configuredFps": 60,
						"targetFps": 60,
						"width": 1920,
						"height": 1080,
						"zeroCopy": true
					}
				],
				"inbound": [
					{
						"participantIdentity": "remote-user",
						"participantSid": "participant-1",
						"trackSid": "remote-audio",
						"kind": "audio",
						"bitrateKbps": 36,
						"packetsLost": 3,
						"packetsReceived": 97,
						"jitterMs": 7
					}
				],
				"droppedNativeVideoFrames": 2,
				"droppedVideoFrameCallbacks": 1
			}
		}
	],
	"expectedCommands": [
		[
			{
				"type": "connection.connect",
				"operationId": 1,
				"options": {"url": "wss://voice.example.test", "token": "token-1"}
			}
		],
		[],
		[{"type": "stats.collect", "operationId": 2}],
		[]
	],
	"expected": {
		"nextOperationId": 3,
		"statsOperationId": null,
		"statsFailureCode": null,
		"summary": {
			"network": {
				"audioSendBitrateKbps": 42,
				"audioRecvBitrateKbps": 36,
				"videoSendBitrateKbps": 3500,
				"videoRecvBitrateKbps": 0,
				"audioPacketLossPercent": 3,
				"videoPacketLossPercent": 0,
				"jitterMs": 7,
				"rttMs": 24
			},
			"localAudio": {"trackIdentifier": "mic-track"},
			"localScreenShare": {
				"trackIdentifier": "screen-track",
				"codec": "video/H265",
				"effectiveFramesPerSecond": 58.5,
				"configuredFramesPerSecond": 60,
				"targetFramesPerSecond": 60,
				"frameWidth": 1920,
				"frameHeight": 1080
			},
			"remoteAudio": {"trackIdentifier": "remote-audio"}
		}
	}
}
