Github user alexbb commented on a diff in the pull request:
https://github.com/apache/zookeeper/pull/425#discussion_r155075540
--- Diff: src/contrib/monitoring/check_zookeeper.py ---
@@ -169,11 +169,16 @@ def __init__(self, host='localhost', port='2181',
timeout=1):
def get_stats(self):
""" Get ZooKeeper server stats as a map """
data = self._send_cmd('mntr')
+ stat = self._parse_stat(self._send_cmd('stat'))
if data:
- return self._parse(data)
+ mntr = self._parse(data)
+ missing = ['zk_zxid', 'zk_zxid_counter', 'zk_zxid_epoch']
--- End diff --
How about changing the below to:
```python
for s in stat:
if s not in mntr:
mntr[s] = stat[s]
```
It will have the same effect now, but if future things are added to stat
but not mntr we'd pick them up.
---