Skip to content

Commit

Permalink
update example
Browse files Browse the repository at this point in the history
  • Loading branch information
eze-kiel committed Feb 24, 2021
1 parent ce6e10c commit ef09f3f
Showing 1 changed file with 19 additions and 5 deletions.
24 changes: 19 additions & 5 deletions cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,24 @@ func main() {
time.Sleep(4 * time.Second)
s.Stop()

q, err := p.GetNext()
if err != nil {
logrus.Error(err)
for {
q, err := p.GetNext()
if err != nil {
logrus.Error(err)
}
if q.Query == "" {
break
}
fmt.Printf("Time: %s\nUser: %s\nHost: %s\nID: %d\nQuery_time: %s\nLock_time: %s\nRows_sent: %d\nRows_examined: %d\nQuery: %s\n\n",
q.Time,
q.User,
q.Host,
q.ID,
q.QueryTime,
q.LockTime,
q.RowsSent,
q.RowsExamined,
q.Query,
)
}

fmt.Printf("%v\n", q)
}

0 comments on commit ef09f3f

Please sign in to comment.