Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion python/jmxquery/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ class MetricType(Enum):
COUNTER = 'counter'
GAUGE = 'gauge'

class NotStrictJSONDecoder(json.JSONDecoder):
def __init__(self, strict=False, *args, **kwargs):
json.JSONDecoder.__init__(self, strict=False, *args, **kwargs)

class JMXQuery:
"""
A JMX Query which is used to fetch specific MBean attributes/values from the JVM. The object_name can support wildcards
Expand Down Expand Up @@ -177,7 +181,7 @@ def __load_from_json(self, jsonOutput: str) -> List[JMXQuery]:
:param jsonOutput: The JSON Array returned from the command line
:return: An array of JMXQuerys
"""
jsonMetrics = json.loads(jsonOutput)
jsonMetrics = json.loads(jsonOutput, cls=NotStrictJSONDecoder)
metrics = []
for jsonMetric in jsonMetrics:
mBeanName = jsonMetric['mBeanName']
Expand Down