MCPcopy Index your code
hub / github.com/coder/coder / shallowCopy

Method shallowCopy

coderd/prometheusmetrics/aggregator.go:137–153  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

135}
136
137func (am *annotatedMetric) shallowCopy() annotatedMetric {
138 stats := &agentproto.Stats_Metric{
139 Name: am.Name,
140 Type: am.Type,
141 Value: am.Value,
142 Labels: am.Labels,
143 }
144
145 return annotatedMetric{
146 Stats_Metric: stats,
147 username: am.username,
148 workspaceName: am.workspaceName,
149 agentName: am.agentName,
150 templateName: am.templateName,
151 expiryDate: am.expiryDate,
152 }
153}
154
155func NewMetricsAggregator(logger slog.Logger, registerer prometheus.Registerer, duration time.Duration, aggregateByLabels []string, options ...func(*MetricsAggregator)) (*MetricsAggregator, error) {
156 metricsCleanupInterval := defaultMetricsCleanupInterval

Callers 1

aggregateMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected