// Copyright The OpenTelemetry Authors
// SPDX-License-Identifier: Apache-2.0

// Package metricpool provides shared pools for semantic convention metric // measurement options.
package metricpool import ( ) var ( addOptionsPool = sync.Pool{New: func() any { := make([]metric.AddOption, 0, 1) return & }} recOptionsPool = sync.Pool{New: func() any { := make([]metric.RecordOption, 0, 1) return & }} ) // AddOptions returns a pooled AddOption slice. func () *[]metric.AddOption { return addOptionsPool.Get().(*[]metric.AddOption) } // PutAddOptions clears, resets, and returns o to the shared AddOption pool. func ( *[]metric.AddOption) { clear(*) * = (*)[:0] addOptionsPool.Put() } // RecordOptions returns a pooled RecordOption slice. func () *[]metric.RecordOption { return recOptionsPool.Get().(*[]metric.RecordOption) } // PutRecordOptions clears, resets, and returns o to the shared RecordOption // pool. func ( *[]metric.RecordOption) { clear(*) * = (*)[:0] recOptionsPool.Put() }