| 682 | |
| 683 | |
| 684 | Try<Map<string, string>> convertLabelsToStringMap(const Labels& labels) |
| 685 | { |
| 686 | Map<string, string> map; |
| 687 | |
| 688 | foreach (const Label& label, labels.labels()) { |
| 689 | if (map.count(label.key())) { |
| 690 | return Error("Repeated key '" + label.key() + "' in labels"); |
| 691 | } |
| 692 | |
| 693 | if (!label.has_value()) { |
| 694 | return Error("Missing value for key '" + label.key() + "' in labels"); |
| 695 | } |
| 696 | |
| 697 | map[label.key()] = label.value(); |
| 698 | } |
| 699 | |
| 700 | return map; |
| 701 | } |
| 702 | |
| 703 | |
| 704 | void injectAllocationInfo( |
no outgoing calls