()
| 459 | } |
| 460 | |
| 461 | func (l *loader) printCounters() { |
| 462 | period := 5 * time.Second |
| 463 | ticker := time.Tick(period) |
| 464 | start := time.Now() |
| 465 | |
| 466 | var last Counter |
| 467 | for range ticker { |
| 468 | counter := l.Counter() |
| 469 | rate := float64(counter.Nquads-last.Nquads) / period.Seconds() |
| 470 | elapsed := time.Since(start).Round(time.Second) |
| 471 | timestamp := time.Now().Format("15:04:05Z0700") |
| 472 | fmt.Printf("[%s] Elapsed: %s Txns: %d N-Quads: %s N-Quads/s: %s"+ |
| 473 | " Inflight: %2d/%2d Aborts: %d\n", |
| 474 | timestamp, x.FixedDuration(elapsed), counter.TxnsDone, |
| 475 | humanize.Comma(int64(counter.Nquads)), humanize.Comma(int64(rate)), |
| 476 | atomic.LoadInt32(&l.inflight), atomic.LoadInt32(&l.conc), counter.Aborts) |
| 477 | last = counter |
| 478 | } |
| 479 | } |
| 480 | |
| 481 | // Counter returns the current state of the BatchMutation. |
| 482 | func (l *loader) Counter() Counter { |
no test coverage detected