Each peer contains various statistics: number of packets received from
it (or sent, if it is you), traffic amount, number of silence seconds,
number of bad packets (malformed or altered, number of lost packets,
-number of reordered packets. "TALK" means that recently an audio packet
-was received. "MUTE" means that peer is in muted mode. "SILENT" means
-that peer is locally muted.`)
+number of reordered packets.
+Gree "T" means that recently an audio packet was received.
+Red "MUTE" means that peer is in muted mode.
+Magenta "S" means that peer is locally muted.`)
}
flag.Parse()
log.SetFlags(log.Lmicroseconds)
return
case now = <-tick:
l := fmt.Sprintf(
- "%s | %s | S/B/L/R: %s/%s/%s/%s",
+ " %s | %s | S/B/L/R: %s/%s/%s/%s",
humanize.Comma(s.stats.pkts),
humanize.IBytes(s.stats.bytes),
humanize.Comma(int64(s.actr-(s.ctr&0x00FFFF))/50),
humanize.Comma(s.stats.lost),
humanize.Comma(s.stats.reorder),
)
+ peerFlags := []string{" ", " ", " "}
if s.name == *Name && Muted {
- l += " | " + vors.CRed + "MUTE" + vors.CReset
+ peerFlags[0] = vors.CRed + "M" + vors.CReset
} else {
if s.silenced {
- l += " | " + vors.CMagenta + "SILENT" + vors.CReset
+ peerFlags[2] = vors.CMagenta + "S" + vors.CReset
}
if s.stats.last.Add(vors.ScreenRefresh).After(now) {
- l += " | " + vors.CGreen + "TALK" + vors.CReset
+ peerFlags[1] = vors.CGreen + "T" + vors.CReset
}
if s.muted {
- l += " | " + vors.CRed + "MUTE" + vors.CReset
+ peerFlags[0] = vors.CRed + "M" + vors.CReset
}
}
+ l = strings.Join(peerFlags, "") + l
v, err = GUI.View(s.name)
if err == nil {
v.Clear()
authentication, then "protected" is written nearby. Each room's member
username and IP address is shown, together with various statistics:
number of received, transmitted packets, number of bad packets (failed
-authentication), amount of traffic. "TALK" means that recently an audio
-packet was received. "MUTE" means that peer is in muted mode.
+authentication), amount of traffic.
+Green "T" means that recently an audio packet was received.
+Red "M" means that peer is in muted mode.
Press F10 to quit.`)
}
flag.Parse()
import (
"fmt"
"sort"
+ "strings"
"sync"
"time"
if peer == nil {
continue
}
+ peerFlags := []string{" ", " "}
line := fmt.Sprintf(
- "%12s | %s | Rx/Tx/Bad: %s / %s / %s | %s / %s",
+ "%10s | %s | Rx/Tx/Bad: %s / %s / %s | %s / %s",
peer.name,
peer.addr,
humanize.Comma(peer.stats.pktsRx),
humanize.IBytes(peer.stats.bytesTx),
)
if peer.muted {
- line += " | " + vors.CRed + "MUTE" + vors.CReset
+ peerFlags[0] = vors.CRed + "M" + vors.CReset
}
if peer.stats.last.Add(vors.ScreenRefresh).After(now) {
- line += " | " + vors.CGreen + "TALK" + vors.CReset
+ peerFlags[1] = vors.CGreen + "T" + vors.CReset
}
- lines = append(lines, line)
+ lines = append(lines, strings.Join(peerFlags, "")+line)
}
return lines
}