Stabilize QUIC pressure snapshots
This commit is contained in:
@@ -7,6 +7,7 @@ import (
|
||||
"crypto/x509"
|
||||
"encoding/hex"
|
||||
"fmt"
|
||||
"sort"
|
||||
"strings"
|
||||
"sync"
|
||||
"time"
|
||||
@@ -412,6 +413,15 @@ func (t *QUICFabricTransport) Snapshot() QUICFabricTransportSnapshot {
|
||||
snapshot.CapacityPressurePercent = (snapshot.ActiveStreams * 100) / capacity
|
||||
}
|
||||
}
|
||||
sort.Slice(snapshot.Connections, func(i, j int) bool {
|
||||
if snapshot.Connections[i].PeerID != snapshot.Connections[j].PeerID {
|
||||
return snapshot.Connections[i].PeerID < snapshot.Connections[j].PeerID
|
||||
}
|
||||
if snapshot.Connections[i].Endpoint != snapshot.Connections[j].Endpoint {
|
||||
return snapshot.Connections[i].Endpoint < snapshot.Connections[j].Endpoint
|
||||
}
|
||||
return snapshot.Connections[i].CertSHA256 < snapshot.Connections[j].CertSHA256
|
||||
})
|
||||
return snapshot
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user