Projet

Général

Profil

Révision b9781d98

IDb9781d98a916aa1b04b6be77921bb392ccf3f56d
Parent ef960abc
Enfant 5cc126ee

Ajouté par antonio il y a environ 12 ans

fix issue #3

Voir les différences:

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