Skip to content

Commit

Permalink
[tokumx] Handle int64 and update yaml
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnLZeller committed Mar 30, 2016
1 parent f4c3456 commit 035285b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 5 additions & 1 deletion checks.d/tokumx.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import types

# 3p
import bson
from pymongo import (
MongoClient,
ReadPreference,
Expand Down Expand Up @@ -453,7 +454,10 @@ def collect_metrics(self, server, conn, db, tags):
continue

# value is now status[x][y][z]
assert type(value) in (types.IntType, types.LongType, types.FloatType)
if type(value) == bson.int64.Int64:
value = float(value)
else:
assert type(value) in (types.IntType, types.LongType, types.FloatType)

# Check if metric is a gauge or rate
if m in self.GAUGES:
Expand Down
2 changes: 2 additions & 0 deletions conf.d/tokumx.yaml.example
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
init_config:

instances:
# Specify the MongoDB URI, with database to use for reporting (defaults to "admin")
# E.g. mongodb://datadog:LnCbkX4uhpuLHSUrcayEoAZA@localhost:27017/my-db
- server: mongodb://localhost:27017
# tags:
# - optional_tag1
Expand Down

0 comments on commit 035285b

Please sign in to comment.