{
  "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": "Session Quality",
      "description": "Composite score (0-100) across smoothness, content delivery, and reliability. Excludes TTFT (provider-bound). Based on sessions with 3+ turns.",
      "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    COUNT(CASE WHEN metric='chat.message_queue_stale_drop' THEN 1 END) as drops,\n    AVG(CASE WHEN metric='chat.subscribe_ack_ms' THEN value END) as sub_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(sub_ack, 500) - 200) * 10.0 / 1800))\n  - MIN(25, drops * 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",
      "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": "none",
          "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": "TTFT (chat.ttft_ms, raw 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": 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_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.ws_connect_ms'\n  AND ts_ms BETWEEN $__from AND $__to\nORDER BY ts_ms",
          "timeColumns": [
            "time"
          ],
          "refId": "A"
        }
      ],
      "title": "WS connect (chat.ws_connect_ms, raw 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": [
          {
            "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": [
          {
            "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": "full_reload_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": 60
      },
      "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.full_reload_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.full_reload_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": 68
      },
      "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": 76
      },
      "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": "Session usage by provider/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": []
      },
      "gridPos": {
        "h": 8,
        "w": 12,
        "x": 0,
        "y": 85
      },
      "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": 85
      },
      "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": 93
      },
      "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": 93
      },
      "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": 101
      },
      "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": 101
      },
      "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": 109
      },
      "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": 109
      },
      "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": "palette-classic"
          },
          "unit": "ms",
          "custom": {
            "drawStyle": "points",
            "lineWidth": 0,
            "pointSize": 5,
            "showPoints": "always"
          }
        },
        "overrides": []
      },
      "gridPos": {
        "h": 8,
        "w": 12,
        "x": 0,
        "y": 117
      },
      "id": 36,
      "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.permission_overlay_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.permission_overlay_ms'\n  AND ts_ms BETWEEN $__from AND $__to\nORDER BY ts_ms",
          "timeColumns": [
            "time"
          ],
          "refId": "A"
        }
      ],
      "title": "Permission Overlay (chat.permission_overlay_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": 125
      },
      "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.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": "A"
        }
      ],
      "title": "Share Export Render (chat.share_export_ms)",
      "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": 133
      },
      "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": 133
      },
      "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": 141
      },
      "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"
                }
              }
            ]
          }
        ]
      },
      "gridPos": {
        "h": 8,
        "w": 12,
        "x": 12,
        "y": 141
      },
      "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"
        }
      ],
      "title": "Message Queue Drops (stale_drop + start_miss)",
      "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": 149
      },
      "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": 149
      },
      "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": 157
      },
      "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": "flush_events"
              },
              {
                "id": "color",
                "value": {
                  "mode": "fixed",
                  "fixedColor": "orange"
                }
              }
            ]
          },
          {
            "matcher": {
              "id": "byFrameRefID",
              "options": "B"
            },
            "properties": [
              {
                "id": "displayName",
                "value": "flush_bytes"
              },
              {
                "id": "color",
                "value": {
                  "mode": "fixed",
                  "fixedColor": "purple"
                }
              }
            ]
          },
          {
            "matcher": {
              "id": "byFrameRefID",
              "options": "C"
            },
            "properties": [
              {
                "id": "displayName",
                "value": "inbound_queue_depth"
              },
              {
                "id": "color",
                "value": {
                  "mode": "fixed",
                  "fixedColor": "red"
                }
              }
            ]
          }
        ]
      },
      "gridPos": {
        "h": 8,
        "w": 12,
        "x": 12,
        "y": 157
      },
      "id": 45,
      "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.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, 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, 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, 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 + Queue Depth",
      "type": "timeseries"
    },
    {
      "id": 51,
      "type": "timeseries",
      "title": "Session Quality Trend",
      "description": "Daily average session quality score with session count.",
      "gridPos": {
        "h": 8,
        "w": 12,
        "x": 0,
        "y": 165
      },
      "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    COUNT(CASE WHEN metric='chat.message_queue_stale_drop' THEN 1 END) as drops,\n    AVG(CASE WHEN metric='chat.subscribe_ack_ms' THEN value END) as sub_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(sub_ack, 500) - 200) * 10.0 / 1800))\n  - MIN(25, drops * 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": "Session Quality Breakdown",
      "description": "Per-session quality breakdown. Worst sessions first. Shows which dimension dragged the score down.",
      "gridPos": {
        "h": 8,
        "w": 12,
        "x": 12,
        "y": 165
      },
      "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    COUNT(CASE WHEN metric='chat.message_queue_stale_drop' THEN 1 END) as drops,\n    AVG(CASE WHEN metric='chat.subscribe_ack_ms' THEN value END) as sub_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(sub_ack, 500)) as sub_ack_ms,\n  drops as stale_drops,\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(sub_ack, 500) - 200) * 10.0 / 1800))\n  - MIN(25, drops * 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": 173 },
      "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": 174 },
      "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": 174 },
      "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": 182 },
      "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": 182 },
      "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": 190 },
      "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": 190 },
      "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": 198 },
      "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": 206 },
      "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"
        }
      ]
    }
  ],
  "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": 8,
  "weekStart": ""
}
