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
parent
3722fa383d
commit
4d4207be7f
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue