mirror of
https://github.com/bettercap/bettercap
synced 2025-08-19 21:13:18 -07:00
fix: using normal mutex instead of atomic increments ( fixes #69 )
This commit is contained in:
parent
129f87f8f9
commit
d60648f0db
3 changed files with 23 additions and 12 deletions
|
@ -5,7 +5,6 @@ import (
|
|||
"os"
|
||||
"sort"
|
||||
"strings"
|
||||
"sync/atomic"
|
||||
"time"
|
||||
|
||||
"github.com/bettercap/bettercap/core"
|
||||
|
@ -169,13 +168,15 @@ func (d *Discovery) Show(by string) error {
|
|||
|
||||
d.showTable(colNames, rows)
|
||||
|
||||
d.Session.Queue.Stats.RLock()
|
||||
fmt.Printf("\n%s %s / %s %s / %d pkts / %d errs\n\n",
|
||||
core.Red("↑"),
|
||||
humanize.Bytes(atomic.LoadUint64(&d.Session.Queue.Stats.Sent)),
|
||||
humanize.Bytes(d.Session.Queue.Stats.Sent),
|
||||
core.Green("↓"),
|
||||
humanize.Bytes(atomic.LoadUint64(&d.Session.Queue.Stats.Received)),
|
||||
atomic.LoadUint64(&d.Session.Queue.Stats.PktReceived),
|
||||
atomic.LoadUint64(&d.Session.Queue.Stats.Errors))
|
||||
humanize.Bytes(d.Session.Queue.Stats.Received),
|
||||
d.Session.Queue.Stats.PktReceived,
|
||||
d.Session.Queue.Stats.Errors)
|
||||
d.Session.Queue.Stats.RUnlock()
|
||||
|
||||
s := EventsStream{}
|
||||
events := d.Session.Events.Sorted()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue