我目前正在尝试修改一个插件,以通过 AWS 将指标发布到 new-relic。我已经成功地使插件发布指标从 swf 到 new relic(最初不是在插件中),但是如果程序运行时间过长就会遇到问题。
当程序运行大约 10 分钟时,我收到以下错误:
Error occurred in poll cycle: Rate exceeded
我相信这是来自我对工作流执行的轮询 swf
domain.workflow_executions.each do |execution|
starttime = execution.started_at
endtime = execution.closed_at
isOpen = execution.open?
status = execution.status
if endtime != nil
running_workflow_runtime_total += (endtime - starttime)
number_of_completed_executions += 1
end
if status.to_s == "open"
openCount = openCount + 1
elsif status.to_s == "completed"
completedCount = completedCount + 1
elsif status.to_s == "failed"
failedCount = failedCount + 1
elsif status.to_s == "timed_out"
timed_outCount = timed_outCount + 1
end
end
这在每 60 秒的轮询周期中调用一次
有没有办法设置轮询率?或者另一种获取工作流执行的方法?
谢谢,这是 ruby sdk for swf 的链接 =>链接