mirror of
https://github.com/coder/coder.git
synced 2025-07-18 14:17:22 +00:00
fix: only sum connection latencies when they are set (#6524)
This was producing a median that didn't make sense.
This commit is contained in:
@ -340,6 +340,9 @@ func (q *fakeQuerier) GetDeploymentWorkspaceAgentStats(_ context.Context, create
|
||||
|
||||
latencies := make([]float64, 0)
|
||||
for _, agentStat := range agentStatsCreatedAfter {
|
||||
if agentStat.ConnectionMedianLatencyMS <= 0 {
|
||||
continue
|
||||
}
|
||||
stat.WorkspaceRxBytes += agentStat.RxBytes
|
||||
stat.WorkspaceTxBytes += agentStat.TxBytes
|
||||
latencies = append(latencies, agentStat.ConnectionMedianLatencyMS)
|
||||
|
Reference in New Issue
Block a user