diff --git a/lastlogin_consolidate.go b/lastlogin_consolidate.go index 2c41fe6..05a7607 100644 --- a/lastlogin_consolidate.go +++ b/lastlogin_consolidate.go @@ -14,7 +14,7 @@ import ( ) const ( - _VERSION = "v1.0.7" + _VERSION = "v1.0.8" _tformat = "2006-01-02" _24h = (time.Hour * 23) + (time.Minute * 59) + (time.Second * 59) _10m = (time.Minute * 10) @@ -186,6 +186,9 @@ func main() { fmt.Printf("Start: %+v, Stop: %+v\n\r", ys, ye) } + countTOT := 0 + countOK := 0 + for i := range ys { pStart := time.Now() @@ -204,13 +207,14 @@ func main() { q.Distinct("user", &ar) if opts.Debug { - fmt.Printf("Distinct: %s\n\r", time.Since(qStart)) + fmt.Printf("Distinct user: %s\n\r", time.Since(qStart)) } fmt.Printf("Date: %s - %s\n", ys[i], ye[i]) log.Printf("Date: %s - %s\n", ys[i], ye[i]) for u := range ar { + countTOT += 1 ll := LastLoginDay{} ll.User = ar[u] ll.Date = ys[i] @@ -253,10 +257,12 @@ func main() { if err != nil { log.Println("Insert error: ", err) } + countOK += 1 } fmt.Printf("Stop %s: %s\n", ys[i], time.Since(pStart)) + log.Printf("Stop %s: %s\n", ys[i], time.Since(pStart)) } - fmt.Println("Stop: ", time.Since(start)) - log.Println("Stop: ", time.Since(start)) + fmt.Printf("Stop: OK: %i - TOT: %i - Time: %s\n\r", countOK, countTOT, time.Since(start)) + log.Printf("Stop: OK: %i - TOT: %i - Time: %s\n\r", countOK, countTOT, time.Since(start)) }