<?php

declare(strict_types=1);

require __DIR__ . '/../../vendor/autoload.php';

use App\Framework\LiveComponents\Observability\ComponentMetricsCollector;

$collector = new ComponentMetricsCollector();
$collector->recordAction('form"test', 'action' . "\n" . 'name', 10.0);

$prometheus = $collector->exportPrometheus();
echo "=== PROMETHEUS OUTPUT ===\n";
echo $prometheus;
echo "=== END OUTPUT ===\n\n";

// Check what we're looking for
echo "Looking for: 'form\\\"test'\n";
echo "Contains: " . (str_contains($prometheus, 'form\\"test') ? 'YES' : 'NO') . "\n\n";

echo "Looking for: 'action\\nname'\n";
echo "Contains: " . (str_contains($prometheus, 'action\\nname') ? 'YES' : 'NO') . "\n\n";

// Also dump raw bytes
echo "=== RAW BYTES ===\n";
echo bin2hex($prometheus) . "\n";
