# File lib/taps/data_stream.rb, line 269
  def calc_limit(chunksize)
    # we want to not fetch more than is needed while we're
    # inside sinatra but locally we can select more than
    # is strictly needed
    if defined?(Sinatra)
      (chunksize * 1.1).ceil
    else
      (chunksize * 3).ceil
    end
  end