-
-
Save xNok/e00c6c5b8a7164f3274f1fc8c1132b73 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func write_event_with_line_protocol(client influxdb2.Client, t ThermostatSetting) { | |
// get non-blocking write client | |
writeAPI := client.WriteAPI(org, bucket) | |
// write line protocol | |
writeAPI.WriteRecord(fmt.Sprintf("thermostat,unit=temperature,user=%s avg=%f,max=%f", t.user, t.avg, t.max)) | |
// Flush writes | |
writeAPI.Flush() | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment