Permalink
Browse files

Adds connection monitoring to mongo_overview

  • Loading branch information...
1 parent 8ac7812 commit 4d6b4fadc0ba08eaa07d3ba63d2c6e9f9b3e6d56 @miketheman miketheman committed Aug 24, 2012
Showing with 19 additions and 1 deletion.
  1. +5 −0 mongo_overview/mongo_overview.rb
  2. +9 −1 mongo_overview/mongo_overview.yml
  3. +5 −0 mongo_overview/test.rb
@@ -124,6 +124,11 @@ def get_server_status
counter(:op_updates, stats['opcounters']['update'], :per => :second)
counter(:op_deletes, stats['opcounters']['delete'], :per => :second)
counter(:op_get_mores, stats['opcounters']['getmore'], :per => :second)
+
+ # connections
+ report(:connections_current => stats['connections']['current'])
+ report(:connections_available => stats['connections']['available'])
+
end
# Handles 3 metrics - a counter for the +divended+ and +divisor+ and a ratio, named +ratio_name+,
@@ -58,7 +58,15 @@ metadata:
units: /sec
precision: "2"
label: Op Get mores
-
+ connections_current:
+ units: ""
+ precision: "0"
+ label: Connections Current
+ connections_available:
+ units: ""
+ precision: "0"
+ label: Connections Available
+
triggers:
- type: trend
data_series_name: op_queries
View
@@ -47,6 +47,11 @@ def test_should_parse_stats
first_run_memory = res[:memory]
assert_equal SERVER_STATUS['globalLock']['totalTime'],
first_run_memory[:global_lock_total_time]
+
+ assert_equal SERVER_STATUS['connections']['current'],
+ res[:reports].find { |r| r.keys.include?(:connections_current)}[:connections_current]
+ assert_equal SERVER_STATUS['connections']['available'],
+ res[:reports].find { |r| r.keys.include?(:connections_available)}[:connections_available]
# 2nd run, 10 minutes later, to test counters.
Timecop.travel(time) do

0 comments on commit 4d6b4fa

Please sign in to comment.