Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save vanderhoop/bb55aade662981cc16a19b1f7f9ee7b1 to your computer and use it in GitHub Desktop.

Select an option

Save vanderhoop/bb55aade662981cc16a19b1f7f9ee7b1 to your computer and use it in GitHub Desktop.

Revisions

  1. vanderhoop revised this gist Jun 1, 2022. No changes.
  2. vanderhoop renamed this gist Jun 1, 2022. 1 changed file with 0 additions and 0 deletions.
  3. vanderhoop created this gist Jun 1, 2022.
    109 changes: 109 additions & 0 deletions core_web_vitals_plus_custom_metric_example.json
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,109 @@
    {
    "viz": "timeseries",
    "requests": [
    {
    "style": {
    "palette": "dog_classic",
    "type": "solid",
    "width": "thick"
    },
    "type": "line",
    "formulas": [
    {
    "alias": "LCP",
    "formula": "ewma_3(query0)"
    },
    {
    "alias": "FCP",
    "formula": "ewma_3(query1)"
    }
    ],
    "response_format": "timeseries",
    "queries": [
    {
    "search": {
    "query": "@type:view @view.url_path_group:\"/retros/?\""
    },
    "data_source": "rum",
    "compute": {
    "metric": "@view.largest_contentful_paint",
    "interval": 14400000,
    "aggregation": "pc75"
    },
    "name": "query0",
    "indexes": [
    "*"
    ],
    "group_by": []
    },
    {
    "search": {
    "query": "@type:view @view.url_path_group:\"/retros/?\""
    },
    "data_source": "rum",
    "compute": {
    "metric": "@view.first_contentful_paint",
    "interval": 14400000,
    "aggregation": "pc75"
    },
    "name": "query1",
    "indexes": [
    "*"
    ],
    "group_by": []
    }
    ]
    },
    {
    "style": {
    "palette": "dog_classic",
    "type": "solid",
    "width": "normal"
    },
    "type": "line",
    "formulas": [
    {
    "alias": "Load Abandonment Percentage",
    "formula": "(ewma_3(query0) / ewma_3(query1)) * 100"
    }
    ],
    "response_format": "timeseries",
    "on_right_yaxis": true,
    "queries": [
    {
    "search": {
    "query": "view @view.url_path_group:\"/retros/?\" @action.name:\"Load Abandoned\""
    },
    "data_source": "rum",
    "compute": {
    "interval": 14400000,
    "aggregation": "count"
    },
    "name": "query0",
    "indexes": [
    "*"
    ],
    "group_by": []
    },
    {
    "search": {
    "query": "@view.url_path_group:\"/retros/?\" @type:view"
    },
    "data_source": "rum",
    "compute": {
    "interval": 14400000,
    "aggregation": "count"
    },
    "name": "query1",
    "indexes": [
    "*"
    ],
    "group_by": []
    }
    ]
    }
    ],
    "yaxis": {
    "include_zero": false
    }
    }