Skip to content

v12.2.1

@tsenart tsenart tagged this 05 Mar 20:14
* attack: Force monotonic timestamp marshalling

This commit forces result timestamps to be monotonically increasing.

This is necessary because the built-in monotonic time reading of the standard
library time package is discarded when marshalling a time.Time instance.

This can lead to non-monotonic timestamps in vegeta results of a single
attack.

Although an explicit decision as stated in the time package documentation,
this assumption seems surprising to me.

From: https://golang.org/pkg/time/#hdr-Monotonic_Clocks

> Because the monotonic clock reading has no meaning outside the current
> process, the serialized forms generated by t.GobEncode, t.MarshalBinary,
> t.MarshalJSON, and t.MarshalText omit the monotonic clock reading,
> and t.Format provides no format for it. Similarly, the constructors
> time.Date, time.Parse, time.ParseInLocation, and time.Unix, as well as
> the unmarshalers t.GobDecode, t.UnmarshalBinary. t.UnmarshalJSON, and
> t.UnmarshalText always create times with no monotonic clock reading.

* Add github.com/gavv/monotime to Gopkg.*

* fixup! Remove redundant monotime dependency
Assets 2
Loading