(metricName: DaemonGaugeMetricName, value: number)
| 551 | } |
| 552 | |
| 553 | export function recordDaemonGaugeMetric(metricName: DaemonGaugeMetricName, value: number): void { |
| 554 | if (!shouldEmitMetrics()) { |
| 555 | return; |
| 556 | } |
| 557 | |
| 558 | const normalizedValue = Number.isFinite(value) ? Math.max(0, value) : 0; |
| 559 | try { |
| 560 | Sentry.metrics.gauge(`xcodebuildmcp.daemon.${metricName}`, normalizedValue, { |
| 561 | attributes: { |
| 562 | runtime: 'daemon', |
| 563 | }, |
| 564 | }); |
| 565 | } catch { |
| 566 | // Metrics are best effort and must never affect runtime behavior. |
| 567 | } |
| 568 | } |
| 569 | |
| 570 | interface McpLifecycleMetric { |
| 571 | event: SentryMcpLifecycleEvent; |
no test coverage detected