发布网络质量探测 1.1.2:更新服务端与 Linux 说明(一)
署名:言灸
This commit is contained in:
1 parent
3776ece7a4
commit
3e912d4d3c
4 files changed
+22
-2
No files matched your search
@@ -63,7 +63,7 @@ ss -lunp | grep 19091
|
||||
|
||||
```bash
|
||||
sudo mkdir -p /opt/netquality
|
||||
sudo tar -C /opt/netquality --strip-components=1 -xzf netquality-server-1.1.1-linux-amd64.tar.gz
|
||||
sudo tar -C /opt/netquality --strip-components=1 -xzf netquality-server-1.1.2-linux-amd64.tar.gz
|
||||
sudo cp /opt/netquality/netquality.service /etc/systemd/system/netquality.service
|
||||
sudo systemctl daemon-reload
|
||||
sudo systemctl enable --now netquality
|
||||
|
||||
+1
-1
@@ -110,7 +110,7 @@ sudo firewall-cmd --reload
|
||||
|
||||
```bash
|
||||
sudo mkdir -p /opt/netquality
|
||||
sudo tar -C /opt/netquality --strip-components=1 -xzf netquality-server-1.1.1-linux-amd64.tar.gz
|
||||
sudo tar -C /opt/netquality --strip-components=1 -xzf netquality-server-1.1.2-linux-amd64.tar.gz
|
||||
sudo chmod 755 /opt/netquality/netquality-reflector
|
||||
sudo cp /opt/netquality/netquality.service /etc/systemd/system/netquality.service
|
||||
sudo systemctl daemon-reload
|
||||
|
||||
@@ -26,6 +26,7 @@ func main() {
|
||||
}
|
||||
log.Fatal(err)
|
||||
}
|
||||
log.Printf("netquality %s", appVersion)
|
||||
log.Printf("%s", cfg.Summary())
|
||||
|
||||
tok, err := tokenBytes(cfg.Token)
|
||||
|
||||
@@ -26,6 +26,7 @@ type Outcome struct {
|
||||
Note string
|
||||
Detail map[string]string
|
||||
Reconnect bool
|
||||
SelectionSkipped int
|
||||
}
|
||||
|
||||
type jitter struct {
|
||||
@@ -66,6 +67,8 @@ type sampleBook struct {
|
||||
|
||||
lastRttMs *float64
|
||||
jitter jitter
|
||||
rtts []float64
|
||||
selectionSkipped int
|
||||
lastNote string
|
||||
detail map[string]string
|
||||
}
|
||||
@@ -73,6 +76,7 @@ type sampleBook struct {
|
||||
func (b *sampleBook) add(o Outcome) {
|
||||
b.sent++
|
||||
b.completed++
|
||||
b.selectionSkipped += o.SelectionSkipped
|
||||
if o.Reconnect {
|
||||
b.reconnect++
|
||||
}
|
||||
@@ -94,6 +98,7 @@ func (b *sampleBook) add(o Outcome) {
|
||||
if o.HasRtt {
|
||||
ms := float64(o.Rtt) / float64(time.Millisecond)
|
||||
b.lastRttMs = &ms
|
||||
b.rtts = append(b.rtts, ms)
|
||||
b.jitter.push(ms)
|
||||
}
|
||||
case statusTimeout:
|
||||
@@ -138,6 +143,14 @@ func (b *sampleBook) summary() summaryMsg {
|
||||
ConsecutiveFailures: b.consecutive,
|
||||
LastNote: b.lastNote,
|
||||
Detail: b.detail,
|
||||
SelectionSkipped: b.selectionSkipped,
|
||||
}
|
||||
if min, mean, median, p95, max, ok := latencyOf(b.rtts); ok {
|
||||
s.MinRttMs = &min
|
||||
s.MeanRttMs = &mean
|
||||
s.MedianRttMs = &median
|
||||
s.P95RttMs = &p95
|
||||
s.MaxRttMs = &max
|
||||
}
|
||||
if b.lastRttMs != nil {
|
||||
v := *b.lastRttMs
|
||||
@@ -197,6 +210,12 @@ type summaryMsg struct {
|
||||
ProbeLossPct *float64 `json:"probeLossPct,omitempty"`
|
||||
FailurePct *float64 `json:"failurePct,omitempty"`
|
||||
UnknownPct *float64 `json:"unknownPct,omitempty"`
|
||||
MinRttMs *float64 `json:"minRttMs,omitempty"`
|
||||
MeanRttMs *float64 `json:"meanRttMs,omitempty"`
|
||||
MedianRttMs *float64 `json:"medianRttMs,omitempty"`
|
||||
P95RttMs *float64 `json:"p95RttMs,omitempty"`
|
||||
MaxRttMs *float64 `json:"maxRttMs,omitempty"`
|
||||
SelectionSkipped int `json:"selectionSkipped,omitempty"`
|
||||
LastNote string `json:"lastNote,omitempty"`
|
||||
Detail map[string]string `json:"detail,omitempty"`
|
||||
}
|
||||
Reference in new issue
Block a user