* Refactor calculateDesiredShards + don't reshard if we're having issues
sending samples.
* Track lastSendTimestamp via an int64 with atomic add/load, add a test
for reshard calculation.
* Simplify conditional for skipping resharding, add samplesIn/Out to shard
testcase struct.
Signed-off-by: Callum Styan <callumstyan@gmail.com>
pull/6194/head
Callum Styan5 years agocommitted byChris Marchbanks
level.Warn(t.logger).Log("msg","Skipping resharding, last successful send was beyond threshold","lastSendTimestamp",lsts,"minSendTimestamp",minSendTimestamp)
testutil.Assert(t,desiredShards==m.numShards,"expected calculateDesiredShards to not want to reshard, wants to change from %d to %d shards",m.numShards,desiredShards)
}else{
testutil.Assert(t,desiredShards!=m.numShards,"expected calculateDesiredShards to want to reshard, wants to change from %d to %d shards",m.numShards,desiredShards)