Sha256: ef1275cfe8ffec7692b45b1f076672a0fcd6a7bdb572d3126c15885c9e9a48e2

Contents?: true

Size: 231 Bytes

Versions: 28

Compression:

Stored size: 231 Bytes

Contents

module Shipit
  module Stat
    extend self

    def p90(numbers)
      percentile(90, numbers)
    end

    def percentile(percentile, numbers)
      numbers.sort[((numbers.size - 1) * percentile / 100.0).floor]
    end
  end
end

Version data entries

28 entries across 28 versions & 1 rubygems

Version Path
shipit-engine-0.31.0 lib/shipit/stat.rb
shipit-engine-0.30.0 lib/shipit/stat.rb
shipit-engine-0.29.0 lib/shipit/stat.rb
shipit-engine-0.28.1 lib/shipit/stat.rb
shipit-engine-0.28.0 lib/shipit/stat.rb
shipit-engine-0.27.1 lib/shipit/stat.rb
shipit-engine-0.27.0 lib/shipit/stat.rb
shipit-engine-0.26.0 lib/shipit/stat.rb
shipit-engine-0.25.1 lib/shipit/stat.rb
shipit-engine-0.25.0 lib/shipit/stat.rb
shipit-engine-0.24.0 lib/shipit/stat.rb
shipit-engine-0.23.1 lib/shipit/stat.rb
shipit-engine-0.23.0 lib/shipit/stat.rb
shipit-engine-0.22.0 lib/shipit/stat.rb
shipit-engine-0.21.0 lib/shipit/stat.rb
shipit-engine-0.20.1 lib/shipit/stat.rb
shipit-engine-0.20.0 lib/shipit/stat.rb
shipit-engine-0.19.0 lib/shipit/stat.rb
shipit-engine-0.18.1 lib/shipit/stat.rb
shipit-engine-0.18.0 lib/shipit/stat.rb