Top Level Namespace
Instance Method Summary collapse
-
#cassandracmsheapnewsize ⇒ integer
Returns a value (MB) that might be suitable to set the HEAP_NEWSIZE when using the Concurrent Mark Sweep (CMS) Collector.
-
#cassandracmsmaxheapsize ⇒ integer
Returns a value (MB) that might be suitable to set the MAX_HEAP_SIZE when using the Concurrent Mark Sweep (CMS) Collector.
-
#cassandraheapnewsize ⇒ integer
Returns a value (MB) that might be suitable to set the HEAP_NEWSIZE.
-
#cassandramajorversion ⇒ integer
Extract the major version from the cassandrarelease fact.
-
#cassandramaxheapsize ⇒ integer
Returns a value (MB) that might be suitable to set the MAX_HEAP_SIZE.
-
#cassandraminorversion ⇒ integer
Extract the minor version from the cassandrarelease fact.
-
#cassandrapatchversion ⇒ integer
Extract the patch version from the cassandrarelease fact.
-
#cassandrarelease ⇒ string
Extract the release string from the running Cassandra instance.
Instance Method Details
#cassandracmsheapnewsize ⇒ integer
Returns a value (MB) that might be suitable to set the HEAP_NEWSIZE when using the Concurrent Mark Sweep (CMS) Collector. See Tuning Java resources for more details.
11 12 13 14 15 16 17 18 |
# File 'lib/facter/cassandracmsheapnewsize.rb', line 11 Facter.add('cassandracmsheapnewsize') do setcode do maxheapsize = Facter.value(:cassandracmsmaxheapsize).to_f processorcount = Facter.value(:processorcount).to_f heapnewsize = [100 * processorcount, maxheapsize * 0.25].min heapnewsize.round end end |
#cassandracmsmaxheapsize ⇒ integer
Returns a value (MB) that might be suitable to set the MAX_HEAP_SIZE when using the Concurrent Mark Sweep (CMS) Collector. See Tuning Java resources for more details.
11 12 13 14 15 16 17 18 19 |
# File 'lib/facter/cassandracmsmaxheapsize.rb', line 11 Facter.add('cassandracmsmaxheapsize') do setcode do memorysize_mb = Facter.value(:memorysize_mb).to_f calc1 = [memorysize_mb * 0.5, 1024].min calc2 = [memorysize_mb * 0.25, 14_336].min maxheapsize = [calc1, calc2].max maxheapsize.round end end |
#cassandraheapnewsize ⇒ integer
Returns a value (MB) that might be suitable to set the HEAP_NEWSIZE. See Tuning Java resources for more details.
10 11 12 13 14 15 16 17 |
# File 'lib/facter/cassandraheapnewsize.rb', line 10 Facter.add('cassandraheapnewsize') do setcode do maxheapsize = Facter.value(:cassandramaxheapsize).to_f processorcount = Facter.value(:processorcount).to_f heapnewsize = [100 * processorcount, maxheapsize * 0.25].min heapnewsize.round end end |
#cassandramajorversion ⇒ integer
Extract the major version from the cassandrarelease fact.
6 7 8 9 10 11 |
# File 'lib/facter/cassandramajorversion.rb', line 6 Facter.add('cassandramajorversion') do setcode do release = Facter.value(:cassandrarelease) release.split('.')[0].to_i if release end end |
#cassandramaxheapsize ⇒ integer
Returns a value (MB) that might be suitable to set the MAX_HEAP_SIZE. See Tuning Java resources for more details.
10 11 12 13 14 15 16 17 18 |
# File 'lib/facter/cassandramaxheapsize.rb', line 10 Facter.add('cassandramaxheapsize') do setcode do memorysize_mb = Facter.value(:memorysize_mb).to_f calc1 = [memorysize_mb * 0.5, 1024].min calc2 = [memorysize_mb * 0.25, 8192].min maxheapsize = [calc1, calc2].max maxheapsize.round end end |
#cassandraminorversion ⇒ integer
Extract the minor version from the cassandrarelease fact.
6 7 8 9 10 11 |
# File 'lib/facter/cassandraminorversion.rb', line 6 Facter.add('cassandraminorversion') do setcode do release = Facter.value(:cassandrarelease) release.split('.')[1].to_i if release end end |
#cassandrapatchversion ⇒ integer
Extract the patch version from the cassandrarelease fact.
6 7 8 9 10 11 |
# File 'lib/facter/cassandrapatchversion.rb', line 6 Facter.add('cassandrapatchversion') do setcode do release = Facter.value(:cassandrarelease) release.split('.')[2].to_i if release end end |
#cassandrarelease ⇒ string
Extract the release string from the running Cassandra instance.
undefined.
9 10 11 12 13 14 |
# File 'lib/facter/cassandrarelease.rb', line 9 Facter.add('cassandrarelease') do setcode do version = Facter::Util::Resolution.exec('nodetool version') version.match(%r{\d+\.\d+\.\d+}).to_s if version && version != '' end end |