mirror of
https://github.com/bettercap/bettercap
synced 2025-08-20 05:23:19 -07:00
refact: last 20 events in netshow were redundant
This commit is contained in:
parent
b2abc5e1ed
commit
3e640c4bac
3 changed files with 3 additions and 22 deletions
|
@ -168,27 +168,6 @@ func (d *Discovery) Show(by string) error {
|
|||
d.Session.Queue.Stats.Errors)
|
||||
d.Session.Queue.Stats.RUnlock()
|
||||
|
||||
s := EventsStream{}
|
||||
events := d.Session.Events.Sorted()
|
||||
size := len(events)
|
||||
|
||||
if size > 0 {
|
||||
max := 20
|
||||
if size > max {
|
||||
from := size - max
|
||||
size = max
|
||||
events = events[from:]
|
||||
}
|
||||
|
||||
fmt.Printf("Last %d events:\n\n", size)
|
||||
|
||||
for _, e := range events {
|
||||
s.View(e, false)
|
||||
}
|
||||
|
||||
fmt.Println()
|
||||
}
|
||||
|
||||
d.Session.Refresh()
|
||||
|
||||
return nil
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue