python - 尝试使用 whisper-merge 时出现错误 "TypeError: ' NoneType' object is not iterable"

标签 python graphite whisper

我正在尝试使用 whisper-merge合并 2 个 wsp 文件。他们有相同的保留策略,一个只是拥有比另一个更旧的数据。

当我运行 whisper-merge oldfile.wsp newfile.wsp 时出现此错误

Traceback (most recent call last):
  File "/usr/local/src/whisper-0.9.12/bin/whisper-merge.py", line 32, in <module>
    whisper.merge(path_from, path_to)
  File "/usr/local/lib/python2.7/dist-packages/whisper.py", line 821, in merge
    (timeInfo, values) = fetch(path_from, fromTime, untilTime)
TypeError: 'NoneType' object is not iterable

有什么想法吗?

这是 2 个文件的元数据输出:

最佳答案

whisper.py 中的第 812 行因包含多个存档的文件而中断。 https://github.com/graphite-project/whisper/blob/0.9.12/whisper.py#L812

fromTime = int(time.time()) - headerFrom['maxRetention']

要修复,紧接着第 813 行,根据存档保留分配 fromTime。 https://github.com/graphite-project/whisper/blob/0.9.12/whisper.py#L813

for archive in archives: # this line already exists
  fromTime = int(time.time()) - archive['retention'] # add this line

关于python - 尝试使用 whisper-merge 时出现错误 "TypeError: ' NoneType' object is not iterable",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25030467/

相关文章:

python - 带有\b 和非单词字符的正则表达式(如 '.' )

c++ - 使用python在c++文件中查找某个函数的调用

python - 如何使用 PyQt4 从 closeEvent 处理检测注销/关闭?

linux - 如何向 Graphite 服务器输入数据

python - Graphite:帮我解释 whisper-info.py 输出

python - 使用 Python 进行依赖测试

graphite - 比较 t 和 t-7 天的值

data-visualization - 除了 Graphite 之外,还有用于 statsd 数据的 GUI 吗?

graphite - 碳/ Graphite 对旧数据应用新的保留

graphite - 云环境下如何处理Whisper的预分配?