开发者

Getting info from the monitored process

I am using god to monitor my delayed jobs. currently I suffer from exceeded memory consumption from time to time, I've set god to restart jobs exceeding 100MB. my question is: is there a way to get information from the current running job before god restarts it? this is crucial in order to know what process exactly causes the exceeded memory consumption

Thanks, 开发者_JAVA百科 Ran


You need to create a custom behavior. There are several examples in the source for god. In general, in behavior.rb you can see there is a function called before_restart() that you will need to replace with your custom logic when you subclass the Behavior class. You will then need to add some code like w.behavior(:your_new_behavior) to your god config.

Note: I have not personally done this, but looking threw the code it looks like the way to go.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜