aggiunto il numero di user consolidati e il totale user da consolidare al file di log
This commit is contained in:
parent
c96f963f21
commit
e20784a0d5
1 changed files with 10 additions and 4 deletions
|
@ -14,7 +14,7 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
_VERSION = "v1.0.7"
|
_VERSION = "v1.0.8"
|
||||||
_tformat = "2006-01-02"
|
_tformat = "2006-01-02"
|
||||||
_24h = (time.Hour * 23) + (time.Minute * 59) + (time.Second * 59)
|
_24h = (time.Hour * 23) + (time.Minute * 59) + (time.Second * 59)
|
||||||
_10m = (time.Minute * 10)
|
_10m = (time.Minute * 10)
|
||||||
|
@ -186,6 +186,9 @@ func main() {
|
||||||
fmt.Printf("Start: %+v, Stop: %+v\n\r", ys, ye)
|
fmt.Printf("Start: %+v, Stop: %+v\n\r", ys, ye)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
countTOT := 0
|
||||||
|
countOK := 0
|
||||||
|
|
||||||
for i := range ys {
|
for i := range ys {
|
||||||
|
|
||||||
pStart := time.Now()
|
pStart := time.Now()
|
||||||
|
@ -204,13 +207,14 @@ func main() {
|
||||||
q.Distinct("user", &ar)
|
q.Distinct("user", &ar)
|
||||||
|
|
||||||
if opts.Debug {
|
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])
|
fmt.Printf("Date: %s - %s\n", ys[i], ye[i])
|
||||||
log.Printf("Date: %s - %s\n", ys[i], ye[i])
|
log.Printf("Date: %s - %s\n", ys[i], ye[i])
|
||||||
|
|
||||||
for u := range ar {
|
for u := range ar {
|
||||||
|
countTOT += 1
|
||||||
ll := LastLoginDay{}
|
ll := LastLoginDay{}
|
||||||
ll.User = ar[u]
|
ll.User = ar[u]
|
||||||
ll.Date = ys[i]
|
ll.Date = ys[i]
|
||||||
|
@ -253,10 +257,12 @@ func main() {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Println("Insert error: ", err)
|
log.Println("Insert error: ", err)
|
||||||
}
|
}
|
||||||
|
countOK += 1
|
||||||
}
|
}
|
||||||
fmt.Printf("Stop %s: %s\n", ys[i], time.Since(pStart))
|
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))
|
fmt.Printf("Stop: OK: %i - TOT: %i - Time: %s\n\r", countOK, countTOT, time.Since(start))
|
||||||
log.Println("Stop: ", time.Since(start))
|
log.Printf("Stop: OK: %i - TOT: %i - Time: %s\n\r", countOK, countTOT, time.Since(start))
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue