python-diamond / Diamond

Diamond is a python daemon that collects system metrics and publishes them to Graphite (and others). It is capable of collecting cpu, memory, network, i/o, load and disk metrics. Additionally, it features an API for implementing custom collectors for gathering metrics from almost any source.
http://diamond.readthedocs.org/
MIT License
1.74k stars 601 forks source link

use dict(Counter(x)+Counter(y)) to calc sum of dicts #626

Closed williamjoy closed 7 years ago

williamjoy commented 7 years ago

fix syntax error on python 2.6

[2017-03-30 06:56:15,401] [MainThread] Failed to import module: mesos. Traceback (most recent call last):
  File "/usr/lib/python2.6/site-packages/diamond/utils/classes.py", line 159, in load_collectors_from_paths
    mod = imp.load_module(modname, fp, pathname, description)
  File "/usr/share/diamond/collectors/mesos/mesos.py", line 175
    for key in stats
      ^
SyntaxError: invalid syntax
coveralls commented 7 years ago

Coverage Status

Coverage remained the same at 24.964% when pulling 2d626dbb933a49e376984020d809f9d55832b278 on williamjoy:patch-1 into 1c0935bdd3752b11a3d0a5039fd1bb550be93456 on python-diamond:master.

shortdudey123 commented 7 years ago

Based on the fact that the bug was not causing tests to fail, can you add a test to cover the method that you fixed? that will keep it from being broken in the future.

coveralls commented 7 years ago

Coverage Status

Coverage remained the same at 24.964% when pulling 3bb209230d5c052c362aa3ebb25d93f376985c56 on williamjoy:patch-1 into 1c0935bdd3752b11a3d0a5039fd1bb550be93456 on python-diamond:master.

williamjoy commented 7 years ago

The code is incompatible with python 2.6, and collection.Counter also does not work for python 2.6.

Closing this and looking for other solution

shortdudey123 commented 7 years ago

Gotcha, thanks for looking at this :) Can you file an issue as well? that way it can be tracked if you don't have a chance to figure out another solution