{
  "annotations": {
    "list": [
      {
        "builtIn": 1,
        "datasource": {
          "type": "grafana",
          "uid": "-- Grafana --"
        },
        "enable": true,
        "hide": true,
        "iconColor": "rgba(0, 211, 255, 1)",
        "name": "Annotations & Alerts",
        "type": "dashboard"
      }
    ]
  },
  "editable": true,
  "fiscalYearStartMonth": 0,
  "graphTooltip": 1,
  "id": null,
  "links": [],
  "panels": [
    {
      "id": 50,
      "type": "stat",
      "title": "UX Responsiveness",
      "description": "Composite score (0-100) for user-visible responsiveness: content freshness, render smoothness, command ack, and reliability counters. Excludes full agent turn duration because long turns can be productive work.",
      "gridPos": {
        "h": 4,
        "w": 5,
        "x": 0,
        "y": 0
      },
      "datasource": {
        "type": "frser-sqlite-datasource",
        "uid": "oppi-telemetry-sqlite"
      },
      "targets": [
        {
          "refId": "A",
          "queryType": "table",
          "rawQueryText": "WITH session_stats AS (\n  SELECT\n    session_id,\n    MIN(ts_ms) as first_ts,\n    AVG(CASE WHEN metric='chat.jank_pct' THEN value END) as jank,\n    AVG(CASE WHEN metric='chat.fresh_content_lag_ms' THEN value END) as lag,\n    SUM(CASE WHEN metric='chat.message_queue_stale_drop' THEN value ELSE 0 END) as drops,\n    SUM(CASE WHEN metric IN ('chat.message_queue_start_miss', 'chat.media_playback_error') THEN value ELSE 0 END) as failures,\n    AVG(CASE WHEN metric='chat.message_queue_ack_ms' THEN value END) as ack,\n    CAST(COUNT(CASE WHEN metric='chat.timeline_apply_ms' AND value > 50 THEN 1 END) AS REAL) /\n      MAX(1, COUNT(CASE WHEN metric='chat.timeline_apply_ms' THEN 1 END)) * 100 as hitch_pct,\n    COUNT(CASE WHEN metric='chat.catchup_ring_miss' AND value > 0 THEN 1 END) as ring_misses,\n    COUNT(CASE WHEN metric='chat.ttft_ms' THEN 1 END) as turns\n  FROM chat_metric_samples\n  WHERE session_id IS NOT NULL AND session_id != ''\n    AND ts_ms BETWEEN $__from AND $__to\n  GROUP BY session_id\n  HAVING turns >= 3\n)\nSELECT ROUND(AVG(100.0\n  - MIN(25, MAX(0, (COALESCE(jank, 0) - 5) * 25.0 / 25))\n  - MIN(15, MAX(0, (hitch_pct - 2) * 15.0 / 13))\n  - MIN(20, MAX(0, (COALESCE(lag, 1000) - 300) * 20.0 / 2700))\n  - MIN(10, MAX(0, (COALESCE(ack, 300) - 300) * 10.0 / 1700))\n  - MIN(25, drops * 5.0)\n  - MIN(15, failures * 5.0)\n  - MIN(5, ring_misses * 5.0)), 0) AS value\nFROM session_stats"
        }
      ],
      "fieldConfig": {
        "defaults": {
          "unit": "none",
          "min": 0,
          "max": 100,
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "red",
                "value": null
              },
              {
                "color": "orange",
                "value": 60
              },
              {
                "color": "yellow",
                "value": 70
              },
              {
                "color": "#73BF69",
                "value": 80
              },
              {
                "color": "green",
                "value": 90
              }
            ]
          },
          "color": {
            "mode": "thresholds"
          },
          "mappings": []
        },
        "overrides": []
      },
      "options": {
        "reduceOptions": {
          "calcs": ["lastNotNull"]
        },
        "textMode": "value",
        "colorMode": "background",
        "graphMode": "none",
        "justifyMode": "auto",
        "orientation": "auto"
      }
    },
    {
      "datasource": {
        "type": "frser-sqlite-datasource",
        "uid": "oppi-telemetry-sqlite"
      },
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "thresholds"
          },
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              }
            ]
          },
          "unit": "ms"
        },
        "overrides": []
      },
      "gridPos": {
        "h": 4,
        "w": 4,
        "x": 5,
        "y": 0
      },
      "id": 23,
      "options": {
        "colorMode": "value",
        "graphMode": "none",
        "justifyMode": "auto",
        "orientation": "auto",
        "reduceOptions": {
          "calcs": ["lastNotNull"],
          "fields": "",
          "values": false
        },
        "textMode": "auto"
      },
      "targets": [
        {
          "datasource": {
            "type": "frser-sqlite-datasource",
            "uid": "oppi-telemetry-sqlite"
          },
          "queryType": "table",
          "rawQueryText": "SELECT ROUND(AVG(value), 1) as value\nFROM chat_metric_samples\nWHERE metric = 'chat.session_load_ms'\n  AND build_number = (SELECT MAX(build_number) FROM chat_metric_samples)\n  AND ts_ms BETWEEN $__from AND $__to",
          "queryText": "SELECT ROUND(AVG(value), 1) as value\nFROM chat_metric_samples\nWHERE metric = 'chat.session_load_ms'\n  AND build_number = (SELECT MAX(build_number) FROM chat_metric_samples)\n  AND ts_ms BETWEEN $__from AND $__to",
          "timeColumns": [],
          "refId": "A"
        }
      ],
      "title": "Session Load",
      "type": "stat"
    },
    {
      "datasource": {
        "type": "frser-sqlite-datasource",
        "uid": "oppi-telemetry-sqlite"
      },
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "thresholds"
          },
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              }
            ]
          },
          "unit": "ms"
        },
        "overrides": []
      },
      "gridPos": {
        "h": 4,
        "w": 4,
        "x": 9,
        "y": 0
      },
      "id": 24,
      "options": {
        "colorMode": "value",
        "graphMode": "none",
        "justifyMode": "auto",
        "orientation": "auto",
        "reduceOptions": {
          "calcs": ["lastNotNull"],
          "fields": "",
          "values": false
        },
        "textMode": "auto"
      },
      "targets": [
        {
          "datasource": {
            "type": "frser-sqlite-datasource",
            "uid": "oppi-telemetry-sqlite"
          },
          "queryType": "table",
          "rawQueryText": "SELECT ROUND(AVG(value), 1) as value\nFROM chat_metric_samples\nWHERE metric = 'chat.ttft_ms'\n  AND build_number = (SELECT MAX(build_number) FROM chat_metric_samples)\n  AND ts_ms BETWEEN $__from AND $__to",
          "queryText": "SELECT ROUND(AVG(value), 1) as value\nFROM chat_metric_samples\nWHERE metric = 'chat.ttft_ms'\n  AND build_number = (SELECT MAX(build_number) FROM chat_metric_samples)\n  AND ts_ms BETWEEN $__from AND $__to",
          "timeColumns": [],
          "refId": "A"
        }
      ],
      "title": "First Token Wait",
      "type": "stat"
    },
    {
      "datasource": {
        "type": "frser-sqlite-datasource",
        "uid": "oppi-telemetry-sqlite"
      },
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "thresholds"
          },
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              }
            ]
          },
          "unit": "percent"
        },
        "overrides": []
      },
      "gridPos": {
        "h": 4,
        "w": 4,
        "x": 13,
        "y": 0
      },
      "id": 25,
      "options": {
        "colorMode": "value",
        "graphMode": "none",
        "justifyMode": "auto",
        "orientation": "auto",
        "reduceOptions": {
          "calcs": ["lastNotNull"],
          "fields": "",
          "values": false
        },
        "textMode": "auto"
      },
      "targets": [
        {
          "datasource": {
            "type": "frser-sqlite-datasource",
            "uid": "oppi-telemetry-sqlite"
          },
          "queryType": "table",
          "rawQueryText": "SELECT ROUND(AVG(value), 1) as value\nFROM chat_metric_samples\nWHERE metric = 'chat.jank_pct'\n  AND build_number = (SELECT MAX(build_number) FROM chat_metric_samples)\n  AND ts_ms BETWEEN $__from AND $__to",
          "queryText": "SELECT ROUND(AVG(value), 1) as value\nFROM chat_metric_samples\nWHERE metric = 'chat.jank_pct'\n  AND build_number = (SELECT MAX(build_number) FROM chat_metric_samples)\n  AND ts_ms BETWEEN $__from AND $__to",
          "timeColumns": [],
          "refId": "A"
        }
      ],
      "title": "Render Jank",
      "type": "stat"
    },
    {
      "datasource": {
        "type": "frser-sqlite-datasource",
        "uid": "oppi-telemetry-sqlite"
      },
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "thresholds"
          },
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              }
            ]
          },
          "unit": "ms"
        },
        "overrides": []
      },
      "gridPos": {
        "h": 4,
        "w": 4,
        "x": 17,
        "y": 0
      },
      "id": 26,
      "options": {
        "colorMode": "value",
        "graphMode": "none",
        "justifyMode": "auto",
        "orientation": "auto",
        "reduceOptions": {
          "calcs": ["lastNotNull"],
          "fields": "",
          "values": false
        },
        "textMode": "auto"
      },
      "targets": [
        {
          "datasource": {
            "type": "frser-sqlite-datasource",
            "uid": "oppi-telemetry-sqlite"
          },
          "queryType": "table",
          "rawQueryText": "SELECT ROUND(AVG(value), 1) as value\nFROM chat_metric_samples\nWHERE metric = 'chat.voice_first_result_ms'\n  AND build_number = (SELECT MAX(build_number) FROM chat_metric_samples)\n  AND ts_ms BETWEEN $__from AND $__to",
          "queryText": "SELECT ROUND(AVG(value), 1) as value\nFROM chat_metric_samples\nWHERE metric = 'chat.voice_first_result_ms'\n  AND build_number = (SELECT MAX(build_number) FROM chat_metric_samples)\n  AND ts_ms BETWEEN $__from AND $__to",
          "timeColumns": [],
          "refId": "A"
        }
      ],
      "title": "Voice",
      "type": "stat"
    },
    {
      "datasource": {
        "type": "frser-sqlite-datasource",
        "uid": "oppi-telemetry-sqlite"
      },
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "thresholds"
          },
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              }
            ]
          },
          "unit": "ms"
        },
        "overrides": []
      },
      "gridPos": {
        "h": 4,
        "w": 3,
        "x": 21,
        "y": 0
      },
      "id": 27,
      "options": {
        "colorMode": "value",
        "graphMode": "none",
        "justifyMode": "auto",
        "orientation": "auto",
        "reduceOptions": {
          "calcs": ["lastNotNull"],
          "fields": "",
          "values": false
        },
        "textMode": "auto"
      },
      "targets": [
        {
          "datasource": {
            "type": "frser-sqlite-datasource",
            "uid": "oppi-telemetry-sqlite"
          },
          "queryType": "table",
          "rawQueryText": "SELECT ROUND(AVG(value), 1) as value\nFROM chat_metric_samples\nWHERE metric = 'chat.catchup_ms'\n  AND build_number = (SELECT MAX(build_number) FROM chat_metric_samples)\n  AND ts_ms BETWEEN $__from AND $__to",
          "queryText": "SELECT ROUND(AVG(value), 1) as value\nFROM chat_metric_samples\nWHERE metric = 'chat.catchup_ms'\n  AND build_number = (SELECT MAX(build_number) FROM chat_metric_samples)\n  AND ts_ms BETWEEN $__from AND $__to",
          "timeColumns": [],
          "refId": "A"
        }
      ],
      "title": "Reconnect",
      "type": "stat"
    },
    {
      "datasource": {
        "type": "frser-sqlite-datasource",
        "uid": "oppi-telemetry-sqlite"
      },
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "palette-classic"
          },
          "unit": "ms",
          "custom": {
            "drawStyle": "points",
            "lineWidth": 0,
            "pointSize": 4,
            "showPoints": "always"
          }
        },
        "overrides": []
      },
      "gridPos": {
        "h": 8,
        "w": 12,
        "x": 0,
        "y": 12
      },
      "id": 1,
      "options": {
        "legend": {
          "calcs": ["lastNotNull", "max"],
          "displayMode": "table",
          "placement": "bottom"
        },
        "tooltip": {
          "mode": "multi",
          "sort": "desc"
        }
      },
      "targets": [
        {
          "datasource": {
            "type": "frser-sqlite-datasource",
            "uid": "oppi-telemetry-sqlite"
          },
          "queryType": "time series",
          "rawQueryText": "SELECT CAST(ts_ms / 1000 AS INTEGER) AS time, value\nFROM chat_metric_samples\nWHERE metric = 'chat.ttft_ms'\n  AND ts_ms BETWEEN $__from AND $__to\nORDER BY ts_ms",
          "queryText": "SELECT CAST(ts_ms / 1000 AS INTEGER) AS time, value\nFROM chat_metric_samples\nWHERE metric = 'chat.ttft_ms'\n  AND ts_ms BETWEEN $__from AND $__to\nORDER BY ts_ms",
          "timeColumns": ["time"],
          "refId": "A"
        }
      ],
      "title": "First token wait (chat.ttft_ms)",
      "description": "User-visible wait from send/start to first assistant token. Do not compare this with full turn duration; turn duration is workload/progress telemetry.",
      "type": "timeseries"
    },
    {
      "datasource": {
        "type": "frser-sqlite-datasource",
        "uid": "oppi-telemetry-sqlite"
      },
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "palette-classic"
          },
          "unit": "ms",
          "custom": {
            "drawStyle": "points",
            "lineWidth": 0,
            "pointSize": 4,
            "showPoints": "always"
          }
        },
        "overrides": [
          {
            "matcher": {
              "id": "byFrameRefID",
              "options": "A"
            },
            "properties": [
              {
                "id": "displayName",
                "value": "focused session ready"
              }
            ]
          },
          {
            "matcher": {
              "id": "byFrameRefID",
              "options": "B"
            },
            "properties": [
              {
                "id": "displayName",
                "value": "app-event stream ready"
              }
            ]
          }
        ]
      },
      "gridPos": {
        "h": 8,
        "w": 12,
        "x": 12,
        "y": 12
      },
      "id": 2,
      "options": {
        "legend": {
          "calcs": ["lastNotNull", "max"],
          "displayMode": "table",
          "placement": "bottom"
        },
        "tooltip": {
          "mode": "multi",
          "sort": "desc"
        }
      },
      "targets": [
        {
          "datasource": {
            "type": "frser-sqlite-datasource",
            "uid": "oppi-telemetry-sqlite"
          },
          "queryType": "time series",
          "rawQueryText": "SELECT CAST(ts_ms / 1000 AS INTEGER) AS time, value\nFROM chat_metric_samples\nWHERE metric = 'chat.ws_wait_for_connected_ms'\n  AND ts_ms BETWEEN $__from AND $__to\nORDER BY ts_ms",
          "queryText": "SELECT CAST(ts_ms / 1000 AS INTEGER) AS time, value\nFROM chat_metric_samples\nWHERE metric = 'chat.ws_wait_for_connected_ms'\n  AND ts_ms BETWEEN $__from AND $__to\nORDER BY ts_ms",
          "timeColumns": ["time"],
          "refId": "A"
        },
        {
          "datasource": {
            "type": "frser-sqlite-datasource",
            "uid": "oppi-telemetry-sqlite"
          },
          "queryType": "time series",
          "rawQueryText": "SELECT CAST(ts_ms / 1000 AS INTEGER) AS time, value\nFROM chat_metric_samples\nWHERE metric = 'chat.app_event_stream_connect_ms'\n  AND ts_ms BETWEEN $__from AND $__to\nORDER BY ts_ms",
          "queryText": "SELECT CAST(ts_ms / 1000 AS INTEGER) AS time, value\nFROM chat_metric_samples\nWHERE metric = 'chat.app_event_stream_connect_ms'\n  AND ts_ms BETWEEN $__from AND $__to\nORDER BY ts_ms",
          "timeColumns": ["time"],
          "refId": "B"
        }
      ],
      "title": "Connection readiness (focused + app stream)",
      "description": "User-blocking wait for focused-session command transport and global app-event stream readiness.",
      "type": "timeseries"
    },
    {
      "datasource": {
        "type": "frser-sqlite-datasource",
        "uid": "oppi-telemetry-sqlite"
      },
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "palette-classic"
          },
          "unit": "ms",
          "custom": {
            "drawStyle": "points",
            "lineWidth": 0,
            "pointSize": 4,
            "showPoints": "always"
          }
        },
        "overrides": [
          {
            "matcher": {
              "id": "byFrameRefID",
              "options": "A"
            },
            "properties": [
              {
                "id": "displayName",
                "value": "cache_seeded (re-entry)"
              },
              {
                "id": "color",
                "value": {
                  "mode": "fixed",
                  "fixedColor": "green"
                }
              }
            ]
          },
          {
            "matcher": {
              "id": "byFrameRefID",
              "options": "B"
            },
            "properties": [
              {
                "id": "displayName",
                "value": "ring catch-up"
              },
              {
                "id": "color",
                "value": {
                  "mode": "fixed",
                  "fixedColor": "orange"
                }
              }
            ]
          }
        ]
      },
      "gridPos": {
        "h": 8,
        "w": 12,
        "x": 0,
        "y": 20
      },
      "id": 3,
      "options": {
        "legend": {
          "calcs": ["lastNotNull", "max"],
          "displayMode": "table",
          "placement": "bottom"
        },
        "tooltip": {
          "mode": "multi",
          "sort": "desc"
        }
      },
      "targets": [
        {
          "datasource": {
            "type": "frser-sqlite-datasource",
            "uid": "oppi-telemetry-sqlite"
          },
          "queryType": "time series",
          "rawQueryText": "SELECT CAST(ts_ms / 1000 AS INTEGER) AS time, value\nFROM chat_metric_samples\nWHERE metric = 'chat.catchup_ms'\n  AND COALESCE(json_extract(tags_json, '$.result'), '') = 'cache_seeded'\n  AND ts_ms BETWEEN $__from AND $__to\nORDER BY ts_ms",
          "queryText": "SELECT CAST(ts_ms / 1000 AS INTEGER) AS time, value\nFROM chat_metric_samples\nWHERE metric = 'chat.catchup_ms'\n  AND COALESCE(json_extract(tags_json, '$.result'), '') = 'cache_seeded'\n  AND ts_ms BETWEEN $__from AND $__to\nORDER BY ts_ms",
          "timeColumns": ["time"],
          "refId": "A"
        },
        {
          "datasource": {
            "type": "frser-sqlite-datasource",
            "uid": "oppi-telemetry-sqlite"
          },
          "queryType": "time series",
          "rawQueryText": "SELECT CAST(ts_ms / 1000 AS INTEGER) AS time, value\nFROM chat_metric_samples\nWHERE metric = 'chat.catchup_ms'\n  AND COALESCE(json_extract(tags_json, '$.result'), '') NOT IN ('cache_seeded', 'no_gap', '')\n  AND ts_ms BETWEEN $__from AND $__to\nORDER BY ts_ms",
          "queryText": "SELECT CAST(ts_ms / 1000 AS INTEGER) AS time, value\nFROM chat_metric_samples\nWHERE metric = 'chat.catchup_ms'\n  AND COALESCE(json_extract(tags_json, '$.result'), '') NOT IN ('cache_seeded', 'no_gap', '')\n  AND ts_ms BETWEEN $__from AND $__to\nORDER BY ts_ms",
          "timeColumns": ["time"],
          "refId": "B"
        }
      ],
      "title": "Catch-up (chat.catchup_ms)",
      "type": "timeseries"
    },
    {
      "datasource": {
        "type": "frser-sqlite-datasource",
        "uid": "oppi-telemetry-sqlite"
      },
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "palette-classic"
          },
          "unit": "ms",
          "custom": {
            "drawStyle": "points",
            "lineWidth": 0,
            "pointSize": 4,
            "showPoints": "always"
          }
        },
        "overrides": []
      },
      "gridPos": {
        "h": 8,
        "w": 12,
        "x": 12,
        "y": 20
      },
      "id": 4,
      "options": {
        "legend": {
          "calcs": ["lastNotNull", "max"],
          "displayMode": "table",
          "placement": "bottom"
        },
        "tooltip": {
          "mode": "multi",
          "sort": "desc"
        }
      },
      "targets": [
        {
          "datasource": {
            "type": "frser-sqlite-datasource",
            "uid": "oppi-telemetry-sqlite"
          },
          "queryType": "time series",
          "rawQueryText": "SELECT CAST(ts_ms / 1000 AS INTEGER) AS time, value\nFROM chat_metric_samples\nWHERE metric = 'chat.fresh_content_lag_ms'\n  AND ts_ms BETWEEN $__from AND $__to\nORDER BY ts_ms",
          "queryText": "SELECT CAST(ts_ms / 1000 AS INTEGER) AS time, value\nFROM chat_metric_samples\nWHERE metric = 'chat.fresh_content_lag_ms'\n  AND ts_ms BETWEEN $__from AND $__to\nORDER BY ts_ms",
          "timeColumns": ["time"],
          "refId": "A"
        }
      ],
      "title": "Fresh content lag (chat.fresh_content_lag_ms)",
      "type": "timeseries"
    },
    {
      "datasource": {
        "type": "frser-sqlite-datasource",
        "uid": "oppi-telemetry-sqlite"
      },
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "palette-classic"
          },
          "unit": "count",
          "custom": {
            "drawStyle": "points",
            "lineWidth": 0,
            "pointSize": 4,
            "showPoints": "always"
          }
        },
        "overrides": []
      },
      "gridPos": {
        "h": 8,
        "w": 12,
        "x": 0,
        "y": 28
      },
      "id": 5,
      "options": {
        "legend": {
          "calcs": ["lastNotNull", "max"],
          "displayMode": "table",
          "placement": "bottom"
        },
        "tooltip": {
          "mode": "multi",
          "sort": "desc"
        }
      },
      "targets": [
        {
          "datasource": {
            "type": "frser-sqlite-datasource",
            "uid": "oppi-telemetry-sqlite"
          },
          "queryType": "time series",
          "rawQueryText": "SELECT CAST((ts_ms / 1000 / 3600) * 3600 AS INTEGER) AS time, SUM(value) AS value\nFROM chat_metric_samples\nWHERE metric = 'chat.catchup_ring_miss'\n  AND ts_ms BETWEEN $__from AND $__to\nGROUP BY 1\nORDER BY 1",
          "queryText": "SELECT CAST((ts_ms / 1000 / 3600) * 3600 AS INTEGER) AS time, SUM(value) AS value\nFROM chat_metric_samples\nWHERE metric = 'chat.catchup_ring_miss'\n  AND ts_ms BETWEEN $__from AND $__to\nGROUP BY 1\nORDER BY 1",
          "timeColumns": ["time"],
          "refId": "A"
        }
      ],
      "title": "Catch-up ring miss per hour (should trend to zero)",
      "type": "timeseries"
    },
    {
      "datasource": {
        "type": "frser-sqlite-datasource",
        "uid": "oppi-telemetry-sqlite"
      },
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "palette-classic"
          },
          "unit": "ms",
          "custom": {
            "drawStyle": "points",
            "lineWidth": 0,
            "pointSize": 4,
            "showPoints": "always"
          }
        },
        "overrides": [
          {
            "matcher": {
              "id": "byFrameRefID",
              "options": "A"
            },
            "properties": [
              {
                "id": "displayName",
                "value": "timeline_apply_ms"
              },
              {
                "id": "color",
                "value": {
                  "mode": "fixed",
                  "fixedColor": "blue"
                }
              }
            ]
          },
          {
            "matcher": {
              "id": "byFrameRefID",
              "options": "B"
            },
            "properties": [
              {
                "id": "displayName",
                "value": "timeline_layout_ms"
              },
              {
                "id": "color",
                "value": {
                  "mode": "fixed",
                  "fixedColor": "purple"
                }
              }
            ]
          }
        ]
      },
      "gridPos": {
        "h": 8,
        "w": 12,
        "x": 12,
        "y": 28
      },
      "id": 28,
      "options": {
        "legend": {
          "calcs": ["lastNotNull", "max"],
          "displayMode": "table",
          "placement": "bottom"
        },
        "tooltip": {
          "mode": "multi",
          "sort": "desc"
        }
      },
      "targets": [
        {
          "datasource": {
            "type": "frser-sqlite-datasource",
            "uid": "oppi-telemetry-sqlite"
          },
          "queryType": "time series",
          "rawQueryText": "SELECT CAST(ts_ms / 1000 AS INTEGER) AS time, value\nFROM chat_metric_samples\nWHERE metric = 'chat.timeline_apply_ms'\n  AND build_number >= '21'\n  AND ts_ms BETWEEN $__from AND $__to\nORDER BY ts_ms",
          "queryText": "SELECT CAST(ts_ms / 1000 AS INTEGER) AS time, value\nFROM chat_metric_samples\nWHERE metric = 'chat.timeline_apply_ms'\n  AND build_number >= '21'\n  AND ts_ms BETWEEN $__from AND $__to\nORDER BY ts_ms",
          "timeColumns": ["time"],
          "refId": "A"
        },
        {
          "datasource": {
            "type": "frser-sqlite-datasource",
            "uid": "oppi-telemetry-sqlite"
          },
          "queryType": "time series",
          "rawQueryText": "SELECT CAST(ts_ms / 1000 AS INTEGER) AS time, value\nFROM chat_metric_samples\nWHERE metric = 'chat.timeline_layout_ms'\n  AND build_number >= '21'\n  AND ts_ms BETWEEN $__from AND $__to\nORDER BY ts_ms",
          "queryText": "SELECT CAST(ts_ms / 1000 AS INTEGER) AS time, value\nFROM chat_metric_samples\nWHERE metric = 'chat.timeline_layout_ms'\n  AND build_number >= '21'\n  AND ts_ms BETWEEN $__from AND $__to\nORDER BY ts_ms",
          "timeColumns": ["time"],
          "refId": "B"
        }
      ],
      "title": "Timeline Render Cost (build >= 21)",
      "type": "timeseries"
    },
    {
      "datasource": {
        "type": "frser-sqlite-datasource",
        "uid": "oppi-telemetry-sqlite"
      },
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "thresholds"
          },
          "custom": {
            "align": "auto",
            "cellOptions": {
              "type": "auto"
            },
            "inspect": false
          },
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              }
            ]
          }
        },
        "overrides": []
      },
      "gridPos": {
        "h": 6,
        "w": 24,
        "x": 0,
        "y": 34
      },
      "id": 22,
      "options": {
        "cellHeight": "sm",
        "showHeader": true
      },
      "targets": [
        {
          "datasource": {
            "type": "frser-sqlite-datasource",
            "uid": "oppi-telemetry-sqlite"
          },
          "queryType": "table",
          "rawQueryText": "SELECT\n  COALESCE(json_extract(tags_json, '$.result'), 'unknown') AS result,\n  COUNT(*) AS samples,\n  ROUND(AVG(value), 1) AS avg_ms,\n  ROUND(MIN(value), 1) AS min_ms,\n  ROUND(MAX(value), 1) AS max_ms,\n  ROUND(SUM(CASE WHEN value > 500 THEN 1 ELSE 0 END) * 100.0 / COUNT(*), 1) AS over_500ms_pct\nFROM chat_metric_samples\nWHERE metric = 'chat.catchup_ms'\n  AND ts_ms BETWEEN $__from AND $__to\nGROUP BY result\nORDER BY samples DESC",
          "queryText": "SELECT\n  COALESCE(json_extract(tags_json, '$.result'), 'unknown') AS result,\n  COUNT(*) AS samples,\n  ROUND(AVG(value), 1) AS avg_ms,\n  ROUND(MIN(value), 1) AS min_ms,\n  ROUND(MAX(value), 1) AS max_ms,\n  ROUND(SUM(CASE WHEN value > 500 THEN 1 ELSE 0 END) * 100.0 / COUNT(*), 1) AS over_500ms_pct\nFROM chat_metric_samples\nWHERE metric = 'chat.catchup_ms'\n  AND ts_ms BETWEEN $__from AND $__to\nGROUP BY result\nORDER BY samples DESC",
          "timeColumns": [],
          "refId": "A"
        }
      ],
      "title": "Catch-up result breakdown",
      "type": "table"
    },
    {
      "datasource": {
        "type": "frser-sqlite-datasource",
        "uid": "oppi-telemetry-sqlite"
      },
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "palette-classic"
          },
          "unit": "percent",
          "custom": {
            "drawStyle": "points",
            "lineWidth": 0,
            "pointSize": 5,
            "showPoints": "always"
          }
        },
        "overrides": []
      },
      "gridPos": {
        "h": 8,
        "w": 12,
        "x": 0,
        "y": 36
      },
      "id": 30,
      "options": {
        "legend": {
          "calcs": ["lastNotNull", "max", "mean"],
          "displayMode": "table",
          "placement": "bottom"
        },
        "tooltip": {
          "mode": "multi",
          "sort": "desc"
        }
      },
      "targets": [
        {
          "datasource": {
            "type": "frser-sqlite-datasource",
            "uid": "oppi-telemetry-sqlite"
          },
          "queryType": "time series",
          "rawQueryText": "SELECT CAST(ts_ms / 1000 AS INTEGER) AS time,\n  value,\n  COALESCE(json_extract(tags_json, '$.phase'), 'unknown') AS metric\nFROM chat_metric_samples\nWHERE metric = 'chat.jank_pct'\n  AND ts_ms BETWEEN $__from AND $__to\nORDER BY ts_ms",
          "queryText": "SELECT CAST(ts_ms / 1000 AS INTEGER) AS time,\n  value,\n  COALESCE(json_extract(tags_json, '$.phase'), 'unknown') AS metric\nFROM chat_metric_samples\nWHERE metric = 'chat.jank_pct'\n  AND ts_ms BETWEEN $__from AND $__to\nORDER BY ts_ms",
          "timeColumns": ["time"],
          "refId": "A"
        }
      ],
      "title": "Jank Rate (chat.jank_pct, by phase)",
      "type": "timeseries"
    },
    {
      "datasource": {
        "type": "frser-sqlite-datasource",
        "uid": "oppi-telemetry-sqlite"
      },
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "thresholds"
          },
          "custom": {
            "align": "auto",
            "cellOptions": {
              "type": "auto"
            },
            "inspect": false
          },
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              },
              {
                "color": "yellow",
                "value": 5
              },
              {
                "color": "red",
                "value": 15
              }
            ]
          }
        },
        "overrides": []
      },
      "gridPos": {
        "h": 8,
        "w": 12,
        "x": 12,
        "y": 36
      },
      "id": 31,
      "options": {
        "cellHeight": "sm",
        "showHeader": true
      },
      "targets": [
        {
          "datasource": {
            "type": "frser-sqlite-datasource",
            "uid": "oppi-telemetry-sqlite"
          },
          "queryType": "table",
          "rawQueryText": "SELECT\n  COALESCE(json_extract(tags_json, '$.phase'), 'unknown') AS phase,\n  COUNT(*) AS samples,\n  ROUND(AVG(value), 1) AS avg_pct,\n  ROUND(MIN(value), 1) AS min_pct,\n  ROUND(MAX(value), 1) AS max_pct,\n  CAST(ROUND(AVG(CAST(json_extract(tags_json, '$.cycles') AS INTEGER))) AS INTEGER) AS avg_cycles,\n  CAST(ROUND(AVG(CAST(json_extract(tags_json, '$.hitches') AS INTEGER))) AS INTEGER) AS avg_hitches\nFROM chat_metric_samples\nWHERE metric = 'chat.jank_pct'\n  AND ts_ms BETWEEN $__from AND $__to\nGROUP BY phase\nORDER BY avg_pct DESC",
          "queryText": "SELECT\n  COALESCE(json_extract(tags_json, '$.phase'), 'unknown') AS phase,\n  COUNT(*) AS samples,\n  ROUND(AVG(value), 1) AS avg_pct,\n  ROUND(MIN(value), 1) AS min_pct,\n  ROUND(MAX(value), 1) AS max_pct,\n  CAST(ROUND(AVG(CAST(json_extract(tags_json, '$.cycles') AS INTEGER))) AS INTEGER) AS avg_cycles,\n  CAST(ROUND(AVG(CAST(json_extract(tags_json, '$.hitches') AS INTEGER))) AS INTEGER) AS avg_hitches\nFROM chat_metric_samples\nWHERE metric = 'chat.jank_pct'\n  AND ts_ms BETWEEN $__from AND $__to\nGROUP BY phase\nORDER BY avg_pct DESC",
          "timeColumns": [],
          "refId": "A"
        }
      ],
      "title": "Jank breakdown by phase",
      "type": "table"
    },
    {
      "datasource": {
        "type": "frser-sqlite-datasource",
        "uid": "oppi-telemetry-sqlite"
      },
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "palette-classic"
          },
          "unit": "ms",
          "custom": {
            "drawStyle": "points",
            "lineWidth": 0,
            "pointSize": 4,
            "showPoints": "always"
          }
        },
        "overrides": []
      },
      "gridPos": {
        "h": 8,
        "w": 8,
        "x": 0,
        "y": 44
      },
      "id": 8,
      "options": {
        "legend": {
          "calcs": ["lastNotNull", "max"],
          "displayMode": "table",
          "placement": "bottom"
        },
        "tooltip": {
          "mode": "multi",
          "sort": "desc"
        }
      },
      "targets": [
        {
          "datasource": {
            "type": "frser-sqlite-datasource",
            "uid": "oppi-telemetry-sqlite"
          },
          "queryType": "time series",
          "rawQueryText": "SELECT CAST(ts_ms / 1000 AS INTEGER) AS time, value\nFROM chat_metric_samples\nWHERE metric = 'chat.voice_prewarm_ms'\n  AND ts_ms BETWEEN $__from AND $__to\nORDER BY ts_ms",
          "queryText": "SELECT CAST(ts_ms / 1000 AS INTEGER) AS time, value\nFROM chat_metric_samples\nWHERE metric = 'chat.voice_prewarm_ms'\n  AND ts_ms BETWEEN $__from AND $__to\nORDER BY ts_ms",
          "timeColumns": ["time"],
          "refId": "A"
        }
      ],
      "title": "Voice prewarm (chat.voice_prewarm_ms)",
      "type": "timeseries"
    },
    {
      "datasource": {
        "type": "frser-sqlite-datasource",
        "uid": "oppi-telemetry-sqlite"
      },
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "palette-classic"
          },
          "unit": "ms",
          "custom": {
            "drawStyle": "points",
            "lineWidth": 0,
            "pointSize": 4,
            "showPoints": "always"
          }
        },
        "overrides": []
      },
      "gridPos": {
        "h": 8,
        "w": 8,
        "x": 8,
        "y": 44
      },
      "id": 9,
      "options": {
        "legend": {
          "calcs": ["lastNotNull", "max"],
          "displayMode": "table",
          "placement": "bottom"
        },
        "tooltip": {
          "mode": "multi",
          "sort": "desc"
        }
      },
      "targets": [
        {
          "datasource": {
            "type": "frser-sqlite-datasource",
            "uid": "oppi-telemetry-sqlite"
          },
          "queryType": "time series",
          "rawQueryText": "SELECT CAST(ts_ms / 1000 AS INTEGER) AS time, value\nFROM chat_metric_samples\nWHERE metric = 'chat.voice_setup_ms'\n  AND COALESCE(json_extract(tags_json, '$.phase'), '') = 'total'\n  AND ts_ms BETWEEN $__from AND $__to\nORDER BY ts_ms",
          "queryText": "SELECT CAST(ts_ms / 1000 AS INTEGER) AS time, value\nFROM chat_metric_samples\nWHERE metric = 'chat.voice_setup_ms'\n  AND COALESCE(json_extract(tags_json, '$.phase'), '') = 'total'\n  AND ts_ms BETWEEN $__from AND $__to\nORDER BY ts_ms",
          "timeColumns": ["time"],
          "refId": "A"
        }
      ],
      "title": "Voice setup total (chat.voice_setup_ms)",
      "type": "timeseries"
    },
    {
      "datasource": {
        "type": "frser-sqlite-datasource",
        "uid": "oppi-telemetry-sqlite"
      },
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "palette-classic"
          },
          "unit": "ms",
          "custom": {
            "drawStyle": "points",
            "lineWidth": 0,
            "pointSize": 4,
            "showPoints": "always"
          }
        },
        "overrides": []
      },
      "gridPos": {
        "h": 8,
        "w": 8,
        "x": 16,
        "y": 44
      },
      "id": 10,
      "options": {
        "legend": {
          "calcs": ["lastNotNull", "max"],
          "displayMode": "table",
          "placement": "bottom"
        },
        "tooltip": {
          "mode": "multi",
          "sort": "desc"
        }
      },
      "targets": [
        {
          "datasource": {
            "type": "frser-sqlite-datasource",
            "uid": "oppi-telemetry-sqlite"
          },
          "queryType": "time series",
          "rawQueryText": "SELECT CAST(ts_ms / 1000 AS INTEGER) AS time, value\nFROM chat_metric_samples\nWHERE metric = 'chat.voice_first_result_ms'\n  AND ts_ms BETWEEN $__from AND $__to\nORDER BY ts_ms",
          "queryText": "SELECT CAST(ts_ms / 1000 AS INTEGER) AS time, value\nFROM chat_metric_samples\nWHERE metric = 'chat.voice_first_result_ms'\n  AND ts_ms BETWEEN $__from AND $__to\nORDER BY ts_ms",
          "timeColumns": ["time"],
          "refId": "A"
        }
      ],
      "title": "Voice first result (chat.voice_first_result_ms)",
      "type": "timeseries"
    },
    {
      "datasource": {
        "type": "frser-sqlite-datasource",
        "uid": "oppi-telemetry-sqlite"
      },
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "thresholds"
          },
          "custom": {
            "align": "auto",
            "cellOptions": {
              "type": "auto"
            },
            "inspect": false
          },
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              }
            ]
          }
        },
        "overrides": []
      },
      "gridPos": {
        "h": 8,
        "w": 24,
        "x": 0,
        "y": 52
      },
      "id": 11,
      "options": {
        "cellHeight": "sm",
        "showHeader": true
      },
      "targets": [
        {
          "datasource": {
            "type": "frser-sqlite-datasource",
            "uid": "oppi-telemetry-sqlite"
          },
          "queryType": "table",
          "rawQueryText": "SELECT\n  COALESCE(json_extract(tags_json, '$.phase'), '<none>') AS phase,\n  COALESCE(json_extract(tags_json, '$.status'), '<none>') AS status,\n  COUNT(*) AS samples,\n  ROUND(AVG(value), 2) AS avg_ms,\n  ROUND(MIN(value), 2) AS min_ms,\n  ROUND(MAX(value), 2) AS max_ms\nFROM chat_metric_samples\nWHERE metric = 'chat.voice_setup_ms'\n  AND ts_ms BETWEEN $__from AND $__to\nGROUP BY phase, status\nORDER BY phase, status",
          "queryText": "SELECT\n  COALESCE(json_extract(tags_json, '$.phase'), '<none>') AS phase,\n  COALESCE(json_extract(tags_json, '$.status'), '<none>') AS status,\n  COUNT(*) AS samples,\n  ROUND(AVG(value), 2) AS avg_ms,\n  ROUND(MIN(value), 2) AS min_ms,\n  ROUND(MAX(value), 2) AS max_ms\nFROM chat_metric_samples\nWHERE metric = 'chat.voice_setup_ms'\n  AND ts_ms BETWEEN $__from AND $__to\nGROUP BY phase, status\nORDER BY phase, status",
          "timeColumns": [],
          "refId": "A"
        }
      ],
      "title": "Voice setup phase/status breakdown",
      "type": "table"
    },
    {
      "datasource": {
        "type": "frser-sqlite-datasource",
        "uid": "oppi-telemetry-sqlite"
      },
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "palette-classic"
          },
          "unit": "ms",
          "custom": {
            "drawStyle": "points",
            "lineWidth": 0,
            "pointSize": 4,
            "showPoints": "always"
          }
        },
        "overrides": []
      },
      "gridPos": {
        "h": 8,
        "w": 8,
        "x": 0,
        "y": 60
      },
      "id": 74,
      "options": {
        "legend": {
          "calcs": ["lastNotNull", "max"],
          "displayMode": "table",
          "placement": "bottom"
        },
        "tooltip": {
          "mode": "multi",
          "sort": "desc"
        }
      },
      "targets": [
        {
          "datasource": {
            "type": "frser-sqlite-datasource",
            "uid": "oppi-telemetry-sqlite"
          },
          "queryType": "time series",
          "rawQueryText": "SELECT CAST(ts_ms / 1000 AS INTEGER) AS time, value\nFROM chat_metric_samples\nWHERE metric = 'chat.dictation_setup_ms'\n  AND ts_ms BETWEEN $__from AND $__to\nORDER BY ts_ms",
          "queryText": "SELECT CAST(ts_ms / 1000 AS INTEGER) AS time, value\nFROM chat_metric_samples\nWHERE metric = 'chat.dictation_setup_ms'\n  AND ts_ms BETWEEN $__from AND $__to\nORDER BY ts_ms",
          "timeColumns": ["time"],
          "refId": "A"
        }
      ],
      "title": "Dictation Setup (chat.dictation_setup_ms)",
      "type": "timeseries"
    },
    {
      "datasource": {
        "type": "frser-sqlite-datasource",
        "uid": "oppi-telemetry-sqlite"
      },
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "palette-classic"
          },
          "unit": "ms",
          "custom": {
            "drawStyle": "points",
            "lineWidth": 0,
            "pointSize": 4,
            "showPoints": "always"
          }
        },
        "overrides": []
      },
      "gridPos": {
        "h": 8,
        "w": 8,
        "x": 8,
        "y": 60
      },
      "id": 75,
      "options": {
        "legend": {
          "calcs": ["lastNotNull", "max"],
          "displayMode": "table",
          "placement": "bottom"
        },
        "tooltip": {
          "mode": "multi",
          "sort": "desc"
        }
      },
      "targets": [
        {
          "datasource": {
            "type": "frser-sqlite-datasource",
            "uid": "oppi-telemetry-sqlite"
          },
          "queryType": "time series",
          "rawQueryText": "SELECT CAST(ts_ms / 1000 AS INTEGER) AS time, value\nFROM chat_metric_samples\nWHERE metric = 'chat.dictation_first_result_ms'\n  AND ts_ms BETWEEN $__from AND $__to\nORDER BY ts_ms",
          "queryText": "SELECT CAST(ts_ms / 1000 AS INTEGER) AS time, value\nFROM chat_metric_samples\nWHERE metric = 'chat.dictation_first_result_ms'\n  AND ts_ms BETWEEN $__from AND $__to\nORDER BY ts_ms",
          "timeColumns": ["time"],
          "refId": "A"
        }
      ],
      "title": "Dictation First Result (chat.dictation_first_result_ms)",
      "type": "timeseries"
    },
    {
      "datasource": {
        "type": "frser-sqlite-datasource",
        "uid": "oppi-telemetry-sqlite"
      },
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "palette-classic"
          },
          "unit": "ms",
          "custom": {
            "drawStyle": "points",
            "lineWidth": 0,
            "pointSize": 4,
            "showPoints": "always"
          }
        },
        "overrides": []
      },
      "gridPos": {
        "h": 8,
        "w": 8,
        "x": 16,
        "y": 60
      },
      "id": 76,
      "options": {
        "legend": {
          "calcs": ["lastNotNull", "max"],
          "displayMode": "table",
          "placement": "bottom"
        },
        "tooltip": {
          "mode": "multi",
          "sort": "desc"
        }
      },
      "targets": [
        {
          "datasource": {
            "type": "frser-sqlite-datasource",
            "uid": "oppi-telemetry-sqlite"
          },
          "queryType": "time series",
          "rawQueryText": "SELECT CAST(ts_ms / 1000 AS INTEGER) AS time, value\nFROM chat_metric_samples\nWHERE metric = 'chat.dictation_finalize_ms'\n  AND ts_ms BETWEEN $__from AND $__to\nORDER BY ts_ms",
          "queryText": "SELECT CAST(ts_ms / 1000 AS INTEGER) AS time, value\nFROM chat_metric_samples\nWHERE metric = 'chat.dictation_finalize_ms'\n  AND ts_ms BETWEEN $__from AND $__to\nORDER BY ts_ms",
          "timeColumns": ["time"],
          "refId": "A"
        }
      ],
      "title": "Dictation Finalize (chat.dictation_finalize_ms)",
      "type": "timeseries"
    },
    {
      "datasource": {
        "type": "frser-sqlite-datasource",
        "uid": "oppi-telemetry-sqlite"
      },
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "palette-classic"
          },
          "unit": "ms",
          "custom": {
            "drawStyle": "points",
            "lineWidth": 0,
            "pointSize": 4,
            "showPoints": "always"
          }
        },
        "overrides": []
      },
      "gridPos": {
        "h": 8,
        "w": 8,
        "x": 0,
        "y": 68
      },
      "id": 77,
      "options": {
        "legend": {
          "calcs": ["lastNotNull", "max"],
          "displayMode": "table",
          "placement": "bottom"
        },
        "tooltip": {
          "mode": "multi",
          "sort": "desc"
        }
      },
      "targets": [
        {
          "datasource": {
            "type": "frser-sqlite-datasource",
            "uid": "oppi-telemetry-sqlite"
          },
          "queryType": "time series",
          "rawQueryText": "SELECT CAST(ts_ms / 1000 AS INTEGER) AS time, value\nFROM chat_metric_samples\nWHERE metric = 'chat.dictation_session_ms'\n  AND ts_ms BETWEEN $__from AND $__to\nORDER BY ts_ms",
          "queryText": "SELECT CAST(ts_ms / 1000 AS INTEGER) AS time, value\nFROM chat_metric_samples\nWHERE metric = 'chat.dictation_session_ms'\n  AND ts_ms BETWEEN $__from AND $__to\nORDER BY ts_ms",
          "timeColumns": ["time"],
          "refId": "A"
        }
      ],
      "title": "Dictation Session Duration (chat.dictation_session_ms)",
      "type": "timeseries"
    },
    {
      "datasource": {
        "type": "frser-sqlite-datasource",
        "uid": "oppi-telemetry-sqlite"
      },
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "palette-classic"
          },
          "unit": "ms",
          "custom": {
            "drawStyle": "points",
            "lineWidth": 0,
            "pointSize": 4,
            "showPoints": "always"
          }
        },
        "overrides": []
      },
      "gridPos": {
        "h": 8,
        "w": 8,
        "x": 8,
        "y": 68
      },
      "id": 78,
      "options": {
        "legend": {
          "calcs": ["lastNotNull", "max"],
          "displayMode": "table",
          "placement": "bottom"
        },
        "tooltip": {
          "mode": "multi",
          "sort": "desc"
        }
      },
      "targets": [
        {
          "datasource": {
            "type": "frser-sqlite-datasource",
            "uid": "oppi-telemetry-sqlite"
          },
          "queryType": "time series",
          "rawQueryText": "SELECT CAST(ts_ms / 1000 AS INTEGER) AS time, value\nFROM chat_metric_samples\nWHERE metric = 'chat.dictation_audio_duration_ms'\n  AND ts_ms BETWEEN $__from AND $__to\nORDER BY ts_ms",
          "queryText": "SELECT CAST(ts_ms / 1000 AS INTEGER) AS time, value\nFROM chat_metric_samples\nWHERE metric = 'chat.dictation_audio_duration_ms'\n  AND ts_ms BETWEEN $__from AND $__to\nORDER BY ts_ms",
          "timeColumns": ["time"],
          "refId": "A"
        }
      ],
      "title": "Audio Duration (chat.dictation_audio_duration_ms)",
      "type": "timeseries"
    },
    {
      "datasource": {
        "type": "frser-sqlite-datasource",
        "uid": "oppi-telemetry-sqlite"
      },
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "palette-classic"
          },
          "unit": "none",
          "custom": {
            "drawStyle": "points",
            "lineWidth": 0,
            "pointSize": 4,
            "showPoints": "always"
          }
        },
        "overrides": []
      },
      "gridPos": {
        "h": 8,
        "w": 8,
        "x": 16,
        "y": 68
      },
      "id": 79,
      "options": {
        "legend": {
          "calcs": ["lastNotNull", "max"],
          "displayMode": "table",
          "placement": "bottom"
        },
        "tooltip": {
          "mode": "multi",
          "sort": "desc"
        }
      },
      "targets": [
        {
          "datasource": {
            "type": "frser-sqlite-datasource",
            "uid": "oppi-telemetry-sqlite"
          },
          "queryType": "time series",
          "rawQueryText": "SELECT CAST(ts_ms / 1000 AS INTEGER) AS time, value\nFROM chat_metric_samples\nWHERE metric = 'chat.dictation_result_updates'\n  AND ts_ms BETWEEN $__from AND $__to\nORDER BY ts_ms",
          "queryText": "SELECT CAST(ts_ms / 1000 AS INTEGER) AS time, value\nFROM chat_metric_samples\nWHERE metric = 'chat.dictation_result_updates'\n  AND ts_ms BETWEEN $__from AND $__to\nORDER BY ts_ms",
          "timeColumns": ["time"],
          "refId": "A"
        }
      ],
      "title": "Result Updates (chat.dictation_result_updates)",
      "type": "timeseries"
    },
    {
      "datasource": {
        "type": "frser-sqlite-datasource",
        "uid": "oppi-telemetry-sqlite"
      },
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "palette-classic"
          },
          "unit": "percentunit",
          "custom": {
            "drawStyle": "points",
            "lineWidth": 0,
            "pointSize": 4,
            "showPoints": "always"
          }
        },
        "overrides": []
      },
      "gridPos": {
        "h": 8,
        "w": 12,
        "x": 0,
        "y": 76
      },
      "id": 80,
      "options": {
        "legend": {
          "calcs": ["lastNotNull", "max"],
          "displayMode": "table",
          "placement": "bottom"
        },
        "tooltip": {
          "mode": "multi",
          "sort": "desc"
        }
      },
      "targets": [
        {
          "datasource": {
            "type": "frser-sqlite-datasource",
            "uid": "oppi-telemetry-sqlite"
          },
          "queryType": "time series",
          "rawQueryText": "SELECT CAST(ts_ms / 1000 AS INTEGER) AS time, value\nFROM chat_metric_samples\nWHERE metric = 'chat.dictation_preview_final_delta'\n  AND ts_ms BETWEEN $__from AND $__to\nORDER BY ts_ms",
          "queryText": "SELECT CAST(ts_ms / 1000 AS INTEGER) AS time, value\nFROM chat_metric_samples\nWHERE metric = 'chat.dictation_preview_final_delta'\n  AND ts_ms BETWEEN $__from AND $__to\nORDER BY ts_ms",
          "timeColumns": ["time"],
          "refId": "A"
        }
      ],
      "title": "Preview vs Final Delta (chat.dictation_preview_final_delta)",
      "type": "timeseries"
    },
    {
      "datasource": {
        "type": "frser-sqlite-datasource",
        "uid": "oppi-telemetry-sqlite"
      },
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "palette-classic"
          },
          "unit": "none",
          "custom": {
            "drawStyle": "points",
            "lineWidth": 0,
            "pointSize": 4,
            "showPoints": "always"
          }
        },
        "overrides": []
      },
      "gridPos": {
        "h": 8,
        "w": 12,
        "x": 12,
        "y": 76
      },
      "id": 81,
      "options": {
        "legend": {
          "calcs": ["lastNotNull", "max"],
          "displayMode": "table",
          "placement": "bottom"
        },
        "tooltip": {
          "mode": "multi",
          "sort": "desc"
        }
      },
      "targets": [
        {
          "datasource": {
            "type": "frser-sqlite-datasource",
            "uid": "oppi-telemetry-sqlite"
          },
          "queryType": "time series",
          "rawQueryText": "SELECT CAST(ts_ms / 1000 AS INTEGER) AS time, value AS errors\nFROM chat_metric_samples\nWHERE metric = 'chat.dictation_error'\n  AND ts_ms BETWEEN $__from AND $__to\nORDER BY ts_ms",
          "queryText": "SELECT CAST(ts_ms / 1000 AS INTEGER) AS time, value AS errors\nFROM chat_metric_samples\nWHERE metric = 'chat.dictation_error'\n  AND ts_ms BETWEEN $__from AND $__to\nORDER BY ts_ms",
          "timeColumns": ["time"],
          "refId": "A"
        },
        {
          "datasource": {
            "type": "frser-sqlite-datasource",
            "uid": "oppi-telemetry-sqlite"
          },
          "queryType": "time series",
          "rawQueryText": "SELECT CAST(ts_ms / 1000 AS INTEGER) AS time, value AS cancels\nFROM chat_metric_samples\nWHERE metric = 'chat.dictation_cancel'\n  AND ts_ms BETWEEN $__from AND $__to\nORDER BY ts_ms",
          "queryText": "SELECT CAST(ts_ms / 1000 AS INTEGER) AS time, value AS cancels\nFROM chat_metric_samples\nWHERE metric = 'chat.dictation_cancel'\n  AND ts_ms BETWEEN $__from AND $__to\nORDER BY ts_ms",
          "timeColumns": ["time"],
          "refId": "B"
        }
      ],
      "title": "Errors + Cancels",
      "type": "timeseries"
    },
    {
      "datasource": {
        "type": "frser-sqlite-datasource",
        "uid": "oppi-telemetry-sqlite"
      },
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "thresholds"
          },
          "custom": {
            "align": "auto",
            "cellOptions": {
              "type": "auto"
            },
            "inspect": false
          },
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              }
            ]
          }
        },
        "overrides": []
      },
      "gridPos": {
        "h": 8,
        "w": 24,
        "x": 0,
        "y": 84
      },
      "id": 82,
      "options": {
        "cellHeight": "sm",
        "showHeader": true
      },
      "targets": [
        {
          "datasource": {
            "type": "frser-sqlite-datasource",
            "uid": "oppi-telemetry-sqlite"
          },
          "queryType": "table",
          "rawQueryText": "SELECT\n  COALESCE(json_extract(tags_json, '$.stt_backend'), '<none>') AS stt_backend,\n  COALESCE(json_extract(tags_json, '$.model'), '<none>') AS model,\n  COUNT(*) AS sessions,\n  ROUND(AVG(value), 0) AS avg_ms,\n  ROUND(MIN(value), 0) AS min_ms,\n  ROUND(MAX(value), 0) AS max_ms\nFROM chat_metric_samples\nWHERE metric = 'chat.dictation_session_ms'\n  AND ts_ms BETWEEN $__from AND $__to\nGROUP BY stt_backend, model\nORDER BY sessions DESC",
          "queryText": "SELECT\n  COALESCE(json_extract(tags_json, '$.stt_backend'), '<none>') AS stt_backend,\n  COALESCE(json_extract(tags_json, '$.model'), '<none>') AS model,\n  COUNT(*) AS sessions,\n  ROUND(AVG(value), 0) AS avg_ms,\n  ROUND(MIN(value), 0) AS min_ms,\n  ROUND(MAX(value), 0) AS max_ms\nFROM chat_metric_samples\nWHERE metric = 'chat.dictation_session_ms'\n  AND ts_ms BETWEEN $__from AND $__to\nGROUP BY stt_backend, model\nORDER BY sessions DESC",
          "timeColumns": [],
          "refId": "A"
        }
      ],
      "title": "Dictation by STT Backend/Model",
      "type": "table"
    },
    {
      "datasource": {
        "type": "frser-sqlite-datasource",
        "uid": "oppi-telemetry-sqlite"
      },
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "palette-classic"
          },
          "unit": "ms",
          "custom": {
            "drawStyle": "points",
            "lineWidth": 0,
            "pointSize": 4,
            "showPoints": "always"
          }
        },
        "overrides": [
          {
            "matcher": {
              "id": "byFrameRefID",
              "options": "A"
            },
            "properties": [
              {
                "id": "displayName",
                "value": "session_load_ms (vital)"
              },
              {
                "id": "color",
                "value": {
                  "mode": "fixed",
                  "fixedColor": "yellow"
                }
              }
            ]
          },
          {
            "matcher": {
              "id": "byFrameRefID",
              "options": "B"
            },
            "properties": [
              {
                "id": "displayName",
                "value": "trace_fetch_ms"
              },
              {
                "id": "color",
                "value": {
                  "mode": "fixed",
                  "fixedColor": "red"
                }
              }
            ]
          },
          {
            "matcher": {
              "id": "byFrameRefID",
              "options": "C"
            },
            "properties": [
              {
                "id": "displayName",
                "value": "cache_load_ms"
              },
              {
                "id": "color",
                "value": {
                  "mode": "fixed",
                  "fixedColor": "green"
                }
              }
            ]
          },
          {
            "matcher": {
              "id": "byFrameRefID",
              "options": "D"
            },
            "properties": [
              {
                "id": "displayName",
                "value": "reducer_load_ms"
              },
              {
                "id": "color",
                "value": {
                  "mode": "fixed",
                  "fixedColor": "orange"
                }
              }
            ]
          }
        ]
      },
      "gridPos": {
        "h": 8,
        "w": 12,
        "x": 0,
        "y": 92
      },
      "id": 29,
      "options": {
        "legend": {
          "calcs": ["lastNotNull", "max"],
          "displayMode": "table",
          "placement": "bottom"
        },
        "tooltip": {
          "mode": "multi",
          "sort": "desc"
        }
      },
      "targets": [
        {
          "datasource": {
            "type": "frser-sqlite-datasource",
            "uid": "oppi-telemetry-sqlite"
          },
          "queryType": "time series",
          "rawQueryText": "SELECT CAST(ts_ms / 1000 AS INTEGER) AS time, value\nFROM chat_metric_samples\nWHERE metric = 'chat.session_load_ms'\n  AND ts_ms BETWEEN $__from AND $__to\nORDER BY ts_ms",
          "queryText": "SELECT CAST(ts_ms / 1000 AS INTEGER) AS time, value\nFROM chat_metric_samples\nWHERE metric = 'chat.session_load_ms'\n  AND ts_ms BETWEEN $__from AND $__to\nORDER BY ts_ms",
          "timeColumns": ["time"],
          "refId": "A"
        },
        {
          "datasource": {
            "type": "frser-sqlite-datasource",
            "uid": "oppi-telemetry-sqlite"
          },
          "queryType": "time series",
          "rawQueryText": "SELECT CAST(ts_ms / 1000 AS INTEGER) AS time, value\nFROM chat_metric_samples\nWHERE metric = 'chat.trace_fetch_ms'\n  AND ts_ms BETWEEN $__from AND $__to\nORDER BY ts_ms",
          "queryText": "SELECT CAST(ts_ms / 1000 AS INTEGER) AS time, value\nFROM chat_metric_samples\nWHERE metric = 'chat.trace_fetch_ms'\n  AND ts_ms BETWEEN $__from AND $__to\nORDER BY ts_ms",
          "timeColumns": ["time"],
          "refId": "B"
        },
        {
          "datasource": {
            "type": "frser-sqlite-datasource",
            "uid": "oppi-telemetry-sqlite"
          },
          "queryType": "time series",
          "rawQueryText": "SELECT CAST(ts_ms / 1000 AS INTEGER) AS time, value\nFROM chat_metric_samples\nWHERE metric = 'chat.cache_load_ms'\n  AND ts_ms BETWEEN $__from AND $__to\nORDER BY ts_ms",
          "queryText": "SELECT CAST(ts_ms / 1000 AS INTEGER) AS time, value\nFROM chat_metric_samples\nWHERE metric = 'chat.cache_load_ms'\n  AND ts_ms BETWEEN $__from AND $__to\nORDER BY ts_ms",
          "timeColumns": ["time"],
          "refId": "C"
        },
        {
          "datasource": {
            "type": "frser-sqlite-datasource",
            "uid": "oppi-telemetry-sqlite"
          },
          "queryType": "time series",
          "rawQueryText": "SELECT CAST(ts_ms / 1000 AS INTEGER) AS time, value\nFROM chat_metric_samples\nWHERE metric = 'chat.reducer_load_ms'\n  AND ts_ms BETWEEN $__from AND $__to\nORDER BY ts_ms",
          "queryText": "SELECT CAST(ts_ms / 1000 AS INTEGER) AS time, value\nFROM chat_metric_samples\nWHERE metric = 'chat.reducer_load_ms'\n  AND ts_ms BETWEEN $__from AND $__to\nORDER BY ts_ms",
          "timeColumns": ["time"],
          "refId": "D"
        }
      ],
      "title": "Session Load Pipeline",
      "type": "timeseries"
    },
    {
      "datasource": {
        "type": "frser-sqlite-datasource",
        "uid": "oppi-telemetry-sqlite"
      },
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "thresholds"
          },
          "custom": {
            "align": "auto",
            "cellOptions": {
              "type": "auto"
            },
            "inspect": false
          },
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              }
            ]
          }
        },
        "overrides": []
      },
      "gridPos": {
        "h": 8,
        "w": 24,
        "x": 0,
        "y": 100
      },
      "id": 16,
      "options": {
        "cellHeight": "sm",
        "showHeader": true
      },
      "targets": [
        {
          "datasource": {
            "type": "frser-sqlite-datasource",
            "uid": "oppi-telemetry-sqlite"
          },
          "queryType": "table",
          "rawQueryText": "SELECT\n  COALESCE(json_extract(tags_json, '$.provider'), 'unknown') AS provider,\n  COALESCE(json_extract(tags_json, '$.model'), 'unknown') AS model,\n  COUNT(*) AS samples,\n  ROUND(AVG(value), 2) AS avg_ms,\n  ROUND(MIN(value), 2) AS min_ms,\n  ROUND(MAX(value), 2) AS max_ms,\n  ROUND(SUM(CASE WHEN value > 1200 THEN 1 ELSE 0 END) * 100.0 / COUNT(*), 1) AS over_1200ms_pct\nFROM chat_metric_samples\nWHERE metric = 'chat.ttft_ms'\n  AND ts_ms BETWEEN $__from AND $__to\nGROUP BY provider, model\nORDER BY samples DESC, avg_ms DESC",
          "queryText": "SELECT\n  COALESCE(json_extract(tags_json, '$.provider'), 'unknown') AS provider,\n  COALESCE(json_extract(tags_json, '$.model'), 'unknown') AS model,\n  COUNT(*) AS samples,\n  ROUND(AVG(value), 2) AS avg_ms,\n  ROUND(MIN(value), 2) AS min_ms,\n  ROUND(MAX(value), 2) AS max_ms,\n  ROUND(SUM(CASE WHEN value > 1200 THEN 1 ELSE 0 END) * 100.0 / COUNT(*), 1) AS over_1200ms_pct\nFROM chat_metric_samples\nWHERE metric = 'chat.ttft_ms'\n  AND ts_ms BETWEEN $__from AND $__to\nGROUP BY provider, model\nORDER BY samples DESC, avg_ms DESC",
          "timeColumns": [],
          "refId": "A"
        }
      ],
      "title": "TTFT by provider/model",
      "type": "table"
    },
    {
      "datasource": {
        "type": "frser-sqlite-datasource",
        "uid": "oppi-telemetry-sqlite"
      },
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "thresholds"
          },
          "custom": {
            "align": "auto",
            "cellOptions": {
              "type": "auto"
            },
            "inspect": false
          },
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              }
            ]
          }
        },
        "overrides": []
      },
      "gridPos": {
        "h": 9,
        "w": 24,
        "x": 0,
        "y": 108
      },
      "id": 17,
      "options": {
        "cellHeight": "sm",
        "showHeader": true
      },
      "targets": [
        {
          "datasource": {
            "type": "frser-sqlite-datasource",
            "uid": "oppi-telemetry-sqlite"
          },
          "queryType": "table",
          "rawQueryText": "SELECT\n  session_id,\n  COALESCE(json_extract(tags_json, '$.provider'), 'unknown') AS provider,\n  COALESCE(json_extract(tags_json, '$.model'), 'unknown') AS model,\n  CAST(MAX(CASE WHEN metric = 'chat.session_message_count' THEN value END) AS INTEGER) AS message_count,\n  CAST(MAX(CASE WHEN metric = 'chat.session_input_tokens' THEN value END) AS INTEGER) AS input_tokens,\n  CAST(MAX(CASE WHEN metric = 'chat.session_output_tokens' THEN value END) AS INTEGER) AS output_tokens,\n  CAST(MAX(CASE WHEN metric = 'chat.session_mutating_tool_calls' THEN value END) AS INTEGER) AS mutating_tool_calls,\n  CAST(MAX(CASE WHEN metric = 'chat.session_files_changed' THEN value END) AS INTEGER) AS files_changed,\n  CAST(MAX(CASE WHEN metric = 'chat.session_added_lines' THEN value END) AS INTEGER) AS added_lines,\n  CAST(MAX(CASE WHEN metric = 'chat.session_removed_lines' THEN value END) AS INTEGER) AS removed_lines,\n  CAST(MAX(CASE WHEN metric = 'chat.session_context_tokens' THEN value END) AS INTEGER) AS context_tokens,\n  CAST(MAX(CASE WHEN metric = 'chat.session_context_window' THEN value END) AS INTEGER) AS context_window,\n  MAX(build_number) AS latest_build,\n  datetime(MAX(ts_ms) / 1000, 'unixepoch', 'localtime') AS last_seen\nFROM chat_metric_samples\nWHERE metric IN (\n  'chat.session_message_count',\n  'chat.session_input_tokens',\n  'chat.session_output_tokens',\n  'chat.session_mutating_tool_calls',\n  'chat.session_files_changed',\n  'chat.session_added_lines',\n  'chat.session_removed_lines',\n  'chat.session_context_tokens',\n  'chat.session_context_window'\n)\n  AND ts_ms BETWEEN $__from AND $__to\nGROUP BY session_id, provider, model\nORDER BY MAX(ts_ms) DESC",
          "queryText": "SELECT\n  session_id,\n  COALESCE(json_extract(tags_json, '$.provider'), 'unknown') AS provider,\n  COALESCE(json_extract(tags_json, '$.model'), 'unknown') AS model,\n  CAST(MAX(CASE WHEN metric = 'chat.session_message_count' THEN value END) AS INTEGER) AS message_count,\n  CAST(MAX(CASE WHEN metric = 'chat.session_input_tokens' THEN value END) AS INTEGER) AS input_tokens,\n  CAST(MAX(CASE WHEN metric = 'chat.session_output_tokens' THEN value END) AS INTEGER) AS output_tokens,\n  CAST(MAX(CASE WHEN metric = 'chat.session_mutating_tool_calls' THEN value END) AS INTEGER) AS mutating_tool_calls,\n  CAST(MAX(CASE WHEN metric = 'chat.session_files_changed' THEN value END) AS INTEGER) AS files_changed,\n  CAST(MAX(CASE WHEN metric = 'chat.session_added_lines' THEN value END) AS INTEGER) AS added_lines,\n  CAST(MAX(CASE WHEN metric = 'chat.session_removed_lines' THEN value END) AS INTEGER) AS removed_lines,\n  CAST(MAX(CASE WHEN metric = 'chat.session_context_tokens' THEN value END) AS INTEGER) AS context_tokens,\n  CAST(MAX(CASE WHEN metric = 'chat.session_context_window' THEN value END) AS INTEGER) AS context_window,\n  MAX(build_number) AS latest_build,\n  datetime(MAX(ts_ms) / 1000, 'unixepoch', 'localtime') AS last_seen\nFROM chat_metric_samples\nWHERE metric IN (\n  'chat.session_message_count',\n  'chat.session_input_tokens',\n  'chat.session_output_tokens',\n  'chat.session_mutating_tool_calls',\n  'chat.session_files_changed',\n  'chat.session_added_lines',\n  'chat.session_removed_lines',\n  'chat.session_context_tokens',\n  'chat.session_context_window'\n)\n  AND ts_ms BETWEEN $__from AND $__to\nGROUP BY session_id, provider, model\nORDER BY MAX(ts_ms) DESC",
          "timeColumns": [],
          "refId": "A"
        }
      ],
      "title": "Agent workload by session (not UX latency)",
      "description": "Session size, token, tool, and file-change counters explain how much work the agent did. High values are not bad by themselves; correlate them with TTFT, errors, tool hangs, or missing progress.",
      "type": "table"
    },
    {
      "datasource": {
        "type": "frser-sqlite-datasource",
        "uid": "oppi-telemetry-sqlite"
      },
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "palette-classic"
          },
          "unit": "ms",
          "custom": {
            "drawStyle": "points",
            "lineWidth": 0,
            "pointSize": 4,
            "showPoints": "always"
          }
        },
        "overrides": []
      },
      "gridPos": {
        "h": 8,
        "w": 12,
        "x": 0,
        "y": 117
      },
      "id": 18,
      "options": {
        "legend": {
          "calcs": ["lastNotNull", "max"],
          "displayMode": "table",
          "placement": "bottom"
        },
        "tooltip": {
          "mode": "multi",
          "sort": "desc"
        }
      },
      "targets": [
        {
          "datasource": {
            "type": "frser-sqlite-datasource",
            "uid": "oppi-telemetry-sqlite"
          },
          "queryType": "time series",
          "rawQueryText": "SELECT CAST(ts_ms / 1000 AS INTEGER) AS time, value\nFROM chat_metric_samples\nWHERE metric = 'chat.cell_configure_ms'\n  AND COALESCE(json_extract(tags_json, '$.expanded'), '0') = '1'\n  AND ts_ms BETWEEN $__from AND $__to\nORDER BY ts_ms",
          "queryText": "SELECT CAST(ts_ms / 1000 AS INTEGER) AS time, value\nFROM chat_metric_samples\nWHERE metric = 'chat.cell_configure_ms'\n  AND COALESCE(json_extract(tags_json, '$.expanded'), '0') = '1'\n  AND ts_ms BETWEEN $__from AND $__to\nORDER BY ts_ms",
          "timeColumns": ["time"],
          "refId": "A"
        }
      ],
      "title": "Expanded tool cell configure (chat.cell_configure_ms)",
      "type": "timeseries"
    },
    {
      "datasource": {
        "type": "frser-sqlite-datasource",
        "uid": "oppi-telemetry-sqlite"
      },
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "thresholds"
          },
          "custom": {
            "align": "auto",
            "cellOptions": {
              "type": "auto"
            },
            "inspect": false
          },
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              }
            ]
          }
        },
        "overrides": []
      },
      "gridPos": {
        "h": 8,
        "w": 12,
        "x": 12,
        "y": 117
      },
      "id": 19,
      "options": {
        "cellHeight": "sm",
        "showHeader": true
      },
      "targets": [
        {
          "datasource": {
            "type": "frser-sqlite-datasource",
            "uid": "oppi-telemetry-sqlite"
          },
          "queryType": "table",
          "rawQueryText": "SELECT\n  COALESCE(json_extract(tags_json, '$.content_type'), 'collapsed') AS content_type,\n  COALESCE(json_extract(tags_json, '$.tool'), 'unknown') AS tool,\n  COALESCE(json_extract(tags_json, '$.output_bytes'), '?') AS output_bytes,\n  COALESCE(json_extract(tags_json, '$.expanded'), '0') AS expanded,\n  COUNT(*) AS samples,\n  ROUND(AVG(value), 2) AS avg_ms,\n  ROUND(MIN(value), 2) AS min_ms,\n  ROUND(MAX(value), 2) AS max_ms,\n  ROUND(SUM(CASE WHEN value > 16 THEN 1 ELSE 0 END) * 100.0 / COUNT(*), 1) AS over_16ms_pct\nFROM chat_metric_samples\nWHERE metric = 'chat.cell_configure_ms'\n  AND ts_ms BETWEEN $__from AND $__to\nGROUP BY content_type, tool, output_bytes, expanded\nORDER BY max_ms DESC",
          "queryText": "SELECT\n  COALESCE(json_extract(tags_json, '$.content_type'), 'collapsed') AS content_type,\n  COALESCE(json_extract(tags_json, '$.tool'), 'unknown') AS tool,\n  COALESCE(json_extract(tags_json, '$.output_bytes'), '?') AS output_bytes,\n  COALESCE(json_extract(tags_json, '$.expanded'), '0') AS expanded,\n  COUNT(*) AS samples,\n  ROUND(AVG(value), 2) AS avg_ms,\n  ROUND(MIN(value), 2) AS min_ms,\n  ROUND(MAX(value), 2) AS max_ms,\n  ROUND(SUM(CASE WHEN value > 16 THEN 1 ELSE 0 END) * 100.0 / COUNT(*), 1) AS over_16ms_pct\nFROM chat_metric_samples\nWHERE metric = 'chat.cell_configure_ms'\n  AND ts_ms BETWEEN $__from AND $__to\nGROUP BY content_type, tool, output_bytes, expanded\nORDER BY max_ms DESC",
          "timeColumns": [],
          "refId": "A"
        }
      ],
      "title": "Cell configure by content type/tool/size",
      "type": "table"
    },
    {
      "datasource": {
        "type": "frser-sqlite-datasource",
        "uid": "oppi-telemetry-sqlite"
      },
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "palette-classic"
          },
          "unit": "ms",
          "custom": {
            "drawStyle": "points",
            "lineWidth": 0,
            "pointSize": 4,
            "showPoints": "always"
          }
        },
        "overrides": []
      },
      "gridPos": {
        "h": 8,
        "w": 12,
        "x": 0,
        "y": 125
      },
      "id": 20,
      "options": {
        "legend": {
          "calcs": ["lastNotNull", "max"],
          "displayMode": "table",
          "placement": "bottom"
        },
        "tooltip": {
          "mode": "multi",
          "sort": "desc"
        }
      },
      "targets": [
        {
          "datasource": {
            "type": "frser-sqlite-datasource",
            "uid": "oppi-telemetry-sqlite"
          },
          "queryType": "time series",
          "rawQueryText": "SELECT CAST(ts_ms / 1000 AS INTEGER) AS time, value\nFROM chat_metric_samples\nWHERE metric = 'chat.render_strategy_ms'\n  AND ts_ms BETWEEN $__from AND $__to\nORDER BY ts_ms",
          "queryText": "SELECT CAST(ts_ms / 1000 AS INTEGER) AS time, value\nFROM chat_metric_samples\nWHERE metric = 'chat.render_strategy_ms'\n  AND ts_ms BETWEEN $__from AND $__to\nORDER BY ts_ms",
          "timeColumns": ["time"],
          "refId": "A"
        }
      ],
      "title": "Render strategy (chat.render_strategy_ms)",
      "type": "timeseries"
    },
    {
      "datasource": {
        "type": "frser-sqlite-datasource",
        "uid": "oppi-telemetry-sqlite"
      },
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "thresholds"
          },
          "custom": {
            "align": "auto",
            "cellOptions": {
              "type": "auto"
            },
            "inspect": false
          },
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              }
            ]
          }
        },
        "overrides": []
      },
      "gridPos": {
        "h": 8,
        "w": 12,
        "x": 12,
        "y": 125
      },
      "id": 21,
      "options": {
        "cellHeight": "sm",
        "showHeader": true
      },
      "targets": [
        {
          "datasource": {
            "type": "frser-sqlite-datasource",
            "uid": "oppi-telemetry-sqlite"
          },
          "queryType": "table",
          "rawQueryText": "SELECT\n  COALESCE(json_extract(tags_json, '$.mode'), 'unknown') AS mode,\n  COALESCE(json_extract(tags_json, '$.language'), '-') AS language,\n  COALESCE(json_extract(tags_json, '$.input_bytes'), '?') AS input_bytes,\n  COUNT(*) AS samples,\n  ROUND(AVG(value), 2) AS avg_ms,\n  ROUND(MIN(value), 2) AS min_ms,\n  ROUND(MAX(value), 2) AS max_ms,\n  ROUND(SUM(CASE WHEN value > 16 THEN 1 ELSE 0 END) * 100.0 / COUNT(*), 1) AS over_16ms_pct\nFROM chat_metric_samples\nWHERE metric = 'chat.render_strategy_ms'\n  AND ts_ms BETWEEN $__from AND $__to\nGROUP BY mode, language, input_bytes\nORDER BY max_ms DESC",
          "queryText": "SELECT\n  COALESCE(json_extract(tags_json, '$.mode'), 'unknown') AS mode,\n  COALESCE(json_extract(tags_json, '$.language'), '-') AS language,\n  COALESCE(json_extract(tags_json, '$.input_bytes'), '?') AS input_bytes,\n  COUNT(*) AS samples,\n  ROUND(AVG(value), 2) AS avg_ms,\n  ROUND(MIN(value), 2) AS min_ms,\n  ROUND(MAX(value), 2) AS max_ms,\n  ROUND(SUM(CASE WHEN value > 16 THEN 1 ELSE 0 END) * 100.0 / COUNT(*), 1) AS over_16ms_pct\nFROM chat_metric_samples\nWHERE metric = 'chat.render_strategy_ms'\n  AND ts_ms BETWEEN $__from AND $__to\nGROUP BY mode, language, input_bytes\nORDER BY max_ms DESC",
          "timeColumns": [],
          "refId": "A"
        }
      ],
      "title": "Render strategy by mode/language/size",
      "type": "table"
    },
    {
      "datasource": {
        "type": "frser-sqlite-datasource",
        "uid": "oppi-telemetry-sqlite"
      },
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "fixed",
            "fixedColor": "red"
          },
          "unit": "ms",
          "custom": {
            "drawStyle": "points",
            "lineWidth": 0,
            "pointSize": 5,
            "showPoints": "always",
            "thresholdsStyle": {
              "mode": "line"
            }
          },
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              },
              {
                "color": "red",
                "value": 16
              }
            ]
          }
        },
        "overrides": []
      },
      "gridPos": {
        "h": 8,
        "w": 12,
        "x": 0,
        "y": 133
      },
      "id": 32,
      "options": {
        "legend": {
          "calcs": ["lastNotNull", "max", "count"],
          "displayMode": "table",
          "placement": "bottom"
        },
        "tooltip": {
          "mode": "multi",
          "sort": "desc"
        }
      },
      "targets": [
        {
          "datasource": {
            "type": "frser-sqlite-datasource",
            "uid": "oppi-telemetry-sqlite"
          },
          "queryType": "time series",
          "rawQueryText": "SELECT CAST(ts_ms / 1000 AS INTEGER) AS time, value\nFROM chat_metric_samples\nWHERE metric = 'chat.timeline_hitch'\n  AND ts_ms BETWEEN $__from AND $__to\nORDER BY ts_ms",
          "queryText": "SELECT CAST(ts_ms / 1000 AS INTEGER) AS time, value\nFROM chat_metric_samples\nWHERE metric = 'chat.timeline_hitch'\n  AND ts_ms BETWEEN $__from AND $__to\nORDER BY ts_ms",
          "timeColumns": ["time"],
          "refId": "A"
        }
      ],
      "title": "Timeline Hitch (chat.timeline_hitch)",
      "type": "timeseries"
    },
    {
      "datasource": {
        "type": "frser-sqlite-datasource",
        "uid": "oppi-telemetry-sqlite"
      },
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "palette-classic"
          },
          "unit": "ms",
          "custom": {
            "drawStyle": "points",
            "lineWidth": 0,
            "pointSize": 5,
            "showPoints": "always"
          }
        },
        "overrides": [
          {
            "matcher": {
              "id": "byFrameRefID",
              "options": "A"
            },
            "properties": [
              {
                "id": "displayName",
                "value": "app_launch_ms"
              },
              {
                "id": "color",
                "value": {
                  "mode": "fixed",
                  "fixedColor": "blue"
                }
              }
            ]
          },
          {
            "matcher": {
              "id": "byFrameRefID",
              "options": "B"
            },
            "properties": [
              {
                "id": "displayName",
                "value": "session_switch_ms"
              },
              {
                "id": "color",
                "value": {
                  "mode": "fixed",
                  "fixedColor": "orange"
                }
              }
            ]
          }
        ]
      },
      "gridPos": {
        "h": 8,
        "w": 12,
        "x": 12,
        "y": 133
      },
      "id": 33,
      "options": {
        "legend": {
          "calcs": ["lastNotNull", "max"],
          "displayMode": "table",
          "placement": "bottom"
        },
        "tooltip": {
          "mode": "multi",
          "sort": "desc"
        }
      },
      "targets": [
        {
          "datasource": {
            "type": "frser-sqlite-datasource",
            "uid": "oppi-telemetry-sqlite"
          },
          "queryType": "time series",
          "rawQueryText": "SELECT CAST(ts_ms / 1000 AS INTEGER) AS time, value\nFROM chat_metric_samples\nWHERE metric = 'chat.app_launch_ms'\n  AND ts_ms BETWEEN $__from AND $__to\nORDER BY ts_ms",
          "queryText": "SELECT CAST(ts_ms / 1000 AS INTEGER) AS time, value\nFROM chat_metric_samples\nWHERE metric = 'chat.app_launch_ms'\n  AND ts_ms BETWEEN $__from AND $__to\nORDER BY ts_ms",
          "timeColumns": ["time"],
          "refId": "A"
        },
        {
          "datasource": {
            "type": "frser-sqlite-datasource",
            "uid": "oppi-telemetry-sqlite"
          },
          "queryType": "time series",
          "rawQueryText": "SELECT CAST(ts_ms / 1000 AS INTEGER) AS time, value\nFROM chat_metric_samples\nWHERE metric = 'chat.session_switch_ms'\n  AND ts_ms BETWEEN $__from AND $__to\nORDER BY ts_ms",
          "queryText": "SELECT CAST(ts_ms / 1000 AS INTEGER) AS time, value\nFROM chat_metric_samples\nWHERE metric = 'chat.session_switch_ms'\n  AND ts_ms BETWEEN $__from AND $__to\nORDER BY ts_ms",
          "timeColumns": ["time"],
          "refId": "B"
        }
      ],
      "title": "App Launch + Session Switch",
      "type": "timeseries"
    },
    {
      "datasource": {
        "type": "frser-sqlite-datasource",
        "uid": "oppi-telemetry-sqlite"
      },
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "palette-classic"
          },
          "unit": "ms",
          "custom": {
            "drawStyle": "points",
            "lineWidth": 0,
            "pointSize": 4,
            "showPoints": "always"
          }
        },
        "overrides": []
      },
      "gridPos": {
        "h": 8,
        "w": 12,
        "x": 0,
        "y": 141
      },
      "id": 34,
      "options": {
        "legend": {
          "calcs": ["lastNotNull", "max"],
          "displayMode": "table",
          "placement": "bottom"
        },
        "tooltip": {
          "mode": "multi",
          "sort": "desc"
        }
      },
      "targets": [
        {
          "datasource": {
            "type": "frser-sqlite-datasource",
            "uid": "oppi-telemetry-sqlite"
          },
          "queryType": "time series",
          "rawQueryText": "SELECT CAST(ts_ms / 1000 AS INTEGER) AS time, value\nFROM chat_metric_samples\nWHERE metric = 'chat.session_list_compute_ms'\n  AND ts_ms BETWEEN $__from AND $__to\nORDER BY ts_ms",
          "queryText": "SELECT CAST(ts_ms / 1000 AS INTEGER) AS time, value\nFROM chat_metric_samples\nWHERE metric = 'chat.session_list_compute_ms'\n  AND ts_ms BETWEEN $__from AND $__to\nORDER BY ts_ms",
          "timeColumns": ["time"],
          "refId": "A"
        }
      ],
      "title": "Session List Perf (chat.session_list_compute_ms)",
      "type": "timeseries"
    },
    {
      "datasource": {
        "type": "frser-sqlite-datasource",
        "uid": "oppi-telemetry-sqlite"
      },
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "palette-classic"
          },
          "unit": "ms",
          "custom": {
            "drawStyle": "points",
            "lineWidth": 0,
            "pointSize": 4,
            "showPoints": "always"
          }
        },
        "overrides": []
      },
      "gridPos": {
        "h": 8,
        "w": 12,
        "x": 12,
        "y": 141
      },
      "id": 35,
      "options": {
        "legend": {
          "calcs": ["lastNotNull", "max"],
          "displayMode": "table",
          "placement": "bottom"
        },
        "tooltip": {
          "mode": "multi",
          "sort": "desc"
        }
      },
      "targets": [
        {
          "datasource": {
            "type": "frser-sqlite-datasource",
            "uid": "oppi-telemetry-sqlite"
          },
          "queryType": "time series",
          "rawQueryText": "SELECT CAST(ts_ms / 1000 AS INTEGER) AS time, value\nFROM chat_metric_samples\nWHERE metric = 'chat.markdown_streaming_ms'\n  AND ts_ms BETWEEN $__from AND $__to\nORDER BY ts_ms",
          "queryText": "SELECT CAST(ts_ms / 1000 AS INTEGER) AS time, value\nFROM chat_metric_samples\nWHERE metric = 'chat.markdown_streaming_ms'\n  AND ts_ms BETWEEN $__from AND $__to\nORDER BY ts_ms",
          "timeColumns": ["time"],
          "refId": "A"
        }
      ],
      "title": "Markdown Streaming (chat.markdown_streaming_ms)",
      "type": "timeseries"
    },
    {
      "datasource": {
        "type": "frser-sqlite-datasource",
        "uid": "oppi-telemetry-sqlite"
      },
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "fixed",
            "fixedColor": "yellow"
          },
          "unit": "ms",
          "custom": {
            "drawStyle": "points",
            "lineWidth": 0,
            "pointSize": 5,
            "showPoints": "always"
          }
        },
        "overrides": [
          {
            "matcher": {
              "id": "byFrameRefID",
              "options": "A"
            },
            "properties": [
              {
                "id": "displayName",
                "value": "ask_response"
              }
            ]
          },
          {
            "matcher": {
              "id": "byFrameRefID",
              "options": "B"
            },
            "properties": [
              {
                "id": "displayName",
                "value": "media_playback_start"
              }
            ]
          },
          {
            "matcher": {
              "id": "byFrameRefID",
              "options": "C"
            },
            "properties": [
              {
                "id": "displayName",
                "value": "share_export"
              }
            ]
          }
        ]
      },
      "gridPos": {
        "h": 8,
        "w": 12,
        "x": 0,
        "y": 157
      },
      "id": 37,
      "options": {
        "legend": {
          "calcs": ["lastNotNull", "max", "count"],
          "displayMode": "table",
          "placement": "bottom"
        },
        "tooltip": {
          "mode": "multi",
          "sort": "desc"
        }
      },
      "targets": [
        {
          "datasource": {
            "type": "frser-sqlite-datasource",
            "uid": "oppi-telemetry-sqlite"
          },
          "queryType": "time series",
          "rawQueryText": "SELECT CAST(ts_ms / 1000 AS INTEGER) AS time, value\nFROM chat_metric_samples\nWHERE metric = 'chat.ask_response_ms'\n  AND ts_ms BETWEEN $__from AND $__to\nORDER BY ts_ms",
          "queryText": "SELECT CAST(ts_ms / 1000 AS INTEGER) AS time, value\nFROM chat_metric_samples\nWHERE metric = 'chat.ask_response_ms'\n  AND ts_ms BETWEEN $__from AND $__to\nORDER BY ts_ms",
          "timeColumns": ["time"],
          "refId": "A"
        },
        {
          "datasource": {
            "type": "frser-sqlite-datasource",
            "uid": "oppi-telemetry-sqlite"
          },
          "queryType": "time series",
          "rawQueryText": "SELECT CAST(ts_ms / 1000 AS INTEGER) AS time, value\nFROM chat_metric_samples\nWHERE metric = 'chat.media_playback_start_ms'\n  AND ts_ms BETWEEN $__from AND $__to\nORDER BY ts_ms",
          "queryText": "SELECT CAST(ts_ms / 1000 AS INTEGER) AS time, value\nFROM chat_metric_samples\nWHERE metric = 'chat.media_playback_start_ms'\n  AND ts_ms BETWEEN $__from AND $__to\nORDER BY ts_ms",
          "timeColumns": ["time"],
          "refId": "B"
        },
        {
          "datasource": {
            "type": "frser-sqlite-datasource",
            "uid": "oppi-telemetry-sqlite"
          },
          "queryType": "time series",
          "rawQueryText": "SELECT CAST(ts_ms / 1000 AS INTEGER) AS time, value\nFROM chat_metric_samples\nWHERE metric = 'chat.share_export_ms'\n  AND ts_ms BETWEEN $__from AND $__to\nORDER BY ts_ms",
          "queryText": "SELECT CAST(ts_ms / 1000 AS INTEGER) AS time, value\nFROM chat_metric_samples\nWHERE metric = 'chat.share_export_ms'\n  AND ts_ms BETWEEN $__from AND $__to\nORDER BY ts_ms",
          "timeColumns": ["time"],
          "refId": "C"
        }
      ],
      "title": "Attention, media, and share UX",
      "description": "User-facing interaction timings outside the main chat stream: ask-card dwell time, media playback startup, and share export render.",
      "type": "timeseries"
    },
    {
      "datasource": {
        "type": "frser-sqlite-datasource",
        "uid": "oppi-telemetry-sqlite"
      },
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "fixed",
            "fixedColor": "yellow"
          },
          "unit": "short",
          "custom": {
            "drawStyle": "points",
            "lineWidth": 0,
            "pointSize": 5,
            "showPoints": "always"
          }
        },
        "overrides": []
      },
      "gridPos": {
        "h": 8,
        "w": 12,
        "x": 0,
        "y": 165
      },
      "id": 38,
      "options": {
        "legend": {
          "calcs": ["lastNotNull", "max", "count"],
          "displayMode": "table",
          "placement": "bottom"
        },
        "tooltip": {
          "mode": "multi",
          "sort": "desc"
        }
      },
      "targets": [
        {
          "datasource": {
            "type": "frser-sqlite-datasource",
            "uid": "oppi-telemetry-sqlite"
          },
          "queryType": "time series",
          "rawQueryText": "SELECT CAST(ts_ms / 1000 AS INTEGER) AS time, value\nFROM chat_metric_samples\nWHERE metric = 'chat.session_list_body_rate'\n  AND ts_ms BETWEEN $__from AND $__to\nORDER BY ts_ms",
          "queryText": "SELECT CAST(ts_ms / 1000 AS INTEGER) AS time, value\nFROM chat_metric_samples\nWHERE metric = 'chat.session_list_body_rate'\n  AND ts_ms BETWEEN $__from AND $__to\nORDER BY ts_ms",
          "timeColumns": ["time"],
          "refId": "A"
        }
      ],
      "title": "Session List Body Rate (chat.session_list_body_rate)",
      "type": "timeseries"
    },
    {
      "datasource": {
        "type": "frser-sqlite-datasource",
        "uid": "oppi-telemetry-sqlite"
      },
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "fixed",
            "fixedColor": "yellow"
          },
          "unit": "ms",
          "custom": {
            "drawStyle": "points",
            "lineWidth": 0,
            "pointSize": 5,
            "showPoints": "always"
          }
        },
        "overrides": []
      },
      "gridPos": {
        "h": 8,
        "w": 12,
        "x": 12,
        "y": 165
      },
      "id": 39,
      "options": {
        "legend": {
          "calcs": ["lastNotNull", "max", "count"],
          "displayMode": "table",
          "placement": "bottom"
        },
        "tooltip": {
          "mode": "multi",
          "sort": "desc"
        }
      },
      "targets": [
        {
          "datasource": {
            "type": "frser-sqlite-datasource",
            "uid": "oppi-telemetry-sqlite"
          },
          "queryType": "time series",
          "rawQueryText": "SELECT CAST(ts_ms / 1000 AS INTEGER) AS time, value\nFROM chat_metric_samples\nWHERE metric = 'chat.session_list_row_compute_ms'\n  AND ts_ms BETWEEN $__from AND $__to\nORDER BY ts_ms",
          "queryText": "SELECT CAST(ts_ms / 1000 AS INTEGER) AS time, value\nFROM chat_metric_samples\nWHERE metric = 'chat.session_list_row_compute_ms'\n  AND ts_ms BETWEEN $__from AND $__to\nORDER BY ts_ms",
          "timeColumns": ["time"],
          "refId": "A"
        }
      ],
      "title": "Session List Row Compute (chat.session_list_row_compute_ms)",
      "type": "timeseries"
    },
    {
      "datasource": {
        "type": "frser-sqlite-datasource",
        "uid": "oppi-telemetry-sqlite"
      },
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "fixed",
            "fixedColor": "yellow"
          },
          "unit": "ms",
          "custom": {
            "drawStyle": "points",
            "lineWidth": 0,
            "pointSize": 5,
            "showPoints": "always"
          }
        },
        "overrides": []
      },
      "gridPos": {
        "h": 8,
        "w": 12,
        "x": 0,
        "y": 173
      },
      "id": 40,
      "options": {
        "legend": {
          "calcs": ["lastNotNull", "max", "count"],
          "displayMode": "table",
          "placement": "bottom"
        },
        "tooltip": {
          "mode": "multi",
          "sort": "desc"
        }
      },
      "targets": [
        {
          "datasource": {
            "type": "frser-sqlite-datasource",
            "uid": "oppi-telemetry-sqlite"
          },
          "queryType": "time series",
          "rawQueryText": "SELECT CAST(ts_ms / 1000 AS INTEGER) AS time, value\nFROM chat_metric_samples\nWHERE metric = 'chat.message_queue_ack_ms'\n  AND ts_ms BETWEEN $__from AND $__to\nORDER BY ts_ms",
          "queryText": "SELECT CAST(ts_ms / 1000 AS INTEGER) AS time, value\nFROM chat_metric_samples\nWHERE metric = 'chat.message_queue_ack_ms'\n  AND ts_ms BETWEEN $__from AND $__to\nORDER BY ts_ms",
          "timeColumns": ["time"],
          "refId": "A"
        }
      ],
      "title": "Message Queue Ack (chat.message_queue_ack_ms)",
      "type": "timeseries"
    },
    {
      "datasource": {
        "type": "frser-sqlite-datasource",
        "uid": "oppi-telemetry-sqlite"
      },
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "palette-classic"
          },
          "unit": "short",
          "custom": {
            "drawStyle": "points",
            "lineWidth": 0,
            "pointSize": 4,
            "showPoints": "always"
          }
        },
        "overrides": [
          {
            "matcher": {
              "id": "byFrameRefID",
              "options": "A"
            },
            "properties": [
              {
                "id": "displayName",
                "value": "stale_drop"
              },
              {
                "id": "color",
                "value": {
                  "mode": "fixed",
                  "fixedColor": "semi-dark-red"
                }
              }
            ]
          },
          {
            "matcher": {
              "id": "byFrameRefID",
              "options": "B"
            },
            "properties": [
              {
                "id": "displayName",
                "value": "start_miss"
              },
              {
                "id": "color",
                "value": {
                  "mode": "fixed",
                  "fixedColor": "semi-dark-orange"
                }
              }
            ]
          },
          {
            "matcher": {
              "id": "byFrameRefID",
              "options": "C"
            },
            "properties": [
              {
                "id": "displayName",
                "value": "app_stream_reconnect"
              }
            ]
          },
          {
            "matcher": {
              "id": "byFrameRefID",
              "options": "D"
            },
            "properties": [
              {
                "id": "displayName",
                "value": "app_stream_decode_error"
              }
            ]
          },
          {
            "matcher": {
              "id": "byFrameRefID",
              "options": "E"
            },
            "properties": [
              {
                "id": "displayName",
                "value": "media_playback_error"
              }
            ]
          }
        ]
      },
      "gridPos": {
        "h": 8,
        "w": 12,
        "x": 12,
        "y": 173
      },
      "id": 41,
      "options": {
        "legend": {
          "calcs": ["lastNotNull", "max", "count"],
          "displayMode": "table",
          "placement": "bottom"
        },
        "tooltip": {
          "mode": "multi",
          "sort": "desc"
        }
      },
      "targets": [
        {
          "datasource": {
            "type": "frser-sqlite-datasource",
            "uid": "oppi-telemetry-sqlite"
          },
          "queryType": "time series",
          "rawQueryText": "SELECT CAST(ts_ms / 1000 AS INTEGER) AS time, value\nFROM chat_metric_samples\nWHERE metric = 'chat.message_queue_stale_drop'\n  AND ts_ms BETWEEN $__from AND $__to\nORDER BY ts_ms",
          "queryText": "SELECT CAST(ts_ms / 1000 AS INTEGER) AS time, value\nFROM chat_metric_samples\nWHERE metric = 'chat.message_queue_stale_drop'\n  AND ts_ms BETWEEN $__from AND $__to\nORDER BY ts_ms",
          "timeColumns": ["time"],
          "refId": "A"
        },
        {
          "datasource": {
            "type": "frser-sqlite-datasource",
            "uid": "oppi-telemetry-sqlite"
          },
          "queryType": "time series",
          "rawQueryText": "SELECT CAST(ts_ms / 1000 AS INTEGER) AS time, value\nFROM chat_metric_samples\nWHERE metric = 'chat.message_queue_start_miss'\n  AND ts_ms BETWEEN $__from AND $__to\nORDER BY ts_ms",
          "queryText": "SELECT CAST(ts_ms / 1000 AS INTEGER) AS time, value\nFROM chat_metric_samples\nWHERE metric = 'chat.message_queue_start_miss'\n  AND ts_ms BETWEEN $__from AND $__to\nORDER BY ts_ms",
          "timeColumns": ["time"],
          "refId": "B"
        },
        {
          "datasource": {
            "type": "frser-sqlite-datasource",
            "uid": "oppi-telemetry-sqlite"
          },
          "queryType": "time series",
          "rawQueryText": "SELECT CAST(ts_ms / 1000 AS INTEGER) AS time, value\nFROM chat_metric_samples\nWHERE metric = 'chat.app_event_stream_reconnect'\n  AND ts_ms BETWEEN $__from AND $__to\nORDER BY ts_ms",
          "queryText": "SELECT CAST(ts_ms / 1000 AS INTEGER) AS time, value\nFROM chat_metric_samples\nWHERE metric = 'chat.app_event_stream_reconnect'\n  AND ts_ms BETWEEN $__from AND $__to\nORDER BY ts_ms",
          "timeColumns": ["time"],
          "refId": "C"
        },
        {
          "datasource": {
            "type": "frser-sqlite-datasource",
            "uid": "oppi-telemetry-sqlite"
          },
          "queryType": "time series",
          "rawQueryText": "SELECT CAST(ts_ms / 1000 AS INTEGER) AS time, value\nFROM chat_metric_samples\nWHERE metric = 'chat.app_event_stream_decode_error'\n  AND ts_ms BETWEEN $__from AND $__to\nORDER BY ts_ms",
          "queryText": "SELECT CAST(ts_ms / 1000 AS INTEGER) AS time, value\nFROM chat_metric_samples\nWHERE metric = 'chat.app_event_stream_decode_error'\n  AND ts_ms BETWEEN $__from AND $__to\nORDER BY ts_ms",
          "timeColumns": ["time"],
          "refId": "D"
        },
        {
          "datasource": {
            "type": "frser-sqlite-datasource",
            "uid": "oppi-telemetry-sqlite"
          },
          "queryType": "time series",
          "rawQueryText": "SELECT CAST(ts_ms / 1000 AS INTEGER) AS time, value\nFROM chat_metric_samples\nWHERE metric = 'chat.media_playback_error'\n  AND ts_ms BETWEEN $__from AND $__to\nORDER BY ts_ms",
          "queryText": "SELECT CAST(ts_ms / 1000 AS INTEGER) AS time, value\nFROM chat_metric_samples\nWHERE metric = 'chat.media_playback_error'\n  AND ts_ms BETWEEN $__from AND $__to\nORDER BY ts_ms",
          "timeColumns": ["time"],
          "refId": "E"
        }
      ],
      "title": "User-visible reliability counters",
      "description": "Counts where a user action, app stream, or media playback failed/recovered. These should trend toward zero.",
      "type": "timeseries"
    },
    {
      "datasource": {
        "type": "frser-sqlite-datasource",
        "uid": "oppi-telemetry-sqlite"
      },
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "palette-classic"
          },
          "unit": "ms",
          "custom": {
            "drawStyle": "points",
            "lineWidth": 0,
            "pointSize": 4,
            "showPoints": "always"
          }
        },
        "overrides": [
          {
            "matcher": {
              "id": "byFrameRefID",
              "options": "A"
            },
            "properties": [
              {
                "id": "displayName",
                "value": "chunk_upload_ms"
              },
              {
                "id": "color",
                "value": {
                  "mode": "fixed",
                  "fixedColor": "yellow"
                }
              }
            ]
          },
          {
            "matcher": {
              "id": "byFrameRefID",
              "options": "B"
            },
            "properties": [
              {
                "id": "displayName",
                "value": "probe_ms"
              },
              {
                "id": "color",
                "value": {
                  "mode": "fixed",
                  "fixedColor": "blue"
                }
              }
            ]
          }
        ]
      },
      "gridPos": {
        "h": 8,
        "w": 12,
        "x": 0,
        "y": 181
      },
      "id": 42,
      "options": {
        "legend": {
          "calcs": ["lastNotNull", "max", "count"],
          "displayMode": "table",
          "placement": "bottom"
        },
        "tooltip": {
          "mode": "multi",
          "sort": "desc"
        }
      },
      "targets": [
        {
          "datasource": {
            "type": "frser-sqlite-datasource",
            "uid": "oppi-telemetry-sqlite"
          },
          "queryType": "time series",
          "rawQueryText": "SELECT CAST(ts_ms / 1000 AS INTEGER) AS time, value\nFROM chat_metric_samples\nWHERE metric = 'chat.voice_remote_chunk_upload_ms'\n  AND ts_ms BETWEEN $__from AND $__to\nORDER BY ts_ms",
          "queryText": "SELECT CAST(ts_ms / 1000 AS INTEGER) AS time, value\nFROM chat_metric_samples\nWHERE metric = 'chat.voice_remote_chunk_upload_ms'\n  AND ts_ms BETWEEN $__from AND $__to\nORDER BY ts_ms",
          "timeColumns": ["time"],
          "refId": "A"
        },
        {
          "datasource": {
            "type": "frser-sqlite-datasource",
            "uid": "oppi-telemetry-sqlite"
          },
          "queryType": "time series",
          "rawQueryText": "SELECT CAST(ts_ms / 1000 AS INTEGER) AS time, value\nFROM chat_metric_samples\nWHERE metric = 'chat.voice_remote_probe_ms'\n  AND ts_ms BETWEEN $__from AND $__to\nORDER BY ts_ms",
          "queryText": "SELECT CAST(ts_ms / 1000 AS INTEGER) AS time, value\nFROM chat_metric_samples\nWHERE metric = 'chat.voice_remote_probe_ms'\n  AND ts_ms BETWEEN $__from AND $__to\nORDER BY ts_ms",
          "timeColumns": ["time"],
          "refId": "B"
        }
      ],
      "title": "Voice Remote Latency (upload + probe)",
      "type": "timeseries"
    },
    {
      "datasource": {
        "type": "frser-sqlite-datasource",
        "uid": "oppi-telemetry-sqlite"
      },
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "palette-classic"
          },
          "unit": "short",
          "custom": {
            "drawStyle": "points",
            "lineWidth": 0,
            "pointSize": 4,
            "showPoints": "always"
          }
        },
        "overrides": [
          {
            "matcher": {
              "id": "byFrameRefID",
              "options": "A"
            },
            "properties": [
              {
                "id": "displayName",
                "value": "audio_ms"
              },
              {
                "id": "color",
                "value": {
                  "mode": "fixed",
                  "fixedColor": "green"
                }
              }
            ]
          },
          {
            "matcher": {
              "id": "byFrameRefID",
              "options": "B"
            },
            "properties": [
              {
                "id": "displayName",
                "value": "bytes"
              },
              {
                "id": "color",
                "value": {
                  "mode": "fixed",
                  "fixedColor": "blue"
                }
              }
            ]
          },
          {
            "matcher": {
              "id": "byFrameRefID",
              "options": "C"
            },
            "properties": [
              {
                "id": "displayName",
                "value": "chars"
              },
              {
                "id": "color",
                "value": {
                  "mode": "fixed",
                  "fixedColor": "purple"
                }
              }
            ]
          },
          {
            "matcher": {
              "id": "byFrameRefID",
              "options": "D"
            },
            "properties": [
              {
                "id": "displayName",
                "value": "errors"
              },
              {
                "id": "color",
                "value": {
                  "mode": "fixed",
                  "fixedColor": "red"
                }
              }
            ]
          }
        ]
      },
      "gridPos": {
        "h": 8,
        "w": 12,
        "x": 12,
        "y": 181
      },
      "id": 43,
      "options": {
        "legend": {
          "calcs": ["lastNotNull", "max", "count"],
          "displayMode": "table",
          "placement": "bottom"
        },
        "tooltip": {
          "mode": "multi",
          "sort": "desc"
        }
      },
      "targets": [
        {
          "datasource": {
            "type": "frser-sqlite-datasource",
            "uid": "oppi-telemetry-sqlite"
          },
          "queryType": "time series",
          "rawQueryText": "SELECT CAST(ts_ms / 1000 AS INTEGER) AS time, value\nFROM chat_metric_samples\nWHERE metric = 'chat.voice_remote_chunk_audio_ms'\n  AND ts_ms BETWEEN $__from AND $__to\nORDER BY ts_ms",
          "queryText": "SELECT CAST(ts_ms / 1000 AS INTEGER) AS time, value\nFROM chat_metric_samples\nWHERE metric = 'chat.voice_remote_chunk_audio_ms'\n  AND ts_ms BETWEEN $__from AND $__to\nORDER BY ts_ms",
          "timeColumns": ["time"],
          "refId": "A"
        },
        {
          "datasource": {
            "type": "frser-sqlite-datasource",
            "uid": "oppi-telemetry-sqlite"
          },
          "queryType": "time series",
          "rawQueryText": "SELECT CAST(ts_ms / 1000 AS INTEGER) AS time, value\nFROM chat_metric_samples\nWHERE metric = 'chat.voice_remote_chunk_bytes'\n  AND ts_ms BETWEEN $__from AND $__to\nORDER BY ts_ms",
          "queryText": "SELECT CAST(ts_ms / 1000 AS INTEGER) AS time, value\nFROM chat_metric_samples\nWHERE metric = 'chat.voice_remote_chunk_bytes'\n  AND ts_ms BETWEEN $__from AND $__to\nORDER BY ts_ms",
          "timeColumns": ["time"],
          "refId": "B"
        },
        {
          "datasource": {
            "type": "frser-sqlite-datasource",
            "uid": "oppi-telemetry-sqlite"
          },
          "queryType": "time series",
          "rawQueryText": "SELECT CAST(ts_ms / 1000 AS INTEGER) AS time, value\nFROM chat_metric_samples\nWHERE metric = 'chat.voice_remote_chunk_chars'\n  AND ts_ms BETWEEN $__from AND $__to\nORDER BY ts_ms",
          "queryText": "SELECT CAST(ts_ms / 1000 AS INTEGER) AS time, value\nFROM chat_metric_samples\nWHERE metric = 'chat.voice_remote_chunk_chars'\n  AND ts_ms BETWEEN $__from AND $__to\nORDER BY ts_ms",
          "timeColumns": ["time"],
          "refId": "C"
        },
        {
          "datasource": {
            "type": "frser-sqlite-datasource",
            "uid": "oppi-telemetry-sqlite"
          },
          "queryType": "time series",
          "rawQueryText": "SELECT CAST(ts_ms / 1000 AS INTEGER) AS time, value\nFROM chat_metric_samples\nWHERE metric = 'chat.voice_remote_chunk_error'\n  AND ts_ms BETWEEN $__from AND $__to\nORDER BY ts_ms",
          "queryText": "SELECT CAST(ts_ms / 1000 AS INTEGER) AS time, value\nFROM chat_metric_samples\nWHERE metric = 'chat.voice_remote_chunk_error'\n  AND ts_ms BETWEEN $__from AND $__to\nORDER BY ts_ms",
          "timeColumns": ["time"],
          "refId": "D"
        }
      ],
      "title": "Voice Remote Chunk Detail",
      "type": "timeseries"
    },
    {
      "datasource": {
        "type": "frser-sqlite-datasource",
        "uid": "oppi-telemetry-sqlite"
      },
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "palette-classic"
          },
          "unit": "ms",
          "custom": {
            "drawStyle": "points",
            "lineWidth": 0,
            "pointSize": 4,
            "showPoints": "always"
          }
        },
        "overrides": [
          {
            "matcher": {
              "id": "byFrameRefID",
              "options": "A"
            },
            "properties": [
              {
                "id": "displayName",
                "value": "connected_dispatch_ms"
              },
              {
                "id": "color",
                "value": {
                  "mode": "fixed",
                  "fixedColor": "yellow"
                }
              }
            ]
          },
          {
            "matcher": {
              "id": "byFrameRefID",
              "options": "B"
            },
            "properties": [
              {
                "id": "displayName",
                "value": "subscribe_ack_ms"
              },
              {
                "id": "color",
                "value": {
                  "mode": "fixed",
                  "fixedColor": "green"
                }
              }
            ]
          },
          {
            "matcher": {
              "id": "byFrameRefID",
              "options": "C"
            },
            "properties": [
              {
                "id": "displayName",
                "value": "queue_sync_ms"
              },
              {
                "id": "color",
                "value": {
                  "mode": "fixed",
                  "fixedColor": "blue"
                }
              }
            ]
          }
        ]
      },
      "gridPos": {
        "h": 8,
        "w": 12,
        "x": 0,
        "y": 189
      },
      "id": 44,
      "options": {
        "legend": {
          "calcs": ["lastNotNull", "max", "count"],
          "displayMode": "table",
          "placement": "bottom"
        },
        "tooltip": {
          "mode": "multi",
          "sort": "desc"
        }
      },
      "targets": [
        {
          "datasource": {
            "type": "frser-sqlite-datasource",
            "uid": "oppi-telemetry-sqlite"
          },
          "queryType": "time series",
          "rawQueryText": "SELECT CAST(ts_ms / 1000 AS INTEGER) AS time, value\nFROM chat_metric_samples\nWHERE metric = 'chat.connected_dispatch_ms'\n  AND ts_ms BETWEEN $__from AND $__to\nORDER BY ts_ms",
          "queryText": "SELECT CAST(ts_ms / 1000 AS INTEGER) AS time, value\nFROM chat_metric_samples\nWHERE metric = 'chat.connected_dispatch_ms'\n  AND ts_ms BETWEEN $__from AND $__to\nORDER BY ts_ms",
          "timeColumns": ["time"],
          "refId": "A"
        },
        {
          "datasource": {
            "type": "frser-sqlite-datasource",
            "uid": "oppi-telemetry-sqlite"
          },
          "queryType": "time series",
          "rawQueryText": "SELECT CAST(ts_ms / 1000 AS INTEGER) AS time, value\nFROM chat_metric_samples\nWHERE metric = 'chat.subscribe_ack_ms'\n  AND ts_ms BETWEEN $__from AND $__to\nORDER BY ts_ms",
          "queryText": "SELECT CAST(ts_ms / 1000 AS INTEGER) AS time, value\nFROM chat_metric_samples\nWHERE metric = 'chat.subscribe_ack_ms'\n  AND ts_ms BETWEEN $__from AND $__to\nORDER BY ts_ms",
          "timeColumns": ["time"],
          "refId": "B"
        },
        {
          "datasource": {
            "type": "frser-sqlite-datasource",
            "uid": "oppi-telemetry-sqlite"
          },
          "queryType": "time series",
          "rawQueryText": "SELECT CAST(ts_ms / 1000 AS INTEGER) AS time, value\nFROM chat_metric_samples\nWHERE metric = 'chat.queue_sync_ms'\n  AND ts_ms BETWEEN $__from AND $__to\nORDER BY ts_ms",
          "queryText": "SELECT CAST(ts_ms / 1000 AS INTEGER) AS time, value\nFROM chat_metric_samples\nWHERE metric = 'chat.queue_sync_ms'\n  AND ts_ms BETWEEN $__from AND $__to\nORDER BY ts_ms",
          "timeColumns": ["time"],
          "refId": "C"
        }
      ],
      "title": "Internal Pipeline Latency (dispatch + subscribe_ack + queue_sync)",
      "type": "timeseries"
    },
    {
      "datasource": {
        "type": "frser-sqlite-datasource",
        "uid": "oppi-telemetry-sqlite"
      },
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "palette-classic"
          },
          "unit": "short",
          "custom": {
            "drawStyle": "points",
            "lineWidth": 0,
            "pointSize": 4,
            "showPoints": "always"
          }
        },
        "overrides": [
          {
            "matcher": {
              "id": "byFrameRefID",
              "options": "A"
            },
            "properties": [
              {
                "id": "displayName",
                "value": "avg_events_per_flush"
              },
              {
                "id": "color",
                "value": {
                  "mode": "fixed",
                  "fixedColor": "orange"
                }
              }
            ]
          },
          {
            "matcher": {
              "id": "byFrameRefID",
              "options": "B"
            },
            "properties": [
              {
                "id": "displayName",
                "value": "avg_kib_per_flush"
              },
              {
                "id": "color",
                "value": {
                  "mode": "fixed",
                  "fixedColor": "purple"
                }
              },
              {
                "id": "custom.axisPlacement",
                "value": "right"
              }
            ]
          },
          {
            "matcher": {
              "id": "byFrameRefID",
              "options": "C"
            },
            "properties": [
              {
                "id": "displayName",
                "value": "queue_high_water"
              },
              {
                "id": "color",
                "value": {
                  "mode": "fixed",
                  "fixedColor": "red"
                }
              }
            ]
          }
        ]
      },
      "gridPos": {
        "h": 8,
        "w": 12,
        "x": 12,
        "y": 189
      },
      "id": 45,
      "options": {
        "legend": {
          "calcs": ["lastNotNull", "mean", "max"],
          "displayMode": "table",
          "placement": "bottom"
        },
        "tooltip": {
          "mode": "multi",
          "sort": "desc"
        }
      },
      "targets": [
        {
          "datasource": {
            "type": "frser-sqlite-datasource",
            "uid": "oppi-telemetry-sqlite"
          },
          "queryType": "time series",
          "rawQueryText": "SELECT CAST(ts_ms / 1000 AS INTEGER) AS time,\n       ROUND(value / MAX(1, CAST(COALESCE(json_extract(tags_json, '$.flushes'), 1) AS REAL)), 2) AS value\nFROM chat_metric_samples\nWHERE metric = 'chat.coalescer_flush_events'\n  AND ts_ms BETWEEN $__from AND $__to\nORDER BY ts_ms",
          "queryText": "SELECT CAST(ts_ms / 1000 AS INTEGER) AS time,\n       ROUND(value / MAX(1, CAST(COALESCE(json_extract(tags_json, '$.flushes'), 1) AS REAL)), 2) AS value\nFROM chat_metric_samples\nWHERE metric = 'chat.coalescer_flush_events'\n  AND ts_ms BETWEEN $__from AND $__to\nORDER BY ts_ms",
          "timeColumns": ["time"],
          "refId": "A"
        },
        {
          "datasource": {
            "type": "frser-sqlite-datasource",
            "uid": "oppi-telemetry-sqlite"
          },
          "queryType": "time series",
          "rawQueryText": "SELECT CAST(ts_ms / 1000 AS INTEGER) AS time,\n       ROUND((value / MAX(1, CAST(COALESCE(json_extract(tags_json, '$.flushes'), 1) AS REAL))) / 1024.0, 2) AS value\nFROM chat_metric_samples\nWHERE metric = 'chat.coalescer_flush_bytes'\n  AND ts_ms BETWEEN $__from AND $__to\nORDER BY ts_ms",
          "queryText": "SELECT CAST(ts_ms / 1000 AS INTEGER) AS time,\n       ROUND((value / MAX(1, CAST(COALESCE(json_extract(tags_json, '$.flushes'), 1) AS REAL))) / 1024.0, 2) AS value\nFROM chat_metric_samples\nWHERE metric = 'chat.coalescer_flush_bytes'\n  AND ts_ms BETWEEN $__from AND $__to\nORDER BY ts_ms",
          "timeColumns": ["time"],
          "refId": "B"
        },
        {
          "datasource": {
            "type": "frser-sqlite-datasource",
            "uid": "oppi-telemetry-sqlite"
          },
          "queryType": "time series",
          "rawQueryText": "SELECT CAST(ts_ms / 1000 AS INTEGER) AS time, value\nFROM chat_metric_samples\nWHERE metric = 'chat.inbound_queue_depth'\n  AND ts_ms BETWEEN $__from AND $__to\nORDER BY ts_ms",
          "queryText": "SELECT CAST(ts_ms / 1000 AS INTEGER) AS time, value\nFROM chat_metric_samples\nWHERE metric = 'chat.inbound_queue_depth'\n  AND ts_ms BETWEEN $__from AND $__to\nORDER BY ts_ms",
          "timeColumns": ["time"],
          "refId": "C"
        }
      ],
      "title": "Coalescer Load + Queue High-Water",
      "description": "Coalescer metrics are emitted as ~1s windows (`tags.flushes` is usually about 30), so this panel normalizes them back to per-flush averages. `queue_high_water` is not a live queue gauge; it only records when a session reaches a new max.",
      "type": "timeseries"
    },
    {
      "id": 51,
      "type": "timeseries",
      "title": "UX Responsiveness Trend",
      "description": "Daily average UX responsiveness score. This excludes full agent turn duration; long turns are tracked as workload/progress.",
      "gridPos": {
        "h": 8,
        "w": 12,
        "x": 0,
        "y": 197
      },
      "datasource": {
        "type": "frser-sqlite-datasource",
        "uid": "oppi-telemetry-sqlite"
      },
      "targets": [
        {
          "refId": "A",
          "queryType": "table",
          "rawQueryText": "WITH session_stats AS (\n  SELECT\n    session_id,\n    MIN(ts_ms) as first_ts,\n    AVG(CASE WHEN metric='chat.jank_pct' THEN value END) as jank,\n    AVG(CASE WHEN metric='chat.fresh_content_lag_ms' THEN value END) as lag,\n    SUM(CASE WHEN metric='chat.message_queue_stale_drop' THEN value ELSE 0 END) as drops,\n    SUM(CASE WHEN metric IN ('chat.message_queue_start_miss', 'chat.media_playback_error') THEN value ELSE 0 END) as failures,\n    AVG(CASE WHEN metric='chat.message_queue_ack_ms' THEN value END) as ack,\n    CAST(COUNT(CASE WHEN metric='chat.timeline_apply_ms' AND value > 50 THEN 1 END) AS REAL) /\n      MAX(1, COUNT(CASE WHEN metric='chat.timeline_apply_ms' THEN 1 END)) * 100 as hitch_pct,\n    COUNT(CASE WHEN metric='chat.catchup_ring_miss' AND value > 0 THEN 1 END) as ring_misses,\n    COUNT(CASE WHEN metric='chat.ttft_ms' THEN 1 END) as turns\n  FROM chat_metric_samples\n  WHERE session_id IS NOT NULL AND session_id != ''\n    AND ts_ms BETWEEN $__from AND $__to\n  GROUP BY session_id\n  HAVING turns >= 3\n),\nscored AS (\n  SELECT\n    first_ts / 1000 as ts,\n    100.0\n  - MIN(25, MAX(0, (COALESCE(jank, 0) - 5) * 25.0 / 25))\n  - MIN(15, MAX(0, (hitch_pct - 2) * 15.0 / 13))\n  - MIN(20, MAX(0, (COALESCE(lag, 1000) - 300) * 20.0 / 2700))\n  - MIN(10, MAX(0, (COALESCE(ack, 300) - 300) * 10.0 / 1700))\n  - MIN(25, drops * 5.0)\n  - MIN(15, failures * 5.0)\n  - MIN(5, ring_misses * 5.0) as score\n  FROM session_stats\n)\nSELECT ts as time, ROUND(score, 0) as quality_score\nFROM scored\nORDER BY ts"
        }
      ],
      "fieldConfig": {
        "defaults": {
          "unit": "none",
          "min": 0,
          "max": 100,
          "custom": {
            "drawStyle": "points",
            "pointSize": 6,
            "lineInterpolation": "linear",
            "showPoints": "always",
            "fillOpacity": 0,
            "lineWidth": 0
          },
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "red",
                "value": null
              },
              {
                "color": "orange",
                "value": 60
              },
              {
                "color": "yellow",
                "value": 70
              },
              {
                "color": "#73BF69",
                "value": 80
              },
              {
                "color": "green",
                "value": 90
              }
            ]
          },
          "color": {
            "mode": "thresholds"
          }
        },
        "overrides": []
      },
      "options": {
        "tooltip": {
          "mode": "single"
        },
        "legend": {
          "displayMode": "hidden"
        }
      }
    },
    {
      "id": 52,
      "type": "table",
      "title": "UX Responsiveness Breakdown",
      "description": "Per-session responsiveness breakdown. Worst sessions first. Long agent work duration is intentionally not part of this score.",
      "gridPos": {
        "h": 8,
        "w": 12,
        "x": 12,
        "y": 197
      },
      "datasource": {
        "type": "frser-sqlite-datasource",
        "uid": "oppi-telemetry-sqlite"
      },
      "targets": [
        {
          "refId": "A",
          "queryType": "table",
          "rawQueryText": "WITH session_stats AS (\n  SELECT\n    session_id,\n    MIN(ts_ms) as first_ts,\n    AVG(CASE WHEN metric='chat.jank_pct' THEN value END) as jank,\n    AVG(CASE WHEN metric='chat.fresh_content_lag_ms' THEN value END) as lag,\n    SUM(CASE WHEN metric='chat.message_queue_stale_drop' THEN value ELSE 0 END) as drops,\n    SUM(CASE WHEN metric IN ('chat.message_queue_start_miss', 'chat.media_playback_error') THEN value ELSE 0 END) as failures,\n    AVG(CASE WHEN metric='chat.message_queue_ack_ms' THEN value END) as ack,\n    CAST(COUNT(CASE WHEN metric='chat.timeline_apply_ms' AND value > 50 THEN 1 END) AS REAL) /\n      MAX(1, COUNT(CASE WHEN metric='chat.timeline_apply_ms' THEN 1 END)) * 100 as hitch_pct,\n    COUNT(CASE WHEN metric='chat.catchup_ring_miss' AND value > 0 THEN 1 END) as ring_misses,\n    COUNT(CASE WHEN metric='chat.ttft_ms' THEN 1 END) as turns\n  FROM chat_metric_samples\n  WHERE session_id IS NOT NULL AND session_id != ''\n    AND ts_ms BETWEEN $__from AND $__to\n  GROUP BY session_id\n  HAVING turns >= 3\n)\nSELECT\n  session_id,\n  turns,\n  ROUND(COALESCE(jank, 0), 1) as jank_pct,\n  ROUND(hitch_pct, 1) as hitch_pct,\n  ROUND(COALESCE(lag, 1000)) as lag_ms,\n  ROUND(COALESCE(ack, 300)) as ack_ms,\n  drops as stale_drops,\n  failures,\n  ROUND(100.0\n  - MIN(25, MAX(0, (COALESCE(jank, 0) - 5) * 25.0 / 25))\n  - MIN(15, MAX(0, (hitch_pct - 2) * 15.0 / 13))\n  - MIN(20, MAX(0, (COALESCE(lag, 1000) - 300) * 20.0 / 2700))\n  - MIN(10, MAX(0, (COALESCE(ack, 300) - 300) * 10.0 / 1700))\n  - MIN(25, drops * 5.0)\n  - MIN(15, failures * 5.0)\n  - MIN(5, ring_misses * 5.0), 0) as score\nFROM session_stats\nORDER BY score ASC\nLIMIT 20"
        }
      ],
      "fieldConfig": {
        "defaults": {},
        "overrides": [
          {
            "matcher": {
              "id": "byName",
              "options": "score"
            },
            "properties": [
              {
                "id": "thresholds",
                "value": {
                  "mode": "absolute",
                  "steps": [
                    {
                      "color": "red",
                      "value": null
                    },
                    {
                      "color": "orange",
                      "value": 60
                    },
                    {
                      "color": "yellow",
                      "value": 70
                    },
                    {
                      "color": "#73BF69",
                      "value": 80
                    },
                    {
                      "color": "green",
                      "value": 90
                    }
                  ]
                }
              },
              {
                "id": "custom.cellOptions",
                "value": {
                  "type": "color-background",
                  "mode": "basic"
                }
              }
            ]
          }
        ]
      },
      "options": {
        "showHeader": true,
        "sortBy": [
          {
            "displayName": "score",
            "desc": false
          }
        ]
      }
    },
    {
      "id": 60,
      "type": "row",
      "title": "MetricKit (device-level)",
      "collapsed": false,
      "gridPos": {
        "h": 1,
        "w": 24,
        "x": 0,
        "y": 205
      },
      "panels": []
    },
    {
      "id": 61,
      "type": "barchart",
      "title": "Crashes and Hangs (MetricKit diagnostics)",
      "description": "Daily count of crash and hang diagnostic payloads reported by MetricKit.",
      "gridPos": {
        "h": 8,
        "w": 12,
        "x": 0,
        "y": 206
      },
      "datasource": {
        "type": "frser-sqlite-datasource",
        "uid": "oppi-telemetry-sqlite"
      },
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "palette-classic"
          },
          "unit": "short"
        },
        "overrides": [
          {
            "matcher": {
              "id": "byName",
              "options": "crashes"
            },
            "properties": [
              {
                "id": "color",
                "value": {
                  "mode": "fixed",
                  "fixedColor": "red"
                }
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "hangs"
            },
            "properties": [
              {
                "id": "color",
                "value": {
                  "mode": "fixed",
                  "fixedColor": "orange"
                }
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "cpu_exceptions"
            },
            "properties": [
              {
                "id": "color",
                "value": {
                  "mode": "fixed",
                  "fixedColor": "yellow"
                }
              }
            ]
          }
        ]
      },
      "options": {
        "orientation": "auto",
        "barWidth": 0.8,
        "groupWidth": 0.7,
        "stacking": "normal",
        "legend": {
          "displayMode": "list",
          "placement": "bottom"
        },
        "tooltip": {
          "mode": "multi",
          "sort": "desc"
        },
        "xTickLabelRotation": 0,
        "showValue": "auto"
      },
      "targets": [
        {
          "datasource": {
            "type": "frser-sqlite-datasource",
            "uid": "oppi-telemetry-sqlite"
          },
          "queryType": "table",
          "rawQueryText": "SELECT\n  date(window_start_ms/1000, 'unixepoch', 'localtime') as day,\n  SUM(CASE WHEN summary_json LIKE '%crashDiag%' THEN 1 ELSE 0 END) as crashes,\n  SUM(CASE WHEN summary_json LIKE '%hangDiag%' THEN 1 ELSE 0 END) as hangs,\n  SUM(CASE WHEN summary_json LIKE '%cpuException%' THEN 1 ELSE 0 END) as cpu_exceptions\nFROM metrickit_payloads\nWHERE kind = 'diagnostic'\n  AND window_start_ms BETWEEN $__from AND $__to\nGROUP BY day\nORDER BY day",
          "timeColumns": [],
          "refId": "A"
        }
      ]
    },
    {
      "id": 62,
      "type": "timeseries",
      "title": "App Responsiveness (MetricKit hang histogram buckets)",
      "description": "Number of hang diagnostic events per day from MetricKit. Includes crash, hang, and CPU exception categories.",
      "gridPos": {
        "h": 8,
        "w": 12,
        "x": 12,
        "y": 206
      },
      "datasource": {
        "type": "frser-sqlite-datasource",
        "uid": "oppi-telemetry-sqlite"
      },
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "palette-classic"
          },
          "unit": "short",
          "custom": {
            "drawStyle": "bars",
            "lineWidth": 0,
            "fillOpacity": 80,
            "stacking": {
              "mode": "normal"
            }
          }
        },
        "overrides": []
      },
      "options": {
        "legend": {
          "calcs": ["sum", "max"],
          "displayMode": "table",
          "placement": "bottom"
        },
        "tooltip": {
          "mode": "multi",
          "sort": "desc"
        }
      },
      "targets": [
        {
          "datasource": {
            "type": "frser-sqlite-datasource",
            "uid": "oppi-telemetry-sqlite"
          },
          "queryType": "time series",
          "rawQueryText": "SELECT\n  CAST(window_end_ms / 1000 AS INTEGER) AS time,\n  COUNT(*) as value\nFROM metrickit_payloads\nWHERE kind = 'diagnostic'\n  AND window_start_ms BETWEEN $__from AND $__to\nGROUP BY date(window_start_ms/1000, 'unixepoch', 'localtime')\nORDER BY time",
          "timeColumns": ["time"],
          "refId": "A"
        }
      ]
    },
    {
      "id": 63,
      "type": "timeseries",
      "title": "CPU and GPU Time (MetricKit daily)",
      "description": "Cumulative CPU and GPU time per 24-hour MetricKit reporting window.",
      "gridPos": {
        "h": 8,
        "w": 12,
        "x": 0,
        "y": 214
      },
      "datasource": {
        "type": "frser-sqlite-datasource",
        "uid": "oppi-telemetry-sqlite"
      },
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "palette-classic"
          },
          "unit": "s",
          "custom": {
            "drawStyle": "line",
            "lineWidth": 2,
            "pointSize": 5,
            "showPoints": "always",
            "fillOpacity": 10
          }
        },
        "overrides": [
          {
            "matcher": {
              "id": "byFrameRefID",
              "options": "A"
            },
            "properties": [
              {
                "id": "displayName",
                "value": "CPU Time"
              },
              {
                "id": "color",
                "value": {
                  "mode": "fixed",
                  "fixedColor": "blue"
                }
              }
            ]
          },
          {
            "matcher": {
              "id": "byFrameRefID",
              "options": "B"
            },
            "properties": [
              {
                "id": "displayName",
                "value": "GPU Time"
              },
              {
                "id": "color",
                "value": {
                  "mode": "fixed",
                  "fixedColor": "green"
                }
              }
            ]
          }
        ]
      },
      "options": {
        "legend": {
          "calcs": ["lastNotNull", "max"],
          "displayMode": "table",
          "placement": "bottom"
        },
        "tooltip": {
          "mode": "multi",
          "sort": "desc"
        }
      },
      "targets": [
        {
          "datasource": {
            "type": "frser-sqlite-datasource",
            "uid": "oppi-telemetry-sqlite"
          },
          "queryType": "time series",
          "rawQueryText": "SELECT\n  CAST(window_end_ms / 1000 AS INTEGER) AS time,\n  CAST(REPLACE(json_extract(json_extract(summary_json, '$.cpuMetrics'), '$.cumulativeCPUTime'), ' sec', '') AS REAL) as value\nFROM metrickit_payloads\nWHERE kind = 'metric'\n  AND summary_json LIKE '%cpuMetrics%'\n  AND window_start_ms BETWEEN $__from AND $__to\nORDER BY time",
          "timeColumns": ["time"],
          "refId": "A"
        },
        {
          "datasource": {
            "type": "frser-sqlite-datasource",
            "uid": "oppi-telemetry-sqlite"
          },
          "queryType": "time series",
          "rawQueryText": "SELECT\n  CAST(window_end_ms / 1000 AS INTEGER) AS time,\n  CAST(REPLACE(json_extract(json_extract(summary_json, '$.gpuMetrics'), '$.cumulativeGPUTime'), ' sec', '') AS REAL) as value\nFROM metrickit_payloads\nWHERE kind = 'metric'\n  AND summary_json LIKE '%gpuMetrics%'\n  AND window_start_ms BETWEEN $__from AND $__to\nORDER BY time",
          "timeColumns": ["time"],
          "refId": "B"
        }
      ]
    },
    {
      "id": 64,
      "type": "timeseries",
      "title": "Peak Memory Usage (MetricKit daily)",
      "description": "Peak memory usage reported by MetricKit per 24-hour window. Extracted from raw payload to avoid summary truncation.",
      "gridPos": {
        "h": 8,
        "w": 12,
        "x": 12,
        "y": 214
      },
      "datasource": {
        "type": "frser-sqlite-datasource",
        "uid": "oppi-telemetry-sqlite"
      },
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "fixed",
            "fixedColor": "purple"
          },
          "unit": "decmbytes",
          "custom": {
            "drawStyle": "line",
            "lineWidth": 2,
            "pointSize": 5,
            "showPoints": "always",
            "fillOpacity": 10
          }
        },
        "overrides": []
      },
      "options": {
        "legend": {
          "calcs": ["lastNotNull", "max"],
          "displayMode": "table",
          "placement": "bottom"
        },
        "tooltip": {
          "mode": "single",
          "sort": "none"
        }
      },
      "targets": [
        {
          "datasource": {
            "type": "frser-sqlite-datasource",
            "uid": "oppi-telemetry-sqlite"
          },
          "queryType": "time series",
          "rawQueryText": "SELECT\n  CAST(window_end_ms / 1000 AS INTEGER) AS time,\n  CAST(REPLACE(json_extract(json_extract(raw_json, '$.payload'), '$.memoryMetrics.peakMemoryUsage'), ' kB', '') AS REAL) / 1024.0 as value\nFROM metrickit_payloads\nWHERE kind = 'metric'\n  AND raw_json != '{}'\n  AND json_extract(json_extract(raw_json, '$.payload'), '$.memoryMetrics.peakMemoryUsage') IS NOT NULL\n  AND window_start_ms BETWEEN $__from AND $__to\nORDER BY time",
          "timeColumns": ["time"],
          "refId": "A"
        }
      ]
    },
    {
      "id": 65,
      "type": "timeseries",
      "title": "Network Transfer (MetricKit daily)",
      "description": "Cumulative WiFi and cellular download/upload per 24-hour MetricKit window.",
      "gridPos": {
        "h": 8,
        "w": 12,
        "x": 0,
        "y": 222
      },
      "datasource": {
        "type": "frser-sqlite-datasource",
        "uid": "oppi-telemetry-sqlite"
      },
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "palette-classic"
          },
          "unit": "decmbytes",
          "custom": {
            "drawStyle": "line",
            "lineWidth": 2,
            "pointSize": 5,
            "showPoints": "always",
            "fillOpacity": 10
          }
        },
        "overrides": [
          {
            "matcher": {
              "id": "byFrameRefID",
              "options": "A"
            },
            "properties": [
              {
                "id": "displayName",
                "value": "WiFi Down"
              },
              {
                "id": "color",
                "value": {
                  "mode": "fixed",
                  "fixedColor": "blue"
                }
              }
            ]
          },
          {
            "matcher": {
              "id": "byFrameRefID",
              "options": "B"
            },
            "properties": [
              {
                "id": "displayName",
                "value": "WiFi Up"
              },
              {
                "id": "color",
                "value": {
                  "mode": "fixed",
                  "fixedColor": "light-blue"
                }
              }
            ]
          },
          {
            "matcher": {
              "id": "byFrameRefID",
              "options": "C"
            },
            "properties": [
              {
                "id": "displayName",
                "value": "Cellular Down"
              },
              {
                "id": "color",
                "value": {
                  "mode": "fixed",
                  "fixedColor": "orange"
                }
              }
            ]
          },
          {
            "matcher": {
              "id": "byFrameRefID",
              "options": "D"
            },
            "properties": [
              {
                "id": "displayName",
                "value": "Cellular Up"
              },
              {
                "id": "color",
                "value": {
                  "mode": "fixed",
                  "fixedColor": "yellow"
                }
              }
            ]
          }
        ]
      },
      "options": {
        "legend": {
          "calcs": ["lastNotNull", "max"],
          "displayMode": "table",
          "placement": "bottom"
        },
        "tooltip": {
          "mode": "multi",
          "sort": "desc"
        }
      },
      "targets": [
        {
          "datasource": {
            "type": "frser-sqlite-datasource",
            "uid": "oppi-telemetry-sqlite"
          },
          "queryType": "time series",
          "rawQueryText": "SELECT\n  CAST(window_end_ms / 1000 AS INTEGER) AS time,\n  CAST(REPLACE(json_extract(json_extract(raw_json, '$.payload'), '$.networkTransferMetrics.cumulativeWifiDownload'), ' kB', '') AS REAL) / 1024.0 as value\nFROM metrickit_payloads\nWHERE kind = 'metric' AND raw_json != '{}'\n  AND json_extract(json_extract(raw_json, '$.payload'), '$.networkTransferMetrics.cumulativeWifiDownload') IS NOT NULL\n  AND window_start_ms BETWEEN $__from AND $__to\nORDER BY time",
          "timeColumns": ["time"],
          "refId": "A"
        },
        {
          "datasource": {
            "type": "frser-sqlite-datasource",
            "uid": "oppi-telemetry-sqlite"
          },
          "queryType": "time series",
          "rawQueryText": "SELECT\n  CAST(window_end_ms / 1000 AS INTEGER) AS time,\n  CAST(REPLACE(json_extract(json_extract(raw_json, '$.payload'), '$.networkTransferMetrics.cumulativeWifiUpload'), ' kB', '') AS REAL) / 1024.0 as value\nFROM metrickit_payloads\nWHERE kind = 'metric' AND raw_json != '{}'\n  AND json_extract(json_extract(raw_json, '$.payload'), '$.networkTransferMetrics.cumulativeWifiUpload') IS NOT NULL\n  AND window_start_ms BETWEEN $__from AND $__to\nORDER BY time",
          "timeColumns": ["time"],
          "refId": "B"
        },
        {
          "datasource": {
            "type": "frser-sqlite-datasource",
            "uid": "oppi-telemetry-sqlite"
          },
          "queryType": "time series",
          "rawQueryText": "SELECT\n  CAST(window_end_ms / 1000 AS INTEGER) AS time,\n  CAST(REPLACE(json_extract(json_extract(raw_json, '$.payload'), '$.networkTransferMetrics.cumulativeCellularDownload'), ' kB', '') AS REAL) / 1024.0 as value\nFROM metrickit_payloads\nWHERE kind = 'metric' AND raw_json != '{}'\n  AND json_extract(json_extract(raw_json, '$.payload'), '$.networkTransferMetrics.cumulativeCellularDownload') IS NOT NULL\n  AND window_start_ms BETWEEN $__from AND $__to\nORDER BY time",
          "timeColumns": ["time"],
          "refId": "C"
        },
        {
          "datasource": {
            "type": "frser-sqlite-datasource",
            "uid": "oppi-telemetry-sqlite"
          },
          "queryType": "time series",
          "rawQueryText": "SELECT\n  CAST(window_end_ms / 1000 AS INTEGER) AS time,\n  CAST(REPLACE(json_extract(json_extract(raw_json, '$.payload'), '$.networkTransferMetrics.cumulativeCellularUpload'), ' kB', '') AS REAL) / 1024.0 as value\nFROM metrickit_payloads\nWHERE kind = 'metric' AND raw_json != '{}'\n  AND json_extract(json_extract(raw_json, '$.payload'), '$.networkTransferMetrics.cumulativeCellularUpload') IS NOT NULL\n  AND window_start_ms BETWEEN $__from AND $__to\nORDER BY time",
          "timeColumns": ["time"],
          "refId": "D"
        }
      ]
    },
    {
      "id": 66,
      "type": "timeseries",
      "title": "Disk I/O and Storage (MetricKit daily)",
      "description": "Cumulative logical writes and total disk space used per 24-hour MetricKit window.",
      "gridPos": {
        "h": 8,
        "w": 12,
        "x": 12,
        "y": 222
      },
      "datasource": {
        "type": "frser-sqlite-datasource",
        "uid": "oppi-telemetry-sqlite"
      },
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "palette-classic"
          },
          "unit": "decmbytes",
          "custom": {
            "drawStyle": "line",
            "lineWidth": 2,
            "pointSize": 5,
            "showPoints": "always",
            "fillOpacity": 10
          }
        },
        "overrides": [
          {
            "matcher": {
              "id": "byFrameRefID",
              "options": "A"
            },
            "properties": [
              {
                "id": "displayName",
                "value": "Logical Writes"
              },
              {
                "id": "color",
                "value": {
                  "mode": "fixed",
                  "fixedColor": "orange"
                }
              }
            ]
          },
          {
            "matcher": {
              "id": "byFrameRefID",
              "options": "B"
            },
            "properties": [
              {
                "id": "displayName",
                "value": "App Data Size"
              },
              {
                "id": "color",
                "value": {
                  "mode": "fixed",
                  "fixedColor": "blue"
                }
              }
            ]
          }
        ]
      },
      "options": {
        "legend": {
          "calcs": ["lastNotNull", "max"],
          "displayMode": "table",
          "placement": "bottom"
        },
        "tooltip": {
          "mode": "multi",
          "sort": "desc"
        }
      },
      "targets": [
        {
          "datasource": {
            "type": "frser-sqlite-datasource",
            "uid": "oppi-telemetry-sqlite"
          },
          "queryType": "time series",
          "rawQueryText": "SELECT\n  CAST(window_end_ms / 1000 AS INTEGER) AS time,\n  CAST(REPLACE(json_extract(json_extract(raw_json, '$.payload'), '$.diskIOMetrics.cumulativeLogicalWrites'), ' kB', '') AS REAL) / 1024.0 as value\nFROM metrickit_payloads\nWHERE kind = 'metric' AND raw_json != '{}'\n  AND json_extract(json_extract(raw_json, '$.payload'), '$.diskIOMetrics.cumulativeLogicalWrites') IS NOT NULL\n  AND window_start_ms BETWEEN $__from AND $__to\nORDER BY time",
          "timeColumns": ["time"],
          "refId": "A"
        },
        {
          "datasource": {
            "type": "frser-sqlite-datasource",
            "uid": "oppi-telemetry-sqlite"
          },
          "queryType": "time series",
          "rawQueryText": "SELECT\n  CAST(window_end_ms / 1000 AS INTEGER) AS time,\n  CAST(REPLACE(json_extract(json_extract(raw_json, '$.payload'), '$.diskSpaceUsageMetrics.totalDataFileSize'), ' kB', '') AS REAL) / 1024.0 as value\nFROM metrickit_payloads\nWHERE kind = 'metric' AND raw_json != '{}'\n  AND json_extract(json_extract(raw_json, '$.payload'), '$.diskSpaceUsageMetrics.totalDataFileSize') IS NOT NULL\n  AND window_start_ms BETWEEN $__from AND $__to\nORDER BY time",
          "timeColumns": ["time"],
          "refId": "B"
        }
      ]
    },
    {
      "id": 67,
      "type": "timeseries",
      "title": "App Launch Time (MetricKit daily)",
      "description": "Cumulative foreground and background time per 24-hour MetricKit window.",
      "gridPos": {
        "h": 8,
        "w": 12,
        "x": 0,
        "y": 230
      },
      "datasource": {
        "type": "frser-sqlite-datasource",
        "uid": "oppi-telemetry-sqlite"
      },
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "palette-classic"
          },
          "unit": "s",
          "custom": {
            "drawStyle": "line",
            "lineWidth": 2,
            "pointSize": 5,
            "showPoints": "always",
            "fillOpacity": 10
          }
        },
        "overrides": [
          {
            "matcher": {
              "id": "byFrameRefID",
              "options": "A"
            },
            "properties": [
              {
                "id": "displayName",
                "value": "Foreground"
              },
              {
                "id": "color",
                "value": {
                  "mode": "fixed",
                  "fixedColor": "green"
                }
              }
            ]
          },
          {
            "matcher": {
              "id": "byFrameRefID",
              "options": "B"
            },
            "properties": [
              {
                "id": "displayName",
                "value": "Background"
              },
              {
                "id": "color",
                "value": {
                  "mode": "fixed",
                  "fixedColor": "semi-dark-blue"
                }
              }
            ]
          }
        ]
      },
      "options": {
        "legend": {
          "calcs": ["lastNotNull", "max"],
          "displayMode": "table",
          "placement": "bottom"
        },
        "tooltip": {
          "mode": "multi",
          "sort": "desc"
        }
      },
      "targets": [
        {
          "datasource": {
            "type": "frser-sqlite-datasource",
            "uid": "oppi-telemetry-sqlite"
          },
          "queryType": "time series",
          "rawQueryText": "SELECT\n  CAST(window_end_ms / 1000 AS INTEGER) AS time,\n  CAST(REPLACE(json_extract(json_extract(raw_json, '$.payload'), '$.applicationTimeMetrics.cumulativeForegroundTime'), ' sec', '') AS REAL) as value\nFROM metrickit_payloads\nWHERE kind = 'metric' AND raw_json != '{}'\n  AND json_extract(json_extract(raw_json, '$.payload'), '$.applicationTimeMetrics.cumulativeForegroundTime') IS NOT NULL\n  AND window_start_ms BETWEEN $__from AND $__to\nORDER BY time",
          "timeColumns": ["time"],
          "refId": "A"
        },
        {
          "datasource": {
            "type": "frser-sqlite-datasource",
            "uid": "oppi-telemetry-sqlite"
          },
          "queryType": "time series",
          "rawQueryText": "SELECT\n  CAST(window_end_ms / 1000 AS INTEGER) AS time,\n  CAST(REPLACE(json_extract(json_extract(raw_json, '$.payload'), '$.applicationTimeMetrics.cumulativeBackgroundTime'), ' sec', '') AS REAL) as value\nFROM metrickit_payloads\nWHERE kind = 'metric' AND raw_json != '{}'\n  AND json_extract(json_extract(raw_json, '$.payload'), '$.applicationTimeMetrics.cumulativeBackgroundTime') IS NOT NULL\n  AND window_start_ms BETWEEN $__from AND $__to\nORDER BY time",
          "timeColumns": ["time"],
          "refId": "B"
        }
      ]
    },
    {
      "id": 68,
      "type": "table",
      "title": "MetricKit Payload Log",
      "description": "Raw log of all MetricKit payloads received. Shows payload type, build, window range, and key summary fields.",
      "gridPos": {
        "h": 8,
        "w": 24,
        "x": 0,
        "y": 238
      },
      "datasource": {
        "type": "frser-sqlite-datasource",
        "uid": "oppi-telemetry-sqlite"
      },
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "thresholds"
          },
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              }
            ]
          }
        },
        "overrides": []
      },
      "options": {
        "showHeader": true,
        "sortBy": [
          {
            "displayName": "received",
            "desc": true
          }
        ]
      },
      "targets": [
        {
          "datasource": {
            "type": "frser-sqlite-datasource",
            "uid": "oppi-telemetry-sqlite"
          },
          "queryType": "table",
          "rawQueryText": "SELECT\n  datetime(received_at_ms/1000, 'unixepoch', 'localtime') as received,\n  kind,\n  build_number as build,\n  app_version as version,\n  datetime(window_start_ms/1000, 'unixepoch', 'localtime') as window_start,\n  datetime(window_end_ms/1000, 'unixepoch', 'localtime') as window_end,\n  CASE\n    WHEN kind = 'diagnostic' AND summary_json LIKE '%crashDiag%' THEN 'crash'\n    WHEN kind = 'diagnostic' AND summary_json LIKE '%hangDiag%' THEN 'hang'\n    WHEN kind = 'diagnostic' AND summary_json LIKE '%cpuException%' THEN 'cpu_exception'\n    WHEN kind = 'metric' AND summary_json LIKE '%cpuMetrics%' THEN 'full_daily'\n    WHEN kind = 'metric' THEN 'disk_snapshot'\n    ELSE kind\n  END as payload_type\nFROM metrickit_payloads\nWHERE window_start_ms BETWEEN $__from AND $__to\n   OR received_at_ms BETWEEN $__from AND $__to\nORDER BY received_at_ms DESC\nLIMIT 100",
          "timeColumns": [],
          "refId": "A"
        }
      ]
    },
    {
      "id": 69,
      "type": "row",
      "title": "Device Resources (10s samples)",
      "gridPos": {
        "h": 1,
        "w": 24,
        "x": 0,
        "y": 246
      },
      "collapsed": false,
      "panels": []
    },
    {
      "id": 70,
      "type": "timeseries",
      "title": "CPU Usage % (device.cpu_pct)",
      "gridPos": {
        "h": 8,
        "w": 12,
        "x": 0,
        "y": 247
      },
      "datasource": {
        "type": "frser-sqlite-datasource",
        "uid": "oppi-telemetry-sqlite"
      },
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "palette-classic"
          },
          "unit": "percent",
          "custom": {
            "drawStyle": "line",
            "lineWidth": 1,
            "fillOpacity": 15,
            "pointSize": 3,
            "showPoints": "auto",
            "spanNulls": true
          }
        },
        "overrides": []
      },
      "options": {
        "legend": {
          "calcs": ["mean", "max"],
          "displayMode": "table",
          "placement": "bottom"
        },
        "tooltip": {
          "mode": "multi",
          "sort": "desc"
        }
      },
      "targets": [
        {
          "datasource": {
            "type": "frser-sqlite-datasource",
            "uid": "oppi-telemetry-sqlite"
          },
          "queryType": "time series",
          "rawQueryText": "SELECT CAST(ts_ms / 1000 AS INTEGER) AS time, value\nFROM chat_metric_samples\nWHERE metric = 'device.cpu_pct'\n  AND ts_ms BETWEEN $__from AND $__to\nORDER BY ts_ms",
          "timeColumns": ["time"],
          "refId": "A"
        }
      ]
    },
    {
      "id": 71,
      "type": "timeseries",
      "title": "Memory Footprint MB (device.memory_mb)",
      "gridPos": {
        "h": 8,
        "w": 12,
        "x": 12,
        "y": 247
      },
      "datasource": {
        "type": "frser-sqlite-datasource",
        "uid": "oppi-telemetry-sqlite"
      },
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "palette-classic"
          },
          "unit": "decmbytes",
          "custom": {
            "drawStyle": "line",
            "lineWidth": 1,
            "fillOpacity": 15,
            "pointSize": 3,
            "showPoints": "auto",
            "spanNulls": true
          }
        },
        "overrides": []
      },
      "options": {
        "legend": {
          "calcs": ["mean", "max"],
          "displayMode": "table",
          "placement": "bottom"
        },
        "tooltip": {
          "mode": "multi",
          "sort": "desc"
        }
      },
      "targets": [
        {
          "datasource": {
            "type": "frser-sqlite-datasource",
            "uid": "oppi-telemetry-sqlite"
          },
          "queryType": "time series",
          "rawQueryText": "SELECT CAST(ts_ms / 1000 AS INTEGER) AS time, value\nFROM chat_metric_samples\nWHERE metric = 'device.memory_mb'\n  AND ts_ms BETWEEN $__from AND $__to\nORDER BY ts_ms",
          "timeColumns": ["time"],
          "refId": "A"
        }
      ]
    },
    {
      "id": 72,
      "type": "timeseries",
      "title": "Available Memory MB (device.memory_available_mb)",
      "gridPos": {
        "h": 8,
        "w": 12,
        "x": 0,
        "y": 255
      },
      "datasource": {
        "type": "frser-sqlite-datasource",
        "uid": "oppi-telemetry-sqlite"
      },
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "palette-classic"
          },
          "unit": "decmbytes",
          "custom": {
            "drawStyle": "line",
            "lineWidth": 1,
            "fillOpacity": 15,
            "pointSize": 3,
            "showPoints": "auto",
            "spanNulls": true
          }
        },
        "overrides": []
      },
      "options": {
        "legend": {
          "calcs": ["mean", "max"],
          "displayMode": "table",
          "placement": "bottom"
        },
        "tooltip": {
          "mode": "multi",
          "sort": "desc"
        }
      },
      "targets": [
        {
          "datasource": {
            "type": "frser-sqlite-datasource",
            "uid": "oppi-telemetry-sqlite"
          },
          "queryType": "time series",
          "rawQueryText": "SELECT CAST(ts_ms / 1000 AS INTEGER) AS time, value\nFROM chat_metric_samples\nWHERE metric = 'device.memory_available_mb'\n  AND ts_ms BETWEEN $__from AND $__to\nORDER BY ts_ms",
          "timeColumns": ["time"],
          "refId": "A"
        }
      ]
    },
    {
      "id": 73,
      "type": "timeseries",
      "title": "Thermal State (device.thermal_state)",
      "gridPos": {
        "h": 8,
        "w": 12,
        "x": 12,
        "y": 255
      },
      "datasource": {
        "type": "frser-sqlite-datasource",
        "uid": "oppi-telemetry-sqlite"
      },
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "palette-classic"
          },
          "unit": "none",
          "custom": {
            "drawStyle": "points",
            "lineWidth": 1,
            "fillOpacity": 15,
            "pointSize": 3,
            "showPoints": "auto",
            "spanNulls": true
          }
        },
        "overrides": []
      },
      "options": {
        "legend": {
          "calcs": ["mean", "max"],
          "displayMode": "table",
          "placement": "bottom"
        },
        "tooltip": {
          "mode": "multi",
          "sort": "desc"
        }
      },
      "targets": [
        {
          "datasource": {
            "type": "frser-sqlite-datasource",
            "uid": "oppi-telemetry-sqlite"
          },
          "queryType": "time series",
          "rawQueryText": "SELECT CAST(ts_ms / 1000 AS INTEGER) AS time, value\nFROM chat_metric_samples\nWHERE metric = 'device.thermal_state'\n  AND ts_ms BETWEEN $__from AND $__to\nORDER BY ts_ms",
          "timeColumns": ["time"],
          "refId": "A"
        }
      ]
    },
    {
      "title": "Split Stream Server Lanes",
      "description": "Release preflight: confirm split session/audio lanes have traffic and no untagged WebSocket lane is carrying the client flow.",
      "type": "table",
      "datasource": {
        "uid": "oppi-telemetry-sqlite",
        "type": "frser-sqlite-datasource"
      },
      "gridPos": {
        "h": 8,
        "w": 12,
        "x": 0,
        "y": 263
      },
      "fieldConfig": {
        "defaults": {
          "custom": {
            "align": "auto",
            "cellOptions": {
              "type": "auto"
            }
          }
        },
        "overrides": []
      },
      "targets": [
        {
          "rawQueryText": "SELECT\n  COALESCE(tag_path, 'untagged_ws') AS path,\n  metric,\n  COALESCE(tag_type, '-') AS message_type,\n  COUNT(*) AS samples,\n  ROUND(SUM(value), 1) AS total\nFROM server_ops_metric_samples\nWHERE metric IN ('server.ws_handshake_ms', 'server.ws_message_sent', 'server.ws_message_received', 'server.ws_binary_received_bytes')\n  AND ts_ms BETWEEN $__from AND $__to\nGROUP BY path, metric, message_type\nORDER BY path, metric, samples DESC",
          "queryType": "table",
          "timeColumns": []
        }
      ],
      "options": {
        "showHeader": true,
        "cellHeight": "sm"
      }
    },
    {
      "title": "Split Stream Close Codes",
      "description": "Release preflight: close-code distribution by stream lane.",
      "type": "table",
      "datasource": {
        "uid": "oppi-telemetry-sqlite",
        "type": "frser-sqlite-datasource"
      },
      "gridPos": {
        "h": 8,
        "w": 12,
        "x": 12,
        "y": 263
      },
      "fieldConfig": {
        "defaults": {
          "custom": {
            "align": "auto",
            "cellOptions": {
              "type": "auto"
            }
          }
        },
        "overrides": []
      },
      "targets": [
        {
          "rawQueryText": "SELECT\n  COALESCE(tag_path, 'untagged_ws') AS path,\n  COALESCE(tag_code, 'unknown') AS close_code,\n  SUM(value) AS closes,\n  datetime(MAX(ts_ms) / 1000, 'unixepoch', 'localtime') AS last_seen\nFROM server_ops_metric_samples\nWHERE metric = 'server.ws_close_code'\n  AND ts_ms BETWEEN $__from AND $__to\nGROUP BY path, close_code\nORDER BY closes DESC, path, close_code",
          "queryType": "table",
          "timeColumns": []
        }
      ],
      "options": {
        "showHeader": true,
        "cellHeight": "sm"
      }
    }
  ],
  "refresh": "30s",
  "schemaVersion": 39,
  "style": "dark",
  "tags": ["oppi", "telemetry", "release"],
  "templating": {
    "list": []
  },
  "time": {
    "from": "now-24h",
    "to": "now"
  },
  "timepicker": {},
  "timezone": "browser",
  "title": "Oppi Release Preflight",
  "uid": "oppi-release-preflight",
  "version": 10,
  "weekStart": ""
}
