You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When aggregation is enabled, statsd-instrument attempts to Array#sort!. This breaks things when frozen arrays are used, as it attempts to mutate the array.
This blew up in production for me since our test suite doesn't enable aggregation, since doing so would cause assert_statsd_* assertions to fail.
Ideally, we wouldn't need to call Array#sort because that incurs an allocation. In my specific case, the array was a simple TAGS = ["foo:bar"].freeze, so sorting was not even necessary. If we must sort, maybe a good middle ground would be something like:
iftags.length > 1tags.sortelsetagsend
Thoughts?
cc: @pedro-stanaka since you've been working on this feature
The text was updated successfully, but these errors were encountered:
When aggregation is enabled, statsd-instrument attempts to
Array#sort!
. This breaks things when frozen arrays are used, as it attempts to mutate the array.This blew up in production for me since our test suite doesn't enable aggregation, since doing so would cause
assert_statsd_*
assertions to fail.Ideally, we wouldn't need to call
Array#sort
because that incurs an allocation. In my specific case, the array was a simpleTAGS = ["foo:bar"].freeze
, so sorting was not even necessary. If we must sort, maybe a good middle ground would be something like:Thoughts?
cc: @pedro-stanaka since you've been working on this feature
The text was updated successfully, but these errors were encountered: