Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add a heartbeat log per retry of a job #50

Merged
merged 3 commits into from
Jul 22, 2016

Conversation

natebrennand
Copy link
Contributor

This adds a once per minute heartbeat log to be outputted for each retry
of a job.


test strategy:

sleep.sh:

sleep 30

with tickUnit := time.Second...

go run cmd/gearcmd/*.go -cmd /home/vagrant/go/src/github.com/Clever/gearcmd/sleep.sh -name ticker-test -port 4730 -host <gearmand-server>
{"job":"ticker-test","level":"info","source":"gearcmd","title":"listening"}
{"function":"ticker-test","job_data":"{\"foo\":\"bar\"}","job_id":"214","level":"info","source":"gearcmd","title":"START"}
{"function":"ticker-test","job_id":"214","level":"info","source":"gearcmd","title":"heartbeat","try_number":0,"type":"gauge","unit":"1s","value":1}
{"function":"ticker-test","job_id":"214","level":"info","source":"gearcmd","title":"heartbeat","try_number":0,"type":"gauge","unit":"1s","value":2}
{"function":"ticker-test","job_id":"214","level":"info","source":"gearcmd","title":"heartbeat","try_number":0,"type":"gauge","unit":"1s","value":3}
{"function":"ticker-test","job_id":"214","level":"info","source":"gearcmd","title":"heartbeat","try_number":0,"type":"gauge","unit":"1s","value":4}
{"function":"ticker-test","job_id":"214","level":"info","source":"gearcmd","title":"heartbeat","try_number":0,"type":"gauge","unit":"1s","value":5}
{"function":"ticker-test","job_id":"214","level":"info","source":"gearcmd","title":"heartbeat","try_number":0,"type":"gauge","unit":"1s","value":6}
{"function":"ticker-test","job_id":"214","level":"info","source":"gearcmd","title":"heartbeat","try_number":0,"type":"gauge","unit":"1s","value":7}
{"function":"ticker-test","job_id":"214","level":"info","source":"gearcmd","title":"heartbeat","try_number":0,"type":"gauge","unit":"1s","value":8}
{"function":"ticker-test","job_id":"214","level":"info","source":"gearcmd","title":"heartbeat","try_number":0,"type":"gauge","unit":"1s","value":9}
{"function":"ticker-test","job_id":"214","level":"info","source":"gearcmd","title":"heartbeat","try_number":0,"type":"gauge","unit":"1s","value":10}

@evaninja
Copy link
Contributor

LGTM

@evaninja evaninja assigned natebrennand and unassigned evaninja Jul 22, 2016
evaninja and others added 3 commits July 22, 2016 17:35
This adds a once per minute heartbeat log to be outputted for each retry
of a job.

-------

test strategy:

sleep.sh:
```sh
sleep 30
```

with `tickUnit := time.Second`...
```sh
go run cmd/gearcmd/*.go -cmd /home/vagrant/go/src/github.com/Clever/gearcmd/sleep.sh -name ticker-test -port 4730 -host <gearmand-server>
{"job":"ticker-test","level":"info","source":"gearcmd","title":"listening"}
{"function":"ticker-test","job_data":"{\"foo\":\"bar\"}","job_id":"214","level":"info","source":"gearcmd","title":"START"}
{"function":"ticker-test","job_id":"214","level":"info","source":"gearcmd","title":"heartbeat","try_number":0,"type":"gauge","unit":"1s","value":1}
{"function":"ticker-test","job_id":"214","level":"info","source":"gearcmd","title":"heartbeat","try_number":0,"type":"gauge","unit":"1s","value":2}
{"function":"ticker-test","job_id":"214","level":"info","source":"gearcmd","title":"heartbeat","try_number":0,"type":"gauge","unit":"1s","value":3}
{"function":"ticker-test","job_id":"214","level":"info","source":"gearcmd","title":"heartbeat","try_number":0,"type":"gauge","unit":"1s","value":4}
{"function":"ticker-test","job_id":"214","level":"info","source":"gearcmd","title":"heartbeat","try_number":0,"type":"gauge","unit":"1s","value":5}
{"function":"ticker-test","job_id":"214","level":"info","source":"gearcmd","title":"heartbeat","try_number":0,"type":"gauge","unit":"1s","value":6}
{"function":"ticker-test","job_id":"214","level":"info","source":"gearcmd","title":"heartbeat","try_number":0,"type":"gauge","unit":"1s","value":7}
{"function":"ticker-test","job_id":"214","level":"info","source":"gearcmd","title":"heartbeat","try_number":0,"type":"gauge","unit":"1s","value":8}
{"function":"ticker-test","job_id":"214","level":"info","source":"gearcmd","title":"heartbeat","try_number":0,"type":"gauge","unit":"1s","value":9}
{"function":"ticker-test","job_id":"214","level":"info","source":"gearcmd","title":"heartbeat","try_number":0,"type":"gauge","unit":"1s","value":10}
```
@natebrennand natebrennand merged commit 8895538 into master Jul 22, 2016
@natebrennand natebrennand deleted the IP-901-gearcmd-heartbeat branch July 22, 2016 17:37
@agclever
Copy link

out of curiosity, why did we add the heartbeat logs?

@natebrennand
Copy link
Contributor Author

@agclever: mainly for simpler alerting purposes. Check the ticket in the branch name for more context.

@agclever
Copy link

Thanks. The ticket was exactly the context I wanted :)

@johnhuangclever
Copy link
Contributor

💥 💥 💥 💥 💥 💥 💥 💥 💥 💥 💥 💥 💥 💥 💥

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants