{
 "uid": "speedtest-isp",
 "title": "Internet - Cloudflare vs Personal",
 "tags": [
  "speedtest",
  "internet"
 ],
 "timezone": "browser",
 "schemaVersion": 39,
 "version": 1,
 "refresh": "1m",
 "graphTooltip": 1,
 "time": {
  "from": "now-24h",
  "to": "now"
 },
 "annotations": {
  "list": []
 },
 "templating": {
  "list": [
   {
    "type": "datasource",
    "name": "ds",
    "label": "Datasource",
    "query": "prometheus",
    "current": {},
    "hide": 0,
    "refresh": 1,
    "regex": ""
   }
  ]
 },
 "panels": [
  {
   "id": 1,
   "type": "gauge",
   "title": "Cloudflare - Bajada",
   "datasource": {
    "type": "prometheus",
    "uid": "${ds}"
   },
   "gridPos": {
    "x": 0,
    "y": 0,
    "w": 6,
    "h": 7
   },
   "targets": [
    {
     "datasource": {
      "type": "prometheus",
      "uid": "${ds}"
     },
     "expr": "avg(last_over_time(speedtest_download_mbps{provider=\"cloudflare\"}[6h]))",
     "legendFormat": "Cloudflare - Bajada",
     "instant": true,
     "range": false,
     "refId": "A"
    }
   ],
   "fieldConfig": {
    "defaults": {
     "unit": "Mbits",
     "decimals": 0,
     "min": 0,
     "max": 300,
     "color": {
      "mode": "fixed",
      "fixedColor": "#F6821F"
     }
    },
    "overrides": []
   },
   "options": {
    "reduceOptions": {
     "calcs": [
      "lastNotNull"
     ],
     "fields": "",
     "values": false
    },
    "showThresholdMarkers": false,
    "showThresholdLabels": false,
    "orientation": "auto"
   }
  },
  {
   "id": 2,
   "type": "gauge",
   "title": "Cloudflare - Subida",
   "datasource": {
    "type": "prometheus",
    "uid": "${ds}"
   },
   "gridPos": {
    "x": 6,
    "y": 0,
    "w": 6,
    "h": 7
   },
   "targets": [
    {
     "datasource": {
      "type": "prometheus",
      "uid": "${ds}"
     },
     "expr": "avg(last_over_time(speedtest_upload_mbps{provider=\"cloudflare\"}[6h]))",
     "legendFormat": "Cloudflare - Subida",
     "instant": true,
     "range": false,
     "refId": "A"
    }
   ],
   "fieldConfig": {
    "defaults": {
     "unit": "Mbits",
     "decimals": 0,
     "min": 0,
     "max": 300,
     "color": {
      "mode": "fixed",
      "fixedColor": "#F6821F"
     }
    },
    "overrides": []
   },
   "options": {
    "reduceOptions": {
     "calcs": [
      "lastNotNull"
     ],
     "fields": "",
     "values": false
    },
    "showThresholdMarkers": false,
    "showThresholdLabels": false,
    "orientation": "auto"
   }
  },
  {
   "id": 3,
   "type": "gauge",
   "title": "Personal - Bajada",
   "datasource": {
    "type": "prometheus",
    "uid": "${ds}"
   },
   "gridPos": {
    "x": 12,
    "y": 0,
    "w": 6,
    "h": 7
   },
   "targets": [
    {
     "datasource": {
      "type": "prometheus",
      "uid": "${ds}"
     },
     "expr": "avg(last_over_time(speedtest_download_mbps{provider=\"personal\"}[6h]))",
     "legendFormat": "Personal - Bajada",
     "instant": true,
     "range": false,
     "refId": "A"
    }
   ],
   "fieldConfig": {
    "defaults": {
     "unit": "Mbits",
     "decimals": 0,
     "min": 0,
     "max": 300,
     "color": {
      "mode": "fixed",
      "fixedColor": "#22D3EE"
     }
    },
    "overrides": []
   },
   "options": {
    "reduceOptions": {
     "calcs": [
      "lastNotNull"
     ],
     "fields": "",
     "values": false
    },
    "showThresholdMarkers": false,
    "showThresholdLabels": false,
    "orientation": "auto"
   }
  },
  {
   "id": 4,
   "type": "gauge",
   "title": "Personal - Subida",
   "datasource": {
    "type": "prometheus",
    "uid": "${ds}"
   },
   "gridPos": {
    "x": 18,
    "y": 0,
    "w": 6,
    "h": 7
   },
   "targets": [
    {
     "datasource": {
      "type": "prometheus",
      "uid": "${ds}"
     },
     "expr": "avg(last_over_time(speedtest_upload_mbps{provider=\"personal\"}[6h]))",
     "legendFormat": "Personal - Subida",
     "instant": true,
     "range": false,
     "refId": "A"
    }
   ],
   "fieldConfig": {
    "defaults": {
     "unit": "Mbits",
     "decimals": 0,
     "min": 0,
     "max": 300,
     "color": {
      "mode": "fixed",
      "fixedColor": "#22D3EE"
     }
    },
    "overrides": []
   },
   "options": {
    "reduceOptions": {
     "calcs": [
      "lastNotNull"
     ],
     "fields": "",
     "values": false
    },
    "showThresholdMarkers": false,
    "showThresholdLabels": false,
    "orientation": "auto"
   }
  },
  {
   "id": 5,
   "type": "timeseries",
   "title": "Bajada",
   "datasource": {
    "type": "prometheus",
    "uid": "${ds}"
   },
   "gridPos": {
    "x": 0,
    "y": 7,
    "w": 12,
    "h": 9
   },
   "targets": [
    {
     "datasource": {
      "type": "prometheus",
      "uid": "${ds}"
     },
     "expr": "avg(speedtest_download_mbps{provider=\"cloudflare\"})",
     "legendFormat": "Cloudflare",
     "refId": "A"
    },
    {
     "datasource": {
      "type": "prometheus",
      "uid": "${ds}"
     },
     "expr": "avg(speedtest_download_mbps{provider=\"personal\"})",
     "legendFormat": "Personal",
     "refId": "B"
    }
   ],
   "fieldConfig": {
    "defaults": {
     "unit": "Mbits",
     "min": 0,
     "decimals": 1,
     "color": {
      "mode": "fixed",
      "fixedColor": "#888888"
     },
     "custom": {
      "lineWidth": 2,
      "fillOpacity": 18,
      "gradientMode": "opacity",
      "lineInterpolation": "smooth",
      "showPoints": "auto",
      "pointSize": 5,
      "spanNulls": true
     }
    },
    "overrides": [
     {
      "matcher": {
       "id": "byName",
       "options": "Cloudflare"
      },
      "properties": [
       {
        "id": "color",
        "value": {
         "mode": "fixed",
         "fixedColor": "#F6821F"
        }
       }
      ]
     },
     {
      "matcher": {
       "id": "byName",
       "options": "Personal"
      },
      "properties": [
       {
        "id": "color",
        "value": {
         "mode": "fixed",
         "fixedColor": "#22D3EE"
        }
       }
      ]
     }
    ]
   },
   "options": {
    "legend": {
     "showLegend": true,
     "displayMode": "table",
     "placement": "bottom",
     "calcs": [
      "mean",
      "min",
      "max",
      "lastNotNull"
     ]
    },
    "tooltip": {
     "mode": "multi",
     "sort": "desc"
    }
   }
  },
  {
   "id": 6,
   "type": "timeseries",
   "title": "Subida",
   "datasource": {
    "type": "prometheus",
    "uid": "${ds}"
   },
   "gridPos": {
    "x": 12,
    "y": 7,
    "w": 12,
    "h": 9
   },
   "targets": [
    {
     "datasource": {
      "type": "prometheus",
      "uid": "${ds}"
     },
     "expr": "avg(speedtest_upload_mbps{provider=\"cloudflare\"})",
     "legendFormat": "Cloudflare",
     "refId": "A"
    },
    {
     "datasource": {
      "type": "prometheus",
      "uid": "${ds}"
     },
     "expr": "avg(speedtest_upload_mbps{provider=\"personal\"})",
     "legendFormat": "Personal",
     "refId": "B"
    }
   ],
   "fieldConfig": {
    "defaults": {
     "unit": "Mbits",
     "min": 0,
     "decimals": 1,
     "color": {
      "mode": "fixed",
      "fixedColor": "#888888"
     },
     "custom": {
      "lineWidth": 2,
      "fillOpacity": 18,
      "gradientMode": "opacity",
      "lineInterpolation": "smooth",
      "showPoints": "auto",
      "pointSize": 5,
      "spanNulls": true
     }
    },
    "overrides": [
     {
      "matcher": {
       "id": "byName",
       "options": "Cloudflare"
      },
      "properties": [
       {
        "id": "color",
        "value": {
         "mode": "fixed",
         "fixedColor": "#F6821F"
        }
       }
      ]
     },
     {
      "matcher": {
       "id": "byName",
       "options": "Personal"
      },
      "properties": [
       {
        "id": "color",
        "value": {
         "mode": "fixed",
         "fixedColor": "#22D3EE"
        }
       }
      ]
     }
    ]
   },
   "options": {
    "legend": {
     "showLegend": true,
     "displayMode": "table",
     "placement": "bottom",
     "calcs": [
      "mean",
      "min",
      "max",
      "lastNotNull"
     ]
    },
    "tooltip": {
     "mode": "multi",
     "sort": "desc"
    }
   }
  },
  {
   "id": 7,
   "type": "timeseries",
   "title": "Latencia (ping)",
   "datasource": {
    "type": "prometheus",
    "uid": "${ds}"
   },
   "gridPos": {
    "x": 0,
    "y": 16,
    "w": 12,
    "h": 8
   },
   "targets": [
    {
     "datasource": {
      "type": "prometheus",
      "uid": "${ds}"
     },
     "expr": "avg(speedtest_ping_ms{provider=\"cloudflare\"})",
     "legendFormat": "Cloudflare",
     "refId": "A"
    },
    {
     "datasource": {
      "type": "prometheus",
      "uid": "${ds}"
     },
     "expr": "avg(speedtest_ping_ms{provider=\"personal\"})",
     "legendFormat": "Personal",
     "refId": "B"
    }
   ],
   "fieldConfig": {
    "defaults": {
     "unit": "ms",
     "min": 0,
     "decimals": 1,
     "color": {
      "mode": "fixed",
      "fixedColor": "#888888"
     },
     "custom": {
      "lineWidth": 2,
      "fillOpacity": 18,
      "gradientMode": "opacity",
      "lineInterpolation": "smooth",
      "showPoints": "auto",
      "pointSize": 5,
      "spanNulls": true
     }
    },
    "overrides": [
     {
      "matcher": {
       "id": "byName",
       "options": "Cloudflare"
      },
      "properties": [
       {
        "id": "color",
        "value": {
         "mode": "fixed",
         "fixedColor": "#F6821F"
        }
       }
      ]
     },
     {
      "matcher": {
       "id": "byName",
       "options": "Personal"
      },
      "properties": [
       {
        "id": "color",
        "value": {
         "mode": "fixed",
         "fixedColor": "#22D3EE"
        }
       }
      ]
     }
    ]
   },
   "options": {
    "legend": {
     "showLegend": true,
     "displayMode": "table",
     "placement": "bottom",
     "calcs": [
      "mean",
      "min",
      "max",
      "lastNotNull"
     ]
    },
    "tooltip": {
     "mode": "multi",
     "sort": "desc"
    }
   }
  },
  {
   "id": 8,
   "type": "timeseries",
   "title": "Jitter",
   "datasource": {
    "type": "prometheus",
    "uid": "${ds}"
   },
   "gridPos": {
    "x": 12,
    "y": 16,
    "w": 12,
    "h": 8
   },
   "targets": [
    {
     "datasource": {
      "type": "prometheus",
      "uid": "${ds}"
     },
     "expr": "avg(speedtest_jitter_ms{provider=\"cloudflare\"})",
     "legendFormat": "Cloudflare",
     "refId": "A"
    },
    {
     "datasource": {
      "type": "prometheus",
      "uid": "${ds}"
     },
     "expr": "avg(speedtest_jitter_ms{provider=\"personal\"})",
     "legendFormat": "Personal",
     "refId": "B"
    }
   ],
   "fieldConfig": {
    "defaults": {
     "unit": "ms",
     "min": 0,
     "decimals": 1,
     "color": {
      "mode": "fixed",
      "fixedColor": "#888888"
     },
     "custom": {
      "lineWidth": 2,
      "fillOpacity": 18,
      "gradientMode": "opacity",
      "lineInterpolation": "smooth",
      "showPoints": "auto",
      "pointSize": 5,
      "spanNulls": true
     }
    },
    "overrides": [
     {
      "matcher": {
       "id": "byName",
       "options": "Cloudflare"
      },
      "properties": [
       {
        "id": "color",
        "value": {
         "mode": "fixed",
         "fixedColor": "#F6821F"
        }
       }
      ]
     },
     {
      "matcher": {
       "id": "byName",
       "options": "Personal"
      },
      "properties": [
       {
        "id": "color",
        "value": {
         "mode": "fixed",
         "fixedColor": "#22D3EE"
        }
       }
      ]
     }
    ]
   },
   "options": {
    "legend": {
     "showLegend": true,
     "displayMode": "table",
     "placement": "bottom",
     "calcs": [
      "mean",
      "min",
      "max",
      "lastNotNull"
     ]
    },
    "tooltip": {
     "mode": "multi",
     "sort": "desc"
    }
   }
  },
  {
   "id": 10,
   "type": "bargauge",
   "title": "Bajada promedio del periodo",
   "datasource": {
    "type": "prometheus",
    "uid": "${ds}"
   },
   "gridPos": {
    "x": 0,
    "y": 24,
    "w": 8,
    "h": 6
   },
   "targets": [
    {
     "datasource": {
      "type": "prometheus",
      "uid": "${ds}"
     },
     "expr": "avg(avg_over_time(speedtest_download_mbps{provider=\"cloudflare\"}[$__range]))",
     "legendFormat": "Cloudflare",
     "refId": "A",
     "instant": true,
     "range": false
    },
    {
     "datasource": {
      "type": "prometheus",
      "uid": "${ds}"
     },
     "expr": "avg(avg_over_time(speedtest_download_mbps{provider=\"personal\"}[$__range]))",
     "legendFormat": "Personal",
     "refId": "B",
     "instant": true,
     "range": false
    }
   ],
   "fieldConfig": {
    "defaults": {
     "unit": "Mbits",
     "min": 0,
     "decimals": 1,
     "color": {
      "mode": "fixed",
      "fixedColor": "#888888"
     }
    },
    "overrides": [
     {
      "matcher": {
       "id": "byName",
       "options": "Cloudflare"
      },
      "properties": [
       {
        "id": "color",
        "value": {
         "mode": "fixed",
         "fixedColor": "#F6821F"
        }
       }
      ]
     },
     {
      "matcher": {
       "id": "byName",
       "options": "Personal"
      },
      "properties": [
       {
        "id": "color",
        "value": {
         "mode": "fixed",
         "fixedColor": "#22D3EE"
        }
       }
      ]
     }
    ]
   },
   "options": {
    "reduceOptions": {
     "calcs": [
      "lastNotNull"
     ],
     "fields": "",
     "values": false
    },
    "orientation": "horizontal",
    "displayMode": "gradient",
    "showUnfilled": true,
    "valueMode": "color",
    "namePlacement": "top"
   }
  },
  {
   "id": 11,
   "type": "bargauge",
   "title": "Subida promedio del periodo",
   "datasource": {
    "type": "prometheus",
    "uid": "${ds}"
   },
   "gridPos": {
    "x": 8,
    "y": 24,
    "w": 8,
    "h": 6
   },
   "targets": [
    {
     "datasource": {
      "type": "prometheus",
      "uid": "${ds}"
     },
     "expr": "avg(avg_over_time(speedtest_upload_mbps{provider=\"cloudflare\"}[$__range]))",
     "legendFormat": "Cloudflare",
     "refId": "A",
     "instant": true,
     "range": false
    },
    {
     "datasource": {
      "type": "prometheus",
      "uid": "${ds}"
     },
     "expr": "avg(avg_over_time(speedtest_upload_mbps{provider=\"personal\"}[$__range]))",
     "legendFormat": "Personal",
     "refId": "B",
     "instant": true,
     "range": false
    }
   ],
   "fieldConfig": {
    "defaults": {
     "unit": "Mbits",
     "min": 0,
     "decimals": 1,
     "color": {
      "mode": "fixed",
      "fixedColor": "#888888"
     }
    },
    "overrides": [
     {
      "matcher": {
       "id": "byName",
       "options": "Cloudflare"
      },
      "properties": [
       {
        "id": "color",
        "value": {
         "mode": "fixed",
         "fixedColor": "#F6821F"
        }
       }
      ]
     },
     {
      "matcher": {
       "id": "byName",
       "options": "Personal"
      },
      "properties": [
       {
        "id": "color",
        "value": {
         "mode": "fixed",
         "fixedColor": "#22D3EE"
        }
       }
      ]
     }
    ]
   },
   "options": {
    "reduceOptions": {
     "calcs": [
      "lastNotNull"
     ],
     "fields": "",
     "values": false
    },
    "orientation": "horizontal",
    "displayMode": "gradient",
    "showUnfilled": true,
    "valueMode": "color",
    "namePlacement": "top"
   }
  },
  {
   "id": 12,
   "type": "stat",
   "title": "Disponibilidad",
   "datasource": {
    "type": "prometheus",
    "uid": "${ds}"
   },
   "gridPos": {
    "x": 16,
    "y": 24,
    "w": 8,
    "h": 6
   },
   "targets": [
    {
     "datasource": {
      "type": "prometheus",
      "uid": "${ds}"
     },
     "expr": "avg(avg_over_time(speedtest_ok{provider=\"cloudflare\"}[$__range]) * 100)",
     "legendFormat": "Cloudflare",
     "refId": "A",
     "instant": true,
     "range": false
    },
    {
     "datasource": {
      "type": "prometheus",
      "uid": "${ds}"
     },
     "expr": "avg(avg_over_time(speedtest_ok{provider=\"personal\"}[$__range]) * 100)",
     "legendFormat": "Personal",
     "refId": "B",
     "instant": true,
     "range": false
    }
   ],
   "fieldConfig": {
    "defaults": {
     "unit": "percent",
     "decimals": 1,
     "color": {
      "mode": "fixed",
      "fixedColor": "#888888"
     }
    },
    "overrides": [
     {
      "matcher": {
       "id": "byName",
       "options": "Cloudflare"
      },
      "properties": [
       {
        "id": "color",
        "value": {
         "mode": "fixed",
         "fixedColor": "#F6821F"
        }
       }
      ]
     },
     {
      "matcher": {
       "id": "byName",
       "options": "Personal"
      },
      "properties": [
       {
        "id": "color",
        "value": {
         "mode": "fixed",
         "fixedColor": "#22D3EE"
        }
       }
      ]
     }
    ]
   },
   "options": {
    "reduceOptions": {
     "calcs": [
      "lastNotNull"
     ],
     "fields": "",
     "values": false
    },
    "colorMode": "value",
    "graphMode": "area",
    "textMode": "value_and_name",
    "justifyMode": "center",
    "orientation": "vertical"
   }
  },
  {
   "id": 9,
   "type": "state-timeline",
   "title": "Disponibilidad de las mediciones (OK / FALLA)",
   "datasource": {
    "type": "prometheus",
    "uid": "${ds}"
   },
   "gridPos": {
    "x": 0,
    "y": 30,
    "w": 24,
    "h": 5
   },
   "targets": [
    {
     "datasource": {
      "type": "prometheus",
      "uid": "${ds}"
     },
     "expr": "avg(speedtest_ok{provider=\"cloudflare\"})",
     "legendFormat": "Cloudflare",
     "refId": "A"
    },
    {
     "datasource": {
      "type": "prometheus",
      "uid": "${ds}"
     },
     "expr": "avg(speedtest_ok{provider=\"personal\"})",
     "legendFormat": "Personal",
     "refId": "B"
    }
   ],
   "fieldConfig": {
    "defaults": {
     "color": {
      "mode": "thresholds"
     },
     "thresholds": {
      "mode": "absolute",
      "steps": [
       {
        "color": "red",
        "value": null
       },
       {
        "color": "green",
        "value": 1
       }
      ]
     },
     "mappings": [
      {
       "type": "value",
       "options": {
        "1": {
         "text": "OK",
         "color": "green",
         "index": 0
        },
        "0": {
         "text": "FALLA",
         "color": "red",
         "index": 1
        }
       }
      }
     ]
    },
    "overrides": []
   },
   "options": {
    "mergeValues": true,
    "showValue": "never",
    "rowHeight": 0.8,
    "alignValue": "left",
    "legend": {
     "showLegend": false
    }
   }
  }
 ]
}