Révision b9781d98
fix issue #3
| plugins/solr/solr4_ | ||
|---|---|---|
| 336 | 336 |
def _cacheConfig(self, cacheType, cacheName): |
| 337 | 337 |
return CACHE_GRAPH_TPL.format(core=self.params['core'], cacheType=cacheType, cacheName=cacheName) |
| 338 | 338 |
|
| 339 |
def _format4Value(self, value): |
|
| 340 |
if isinstance(value, basestring): |
|
| 341 |
return "%s" |
|
| 342 |
if isinstance(value, int): |
|
| 343 |
return "%d" |
|
| 344 |
if isinstance(value, float): |
|
| 345 |
return "%.6f" |
|
| 346 |
return "%s" |
|
| 347 |
|
|
| 339 | 348 |
def _cacheFetch(self, cacheType, fields = None): |
| 340 | 349 |
fields = fields or ['size', 'lookups', 'hits', 'inserts', 'evictions'] |
| 341 | 350 |
hits_fields = ['lookups', 'hits', 'inserts'] |
| ... | ... | |
| 345 | 354 |
data = getattr(solrmbean, cacheType)() |
| 346 | 355 |
results.append('multigraph solr_{core}_{cacheType}_hit_rates'.format(core=self.params['core'], cacheType=cacheType))
|
| 347 | 356 |
for label in hits_fields: |
| 348 |
results.append("%s.value %.8f" % (label, data[label]))
|
|
| 357 |
vformat = self._format4Value(data[label]) |
|
| 358 |
results.append(("%s.value " + vformat) % (label, data[label]))
|
|
| 349 | 359 |
results.append('multigraph solr_{core}_{cacheType}_size'.format(core=self.params['core'], cacheType=cacheType))
|
| 350 | 360 |
for label in size_fields: |
| 351 | 361 |
results.append("%s.value %d" % (label, data[label]))
|
Formats disponibles : Unified diff