(extraTags: ReadonlyArray<MetricLabel.MetricLabel>)
| 130 | const hookCache = new WeakMap<ReadonlyArray<MetricLabel.MetricLabel>, MetricHook.MetricHook<any, any>>() |
| 131 | |
| 132 | const hook = (extraTags: ReadonlyArray<MetricLabel.MetricLabel>): MetricHook.MetricHook< |
| 133 | MetricKeyType.MetricKeyType.InType<Type>, |
| 134 | MetricKeyType.MetricKeyType.OutType<Type> |
| 135 | > => { |
| 136 | if (extraTags.length === 0) { |
| 137 | if (untaggedHook !== undefined) { |
| 138 | return untaggedHook |
| 139 | } |
| 140 | untaggedHook = globalMetricRegistry.get(key) |
| 141 | return untaggedHook |
| 142 | } |
| 143 | |
| 144 | let hook = hookCache.get(extraTags) |
| 145 | if (hook !== undefined) { |
| 146 | return hook |
| 147 | } |
| 148 | hook = globalMetricRegistry.get(metricKey.taggedWithLabels(key, extraTags)) |
| 149 | hookCache.set(extraTags, hook) |
| 150 | return hook |
| 151 | } |
| 152 | |
| 153 | return make( |
| 154 | key.keyType, |
no test coverage detected
searching dependent graphs…