Permalink
Browse files

Split out overview stats

  • Loading branch information...
1 parent 98da3d3 commit 982436509d5727a49ad0c9c21569dd3510d68b14 @itsderek23 itsderek23 committed Mar 19, 2013
Showing with 12 additions and 55 deletions.
  1. +3 −18 mongo_overview/mongo_overview.rb
  2. +9 −37 mongo_overview/mongo_overview.yml
@@ -7,9 +7,6 @@ class MongoOverview < Scout::Plugin
name: Rails Environment
default: production
notes: "If a database.yml exists, specify the Rails environment that should be used. If you aren't using a database.yml file, you can enter the settings manually by clicking on the 'show advanced options' link below."
- database:
- name: Mongo Database
- notes: Name of the MongoDB database to profile
host:
name: Mongo Server
notes: Where mongodb is running. If a database.yml file is used, the yml settings will override this.
@@ -69,30 +66,18 @@ def build_report
end
# Try to connect to the database
- @db = connection.db(@database)
@admin_db = connection.db('admin')
begin
- @db.authenticate(@username,@password) unless @username.nil?
+ @admin_db.authenticate(@username,@password) unless @username.nil?
rescue Mongo::AuthenticationError
- return error("Unable to authenticate to MongoDB Database.",$!.message)
+ return error("Unable to authenticate to MongoDB Admin Database.",$!.message)
end
- get_stats
get_server_status
end
- def get_stats
- stats = @db.stats
-
- report(:objects => stats['objects'])
- report(:data_size => stats['dataSize'])
- report(:storage_size => stats['storageSize'])
- report(:indexes => stats['indexes'])
- report(:index_size => stats['indexSize'])
- end
-
def get_server_status
- stats = @db.command('serverStatus' => 1)
+ stats = @admin_db.command('serverStatus' => 1)
if stats['indexCounters'] and stats['indexCounters']['btree']
counter(:btree_accesses, stats['indexCounters']['btree']['accesses'], :per => :second)
@@ -1,15 +1,4 @@
metadata:
- btree_miss_ratio:
- units: "%"
- precision: "1"
- label: Btree miss ratio
- indexes:
- precision: "0"
- label: Indexes
- global_lock_ratio:
- units: "%"
- precision: "1"
- label: Global lock ratio
btree_hits:
units: /sec
precision: "2"
@@ -18,26 +7,18 @@ metadata:
units: /sec
precision: "2"
label: Btree misses
- index_size:
- units: bytes
- precision: "0"
- label: Size of Index
- storage_size:
- units: bytes
- precision: "0"
- label: Size of Storage
- data_size:
- units: bytes
- precision: "0"
- label: Size of Data
btree_accesses:
units: /sec
precision: "2"
label: Btree accesses
- objects:
- units: ""
- precision: "0"
- label: Objects
+ btree_miss_ratio:
+ units: "%"
+ precision: "1"
+ label: Btree miss ratio
+ global_lock_ratio:
+ units: "%"
+ precision: "1"
+ label: Global lock ratio
op_updates:
units: /sec
precision: "2"
@@ -65,13 +46,4 @@ metadata:
connections_available:
units: ""
precision: "0"
- label: Connections Available
-
-triggers:
- - type: trend
- data_series_name: op_queries
- min_value: 50.0
- direction: UP
- percentage_change: 100
- duration: 180
- window_reference: LAST_WEEK
+ label: Connections Available

0 comments on commit 9824365

Please sign in to comment.