mirror of
https://github.com/munin-monitoring/contrib.git
synced 2025-07-22 02:51:03 +00:00
fix issue #3
This commit is contained in:
parent
ef960abcf9
commit
b9781d98a9
1 changed files with 11 additions and 1 deletions
|
@ -336,6 +336,15 @@ class SolrMuninGraph:
|
||||||
def _cacheConfig(self, cacheType, cacheName):
|
def _cacheConfig(self, cacheType, cacheName):
|
||||||
return CACHE_GRAPH_TPL.format(core=self.params['core'], cacheType=cacheType, cacheName=cacheName)
|
return CACHE_GRAPH_TPL.format(core=self.params['core'], cacheType=cacheType, cacheName=cacheName)
|
||||||
|
|
||||||
|
def _format4Value(self, value):
|
||||||
|
if isinstance(value, basestring):
|
||||||
|
return "%s"
|
||||||
|
if isinstance(value, int):
|
||||||
|
return "%d"
|
||||||
|
if isinstance(value, float):
|
||||||
|
return "%.6f"
|
||||||
|
return "%s"
|
||||||
|
|
||||||
def _cacheFetch(self, cacheType, fields = None):
|
def _cacheFetch(self, cacheType, fields = None):
|
||||||
fields = fields or ['size', 'lookups', 'hits', 'inserts', 'evictions']
|
fields = fields or ['size', 'lookups', 'hits', 'inserts', 'evictions']
|
||||||
hits_fields = ['lookups', 'hits', 'inserts']
|
hits_fields = ['lookups', 'hits', 'inserts']
|
||||||
|
@ -345,7 +354,8 @@ class SolrMuninGraph:
|
||||||
data = getattr(solrmbean, cacheType)()
|
data = getattr(solrmbean, cacheType)()
|
||||||
results.append('multigraph solr_{core}_{cacheType}_hit_rates'.format(core=self.params['core'], cacheType=cacheType))
|
results.append('multigraph solr_{core}_{cacheType}_hit_rates'.format(core=self.params['core'], cacheType=cacheType))
|
||||||
for label in hits_fields:
|
for label in hits_fields:
|
||||||
results.append("%s.value %.8f" % (label, data[label]))
|
vformat = self._format4Value(data[label])
|
||||||
|
results.append(("%s.value " + vformat) % (label, data[label]))
|
||||||
results.append('multigraph solr_{core}_{cacheType}_size'.format(core=self.params['core'], cacheType=cacheType))
|
results.append('multigraph solr_{core}_{cacheType}_size'.format(core=self.params['core'], cacheType=cacheType))
|
||||||
for label in size_fields:
|
for label in size_fields:
|
||||||
results.append("%s.value %d" % (label, data[label]))
|
results.append("%s.value %d" % (label, data[label]))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue