Updating Readme to make writePoints function work

Hello,

I have tried this example as it is for now. Encountered an error that AddPoint function expects only one argument. Checked you GoDoc and updated the example in your error handling style. It works like this.
pull/7864/head
M. Cetin 2017-01-23 17:09:01 +03:00 committed by GitHub
parent 3722fa383d
commit 4d4207be7f
1 changed files with 9 additions and 2 deletions

View File

@ -142,12 +142,19 @@ func writePoints(clnt client.Client) {
"busy": 100.0 - idle,
}
bp.AddPoint(client.NewPoint(
pt, err := client.NewPoint(
"cpu_usage",
tags,
fields,
time.Now(),
))
)
if err != nil {
log.Fatalln("Error: ", err)
}
bp.AddPoint(pt)
}
err := clnt.Write(bp)