forked from quic-go/quic-go
add the time_format field to qlog common_fields
This commit is contained in:
@@ -102,6 +102,7 @@ var _ = Describe("Tracing", func() {
|
||||
Expect(commonFields).To(HaveKey("reference_time"))
|
||||
referenceTime := time.Unix(0, int64(commonFields["reference_time"].(float64)*1e6))
|
||||
Expect(referenceTime).To(BeTemporally("~", time.Now(), scaleDuration(10*time.Millisecond)))
|
||||
Expect(commonFields).To(HaveKeyWithValue("time_format", "relative"))
|
||||
Expect(trace).To(HaveKey("vantage_point"))
|
||||
vantagePoint := trace["vantage_point"].(map[string]interface{})
|
||||
Expect(vantagePoint).To(HaveKeyWithValue("type", "server"))
|
||||
|
||||
@@ -49,6 +49,7 @@ func (f commonFields) MarshalJSONObject(enc *gojay.Encoder) {
|
||||
enc.StringKey("group_id", f.ODCID.String())
|
||||
enc.StringKeyOmitEmpty("protocol_type", f.ProtocolType)
|
||||
enc.Float64Key("reference_time", float64(f.ReferenceTime.UnixNano())/1e6)
|
||||
enc.StringKey("time_format", "relative")
|
||||
}
|
||||
|
||||
func (f commonFields) IsNil() bool { return false }
|
||||
|
||||
Reference in New Issue
Block a user