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



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

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

#max_minus_oneObject



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

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

#max_minus_twoObject



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

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

#maximumObject



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

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

#seventy_five_percentObject



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

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

#twenty_five_percentObject



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

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