Module: LogStash::Config::CpuCoreStrategy

Extended by:
CpuCoreStrategy
Included in:
CpuCoreStrategy
Defined in:
lib/logstash/config/cpu_core_strategy.rb

Instance Method Summary collapse

Instance Method Details

#fifty_percentObject



12
13
14
# File 'lib/logstash/config/cpu_core_strategy.rb', line 12

def fifty_percent
  [1, (maximum * 0.5)].max.floor
end

#max_minus_oneObject



24
25
26
# File 'lib/logstash/config/cpu_core_strategy.rb', line 24

def max_minus_one
  [1, (maximum - 1)].max.floor
end

#max_minus_twoObject



28
29
30
# File 'lib/logstash/config/cpu_core_strategy.rb', line 28

def max_minus_two
  [1, (maximum - 2)].max.floor
end

#maximumObject



8
9
10
# File 'lib/logstash/config/cpu_core_strategy.rb', line 8

def maximum
  LogStash::Config::Defaults.cpu_cores
end

#seventy_five_percentObject



16
17
18
# File 'lib/logstash/config/cpu_core_strategy.rb', line 16

def seventy_five_percent
  [1, (maximum * 0.75)].max.floor
end

#twenty_five_percentObject



20
21
22
# File 'lib/logstash/config/cpu_core_strategy.rb', line 20

def twenty_five_percent
  [1, (maximum * 0.25)].max.floor
end