gitorious-munin-plugins 0.9.20 → 0.9.21

Sign up to get free protection for your applications and to get access to all the features.
@@ -6,6 +6,7 @@ require "gitorious-munin-plugins/config"
6
6
  require "gitorious-munin-plugins/cli"
7
7
  require "gitorious-munin-plugins/plugin"
8
8
  require "gitorious-munin-plugins/usage_plugin"
9
+ require "gitorious-munin-plugins/memory_gauge"
9
10
  require "term/ansicolor"
10
11
  require "trollop"
11
12
 
@@ -2,9 +2,11 @@ module GitoriousMuninPlugins
2
2
  class Plugin
3
3
  def self.all
4
4
  root.children.collect do |plugin|
5
- name = plugin.basename.to_s.sub(/\.rb/, "")
6
- new(name)
7
- end
5
+ if plugin.basename.to_s.split(".").last == "rb"
6
+ name = plugin.basename.to_s.sub(/\.rb/, "")
7
+ new(name)
8
+ end
9
+ end.compact
8
10
  end
9
11
 
10
12
  # Root of all plugins
@@ -0,0 +1,22 @@
1
+ # Display memory usage in the poller process
2
+ config = GitoriousMuninPlugins::Config.new
3
+
4
+ Pid = config.gitorious_home + "tmp/pids/poller0.pid"
5
+
6
+ case ARGV.shift
7
+ when "autoconf"
8
+ puts "no"
9
+ when "config"
10
+ puts "graph_title Poller memory usage"
11
+ puts "graph_args -l 0"
12
+ puts "graph_vlabel Memory usage"
13
+ puts "graph_category Gitorious"
14
+ puts "curr.label vsize"
15
+ puts "curr.warning 524288" # 512M
16
+ puts "curr.critical 1048576" # 1G
17
+ else
18
+ usage = GitoriousMuninPlugins::MemoryGauge.new.by_pid(Pid)
19
+ if usage
20
+ puts usage
21
+ end
22
+ end
@@ -0,0 +1,18 @@
1
+ database = GitoriousMuninPlugins::Database.new
2
+ cmd = ARGV.shift
3
+ case cmd
4
+ when "autoconf"
5
+ puts "no"
6
+ when "config"
7
+ puts "graph_title New Projects (within last 24 hrs)"
8
+ puts 'graph_args -l 0'
9
+ puts 'graph_vlabel Projects'
10
+ puts 'graph_category Gitorious'
11
+ puts "new.label Projects"
12
+ puts "new.draw LINE2"
13
+ puts "new.type GAUGE"
14
+ else
15
+ database.select("select count(*) as count from projects where created_at >= date_sub(now(), interval 24 hour)").each_hash do |row|
16
+ puts "new.value #{row['count'].to_i}"
17
+ end
18
+ end
@@ -0,0 +1,18 @@
1
+ database = GitoriousMuninPlugins::Database.new
2
+ cmd = ARGV.shift
3
+ case cmd
4
+ when "autoconf"
5
+ puts "no"
6
+ when "config"
7
+ puts "graph_title New Repositories (within last 24 hrs)"
8
+ puts 'graph_args -l 0'
9
+ puts 'graph_vlabel Repositories'
10
+ puts 'graph_category Gitorious'
11
+ puts "new.label Repositories"
12
+ puts "new.draw LINE2"
13
+ puts "new.type GAUGE"
14
+ else
15
+ database.select("select count(*) as count from repositories where created_at >= date_sub(now(), interval 24 hour)").each_hash do |row|
16
+ puts "new.value #{row['count'].to_i}"
17
+ end
18
+ end
@@ -0,0 +1,22 @@
1
+ # Display memory usage in the sphinx daemon
2
+ config = GitoriousMuninPlugins::Config.new
3
+ env = config.rails_env
4
+ Pid = config.gitorious_home + "log/searchd.#{env}.pid"
5
+
6
+ case ARGV.shift
7
+ when "autoconf"
8
+ puts "no"
9
+ when "config"
10
+ puts "graph_title Sphinx daemon memory usage"
11
+ puts "graph_args -l 0"
12
+ puts "graph_vlabel Memory usage"
13
+ puts "graph_category Gitorious"
14
+ puts "curr.label vsize"
15
+ puts "curr.warning 524288" # 512M
16
+ puts "curr.critical 1048576" # 1G
17
+ else
18
+ usage = GitoriousMuninPlugins::MemoryGauge.new.by_pid(Pid)
19
+ if usage
20
+ puts usage
21
+ end
22
+ end
@@ -1,3 +1,3 @@
1
1
  module GitoriousMuninPlugins
2
- VERSION = "0.9.20"
2
+ VERSION = "0.9.21"
3
3
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gitorious-munin-plugins
3
3
  version: !ruby/object:Gem::Version
4
- hash: 19
4
+ hash: 17
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 9
9
- - 20
10
- version: 0.9.20
9
+ - 21
10
+ version: 0.9.21
11
11
  platform: ruby
12
12
  authors:
13
13
  - Marius Mathiesen
@@ -83,6 +83,10 @@ files:
83
83
  - lib/gitorious-munin-plugins/plugins/git_proxy.rb
84
84
  - lib/gitorious-munin-plugins/plugins/gitorious_clones.rb
85
85
  - lib/gitorious-munin-plugins/plugins/gitorious_disk_usage.rb
86
+ - lib/gitorious-munin-plugins/plugins/gitorious_poller_usage.rb
87
+ - lib/gitorious-munin-plugins/plugins/gitorious_projects.rb
88
+ - lib/gitorious-munin-plugins/plugins/gitorious_repositories.rb
89
+ - lib/gitorious-munin-plugins/plugins/gitorious_sphinx.rb
86
90
  - lib/gitorious-munin-plugins/plugins/gitorious_ssh_keys.rb
87
91
  - lib/gitorious-munin-plugins/plugins/gitorious_users.rb
88
92
  - lib/gitorious-munin-plugins/usage_plugin.rb