(payload, name)
| 63 | } |
| 64 | |
| 65 | function pointsOf(payload, name) { |
| 66 | const metric = allMetrics(payload).find((m) => m.name === name); |
| 67 | if (!metric) return []; |
| 68 | if (metric.gauge) return metric.gauge.dataPoints || []; |
| 69 | if (metric.sum) return metric.sum.dataPoints || []; |
| 70 | return []; |
| 71 | } |
| 72 | |
| 73 | function attrValue(point, key) { |
| 74 | const found = (point.attributes || []).find((attribute) => attribute.key === key); |