| 1 |
// Copyright The OpenTelemetry Authors |
| 2 |
// SPDX-License-Identifier: Apache-2.0 |
| 3 |
|
| 4 |
package pprofile // import "go.opentelemetry.io/collector/pdata/pprofile" |
| 5 |
|
| 6 |
import "fmt" |
| 7 |
|
| 8 |
// switchDictionary updates the ResourceProfiles, switching its indices from one |
| 9 |
// dictionary to another. |
| 10 |
func (ms ResourceProfiles) switchDictionary(src, dst ProfilesDictionary) error { |
| 11 |
for i, v := range ms.ScopeProfiles().All() { |
| 12 |
err := v.switchDictionary(src, dst) |
| 13 |
if err != nil { |
| 14 |
return fmt.Errorf("error switching dictionary for scope profile %d: %w", i, err) |
| 15 |
} |
| 16 |
} |
| 17 |
|
| 18 |
return nil |
| 19 |
} |