Created
June 13, 2017 07:24
-
-
Save ernestas-poskus/8830471689b257af6c386af85549f852 to your computer and use it in GitHub Desktop.
Elasticsearch shards matrix
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
m = [] | |
size = 15 | |
def shards(s, r) | |
s * r + s | |
end | |
size.times { |y| m << Array(0..size).map { |x| shards(y, x) }.join(' | ') } | |
print '| ' | |
size.times { |header| print "| #{header} " } | |
puts '|' | |
size.times { |header| print "| - " } | |
puts '| - |' | |
m.each_with_index do |row, index| | |
next if index == 0 | |
print "| #{index} | #{row} |" | |
puts | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment