func main() { flag.Parse() if *newrelicLicense == "" { log.Fatalf("Please, pass a valid newrelic license key.\n Use --help to get more information about available options\n") } agent := gorelic.NewAgent() agent.Verbose = true agent.NewrelicLicense = *newrelicLicense agent.Run() doSomeJob(100) }
func main() { flag.Parse() if *newrelicLicense == "" { log.Fatalf("Please, pass a valid newrelic license key.\n Use --help to get more information about available options\n") } agent := gorelic.NewAgent() agent.Verbose = true agent.CollectHTTPStat = true agent.NewrelicLicense = *newrelicLicense agent.Run() http.HandleFunc("/", agent.WrapHTTPHandlerFunc(helloServer)) http.ListenAndServe(":8080", nil) }
func New(license string, appname string, verbose bool) *Gorelic { if license == "" { panic("Please specify NewRelic license") } agent := gorelic.NewAgent() agent.NewrelicLicense = license agent.HTTPTimer = metrics.NewTimer() agent.CollectHTTPStat = true agent.Verbose = verbose agent.NewrelicName = appname agent.Run() return &Gorelic{agent} }