Skip to content
This repository was archived by the owner on Apr 15, 2024. It is now read-only.
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
12 changes: 12 additions & 0 deletions consul/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -806,6 +806,18 @@ def force_leave(self, node):
return self.agent.http.put(
CB.bool(), '/v1/agent/force-leave/%s' % node)

def metrics(self, token=None):
"""
Returns dump of the metrics for the most recent finished interval
"""
params = []
token = token or self.agent.token
if token:
params.append(('token', token))
return self.agent.http.get(
CB.json(), '/v1/agent/metrics',
params=params)

class Service(object):
def __init__(self, agent):
self.agent = agent
Expand Down