Class: CloudstackStats::Cli
- Inherits:
-
Thor
- Object
- Thor
- CloudstackStats::Cli
- Includes:
- Thor::Actions
- Defined in:
- lib/cloudstack_stats/cli.rb
Class Method Summary collapse
-
.exit_on_failure? ⇒ Boolean
exit with return code 1 in case of a error.
Instance Method Summary collapse
Class Method Details
.exit_on_failure? ⇒ Boolean
exit with return code 1 in case of a error
67 68 69 |
# File 'lib/cloudstack_stats/cli.rb', line 67 def self.exit_on_failure? true end |
Instance Method Details
#accounts ⇒ Object
95 96 97 98 99 100 101 102 103 |
# File 'lib/cloudstack_stats/cli.rb', line 95 def accounts say "Collect stats...", :yellow stats = Collect.new().account_stats say "Write stats to influxdb...", :yellow Feed.new().write(stats) {|stat, res| print_status(stat, res)} # rescue => e # say "ERROR: ", :red # puts e.message end |
#projects ⇒ Object
81 82 83 84 85 86 87 88 89 |
# File 'lib/cloudstack_stats/cli.rb', line 81 def projects say "Collect stats...", :yellow stats = Collect.new().project_stats say "Write stats to influxdb...", :yellow Feed.new().write(stats) {|stat, res| print_status(stat, res)} rescue => e say "ERROR: ", :red puts e. end |
#version ⇒ Object
72 73 74 |
# File 'lib/cloudstack_stats/cli.rb', line 72 def version say "cloudstack_stats v#{CloudstackStats::VERSION}" end |