level.Warn(t.logger).Log("msg","Skipping resharding, last successful send was beyond threshold","lastSendTimestamp",lsts,"minSendTimestamp",minSendTimestamp)
returnfalse
}
returntrue
}
// calculateDesiredShards returns the number of desired shards, which will be
// the current QueueManager.numShards if resharding should not occur for reasons
// outlined in this functions implementation. It is up to the caller to reshard, or not,
@ -591,15 +607,6 @@ func (t *QueueManager) calculateDesiredShards() int {
returnt.numShards
}
// We shouldn't reshard if Prometheus hasn't been able to send to the
// remote endpoint successfully within some period of time.
level.Warn(t.logger).Log("msg","Skipping resharding, last successful send was beyond threshold","lastSendTimestamp",lsts,"minSendTimestamp",minSendTimestamp)
returnt.numShards
}
// When behind we will try to catch up on a proporation of samples per tick.
// This works similarly to an integral accumulator in that pending samples
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)