Skip to content

Commit

Permalink
finish latency code
Browse files Browse the repository at this point in the history
  • Loading branch information
juliannguyen4 committed Jan 5, 2024
1 parent 416625e commit 43e5441
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions node_metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,16 @@ func newLatencyBuckets(latencyColumns int, latencyShift int) *LatencyBuckets {
}

type NodeMetrics struct {
latency []LatencyBuckets
latency []*LatencyBuckets
}

func newNodeMetrics(policy *MetricsPolicy) *NodeMetrics {
return newLatencyBuckets(policy.latencyColumns, policy.latencyShift)
max := LATENCY_NONE
latency := make([]*LatencyBuckets, max)
for i := 0; i < max; i++ {
latency[i] = newLatencyBuckets(policy.latencyColumns, policy.latencyShift)
}
return &NodeMetrics{
latency: latency,
}
}

0 comments on commit 43e5441

Please sign in to comment.