Skip to content

Instantly share code, notes, and snippets.

@gronnbeck
Created March 8, 2016 19:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gronnbeck/601f353875f89334b52a to your computer and use it in GitHub Desktop.
Save gronnbeck/601f353875f89334b52a to your computer and use it in GitHub Desktop.
func main() {
c := cron.New()
c.AddFunc("@every 30s", func() {
url = os.Getenv("SYNTHETIC_URL")
apitoken = os.Getenv("SYNTHETIC_API_TOKEN")
result := syn.SyntheticHttpRequest(url, apitoken)
if result == syn.ConnectionError {
datadog.ReportConnectionError()
} else if result == syn.UnexpectedResponse {
datadog.ReportUnexpectedResponse()
} else {
datadog.ReportOK()
}
})
c.Start()
// Keep the process from exiting
d := make(chan string)
<-d
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment