modificato l'output del log
This commit is contained in:
parent
831b17ca7e
commit
6c3ffa7c7b
4 changed files with 14 additions and 14 deletions
20
producer.go
20
producer.go
|
@ -23,15 +23,15 @@ func producer(id int) {
|
|||
// estrae un userid dalla lista degli utenti che hanno fatto login
|
||||
user, err := redis.String(conn.Do("spop", "llindex"))
|
||||
// if opts.Debug {
|
||||
// log.Printf("SPOP: %+v - %+v\n\r", user, err)
|
||||
// fmt.Printf("SPOP: %+v - %+v\n\r", user, err)
|
||||
// log.Printf("SPOP: %+v - %+v\n", user, err)
|
||||
// fmt.Printf("SPOP: %+v - %+v\n", user, err)
|
||||
// }
|
||||
// se non ci sono piu' userid esce
|
||||
if err != nil {
|
||||
if opts.Debug {
|
||||
fmt.Printf("LLINDEX empty: %v\n\r", err)
|
||||
fmt.Printf("LLINDEX empty: %v\n", err)
|
||||
}
|
||||
log.Printf("LLINDEX empty: %v\n\r", err)
|
||||
log.Printf("LLINDEX empty: %v\n", err)
|
||||
//loop[id] = false
|
||||
//done[id] <- true
|
||||
break
|
||||
|
@ -41,18 +41,18 @@ func producer(id int) {
|
|||
logs, err := redis.Strings(conn.Do("lrange", user, "0", "-1"))
|
||||
if err != nil {
|
||||
if opts.Debug {
|
||||
fmt.Printf("LRANGE: %+v - %+v\n\r", err, logs)
|
||||
fmt.Printf("LRANGE: %+v - %+v\n", err, logs)
|
||||
}
|
||||
log.Printf("LRANGE: %+v - %+v\n\r", err, logs)
|
||||
log.Printf("LRANGE: %+v - %+v\n", err, logs)
|
||||
}
|
||||
// if opts.Debug {
|
||||
// fmt.Printf("LRANGE: %s - %d\n\r", user, len(logs))
|
||||
// log.Printf("LRANGE: %s - %d\n\r", user, len(logs))
|
||||
// fmt.Printf("LRANGE: %s - %d\n", user, len(logs))
|
||||
// log.Printf("LRANGE: %s - %d\n", user, len(logs))
|
||||
// }
|
||||
|
||||
if opts.Debug {
|
||||
fmt.Printf("PROD (%d): user=%s login=%d in %v - conn=%d\n\r", id, user, len(logs), time.Since(start), dbs.rdb.ActiveCount())
|
||||
// log.Printf("PROD (%d): user=%s login=%d in %v - conn=%d\n\r", id, user, len(logs), time.Since(start), dbs.rdb.ActiveCount())
|
||||
fmt.Printf("PROD (%d): user=%s login=%d in %v - conn=%d\n", id, user, len(logs), time.Since(start), dbs.rdb.ActiveCount())
|
||||
// log.Printf("PROD (%d): user=%s login=%d in %v - conn=%d\n", id, user, len(logs), time.Since(start), dbs.rdb.ActiveCount())
|
||||
}
|
||||
|
||||
count.AddUser()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue