fix packet_type logging for packet_lost, packet_dropped and packet_buffered

This commit is contained in:
Marten Seemann
2021-01-07 11:12:43 +08:00
parent 84af90f2f8
commit f28db16df4
4 changed files with 52 additions and 20 deletions

View File

@@ -484,7 +484,10 @@ var _ = Describe("Tracing", func() {
Expect(entry.Time).To(BeTemporally("~", time.Now(), scaleDuration(10*time.Millisecond)))
Expect(entry.Name).To(Equal("transport:packet_buffered"))
ev := entry.Event
Expect(ev).To(HaveKeyWithValue("packet_type", "handshake"))
Expect(ev).To(HaveKey("header"))
hdr := ev["header"].(map[string]interface{})
Expect(hdr).To(HaveLen(1))
Expect(hdr).To(HaveKeyWithValue("packet_type", "handshake"))
Expect(ev).To(HaveKeyWithValue("trigger", "keys_unavailable"))
})
@@ -494,9 +497,12 @@ var _ = Describe("Tracing", func() {
Expect(entry.Time).To(BeTemporally("~", time.Now(), scaleDuration(10*time.Millisecond)))
Expect(entry.Name).To(Equal("transport:packet_dropped"))
ev := entry.Event
Expect(ev).To(HaveKeyWithValue("packet_type", "handshake"))
Expect(ev).To(HaveKey("raw"))
Expect(ev["raw"].(map[string]interface{})).To(HaveKeyWithValue("length", float64(1337)))
Expect(ev).To(HaveKey("header"))
hdr := ev["header"].(map[string]interface{})
Expect(hdr).To(HaveLen(1))
Expect(hdr).To(HaveKeyWithValue("packet_type", "handshake"))
Expect(ev).To(HaveKeyWithValue("trigger", "payload_decrypt_error"))
})
@@ -581,8 +587,11 @@ var _ = Describe("Tracing", func() {
Expect(entry.Time).To(BeTemporally("~", time.Now(), scaleDuration(10*time.Millisecond)))
Expect(entry.Name).To(Equal("recovery:packet_lost"))
ev := entry.Event
Expect(ev).To(HaveKeyWithValue("packet_type", "handshake"))
Expect(ev).To(HaveKeyWithValue("packet_number", float64(42)))
Expect(ev).To(HaveKey("header"))
hdr := ev["header"].(map[string]interface{})
Expect(hdr).To(HaveLen(2))
Expect(hdr).To(HaveKeyWithValue("packet_type", "handshake"))
Expect(hdr).To(HaveKeyWithValue("packet_number", float64(42)))
Expect(ev).To(HaveKeyWithValue("trigger", "reordering_threshold"))
})