Sha256: 2f0b92a095ef9ec72c377f58c3c88d1417bb6a7e4e61f4a83a6f4aae4850848b

Contents?: true

Size: 461 Bytes

Versions: 8

Compression:

Stored size: 461 Bytes

Contents

# frozen_string_literal: true

module StatsLite
  DEFAULT_COMMANDS = {
    host: {
      hostname: "hostname",
      ip: {
        public: "curl -s ifconfig.me"
      }
    },
    cpu: {
      model: "lscpu | grep 'Model name' | cut -f 2 -d \":\" | awk '{$1=$1}1'",
      cores: "nproc",
      usage: <<-CMD
(grep 'cpu ' /proc/stat;sleep 0.1;grep 'cpu ' /proc/stat)|awk -v RS="" '{print ""($13-$2+$15-$4)*100/($13-$2+$15-$4+$16-$5)"%"}'
      CMD
    }
  }
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
stats_lite-0.8.1 lib/stats_lite/default_commands.rb
stats_lite-0.8.0 lib/stats_lite/default_commands.rb
stats_lite-0.7.2 lib/stats_lite/default_commands.rb
stats_lite-0.7.1 lib/stats_lite/default_commands.rb
stats_lite-0.7.0 lib/stats_lite/default_commands.rb
stats_lite-0.6.2 lib/stats_lite/default_commands.rb
stats_lite-0.6.1 lib/stats_lite/default_commands.rb
stats_lite-0.6.0 lib/stats_lite/default_commands.rb