(rowCount int)
| 442 | } |
| 443 | |
| 444 | func createTablet(rowCount int) (*client.Tablet, error) { |
| 445 | tablet, err := client.NewTablet("root.ln.device1", []*client.MeasurementSchema{ |
| 446 | { |
| 447 | Measurement: "restart_count", |
| 448 | DataType: client.INT32, |
| 449 | }, { |
| 450 | Measurement: "price", |
| 451 | DataType: client.DOUBLE, |
| 452 | }, { |
| 453 | Measurement: "tick_count", |
| 454 | DataType: client.INT64, |
| 455 | }, { |
| 456 | Measurement: "temperature", |
| 457 | DataType: client.FLOAT, |
| 458 | }, { |
| 459 | Measurement: "description", |
| 460 | DataType: client.TEXT, |
| 461 | }, |
| 462 | { |
| 463 | Measurement: "status", |
| 464 | DataType: client.BOOLEAN, |
| 465 | }, |
| 466 | }, rowCount) |
| 467 | |
| 468 | if err != nil { |
| 469 | return nil, err |
| 470 | } |
| 471 | ts := time.Now().UTC().UnixNano() / 1000000 |
| 472 | for row := 0; row < int(rowCount); row++ { |
| 473 | ts++ |
| 474 | tablet.SetTimestamp(ts, row) |
| 475 | tablet.SetValueAt(rand.Int31(), 0, row) |
| 476 | tablet.SetValueAt(rand.Float64(), 1, row) |
| 477 | tablet.SetValueAt(rand.Int63(), 2, row) |
| 478 | tablet.SetValueAt(rand.Float32(), 3, row) |
| 479 | tablet.SetValueAt(fmt.Sprintf("Test Device %d", row+1), 4, row) |
| 480 | tablet.SetValueAt(bool(ts%2 == 0), 5, row) |
| 481 | tablet.RowSize++ |
| 482 | } |
| 483 | return tablet, nil |
| 484 | } |
| 485 | |
| 486 | func insertTablets() { |
| 487 | tablet1, err := createTablet(8) |
no test coverage detected
searching dependent graphs…