MCPcopy Create free account
hub / github.com/apache/iotdb-client-go / insertAlignedRecords

Function insertAlignedRecords

example/session_pool/session_pool_example.go:302–324  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

300}
301
302func insertAlignedRecords() {
303 var (
304 deviceIds = []string{"root.al1.dev2", "root.al1.dev3"}
305 measurements = [][]string{{"status"}, {"temperature"}}
306 dataTypes = [][]client.TSDataType{{client.TEXT}, {client.TEXT}}
307 values = [][]interface{}{{"33"}, {"44"}}
308 timestamps = []int64{12, 13}
309 )
310 session, err := sessionPool.GetSession()
311 defer sessionPool.PutBack(session)
312 if err == nil {
313 checkError(session.InsertAlignedRecords(deviceIds, measurements, dataTypes, values, timestamps))
314 sessionDataSet, err := session.ExecuteStatement("show devices")
315 if err == nil {
316 printDataSet0(sessionDataSet)
317 sessionDataSet.Close()
318 } else {
319 log.Println(err)
320 }
321 fmt.Println()
322 }
323
324}
325
326func insertRecordsOfOneDevice() {
327 ts := time.Now().UTC().UnixNano() / 1000000

Callers 1

mainFunction · 0.70

Calls 7

PutBackMethod · 0.80
InsertAlignedRecordsMethod · 0.80
checkErrorFunction · 0.70
printDataSet0Function · 0.70
ExecuteStatementMethod · 0.65
CloseMethod · 0.65
GetSessionMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…