Grafana dashboard: Speedtest MongoDB
Description: Visualize speedtest-cli (by Ookla) data in MongoDB

Data is collected through speedtest-cli by Ookla (<https://www.speedtest.net/it/apps/cli>). 

You can refer to the application published at <https://github.com/ajeje93/speedtest-to-mongodb> for more info about how data is retrieved and stored on MongoDB.

Visit <https://github.com/JamesOsgood/mongodb-grafana> for the MongoDB datasource plugin. Visiting <https://github.com/ajeje93/grafana-mongodb-docker> you can find a container with Grafana and the MongoDB datasource plugin already installed.

Icons made by [Freepik](http://www.freepik.com/ "Freepik") from [Flaticon](https://www.flaticon.com/ "Flaticon").

{
  "__inputs": [
    {
      "name": "DS_MONGODB",
      "label": "MongoDB",
      "description": "",
      "type": "datasource",
      "pluginId": "grafana-mongodb-opensource-datasource",
      "pluginName": "MongoDB"
    }
  ],
  "__elements": {},
  "__requires": [
    {
      "type": "grafana",
      "id": "grafana",
      "name": "Grafana",
      "version": "9.5.1"
    },
    {
      "type": "datasource",
      "id": "grafana-mongodb-opensource-datasource",
      "name": "MongoDB",
      "version": "0.9.2"
    },
    {
      "type": "panel",
      "id": "stat",
      "name": "Stat",
      "version": ""
    },
    {
      "type": "panel",
      "id": "timeseries",
      "name": "Time series",
      "version": ""
    }
  ],
  "annotations": {
    "list": [
      {
        "builtIn": 1,
        "datasource": {
          "type": "datasource",
          "uid": "grafana"
        },
        "enable": true,
        "hide": true,
        "iconColor": "rgba(0, 211, 255, 1)",
        "name": "Annotations & Alerts",
        "target": {
          "limit": 100,
          "matchAny": false,
          "tags": [],
          "type": "dashboard"
        },
        "type": "dashboard"
      }
    ]
  },
  "description": "Visualize speedtest-cli (by Ookla) data in MongoDB",
  "editable": true,
  "fiscalYearStartMonth": 0,
  "gnetId": 12350,
  "graphTooltip": 0,
  "id": null,
  "links": [],
  "liveNow": false,
  "panels": [
    {
      "collapsed": false,
      "datasource": {
        "type": "grafana-mongodb-opensource-datasource",
        "uid": "acd245ae-8793-4860-9f1c-7fe04040ab7a"
      },
      "gridPos": {
        "h": 1,
        "w": 24,
        "x": 0,
        "y": 0
      },
      "id": 10,
      "panels": [],
      "targets": [
        {
          "datasource": {
            "type": "grafana-mongodb-opensource-datasource",
            "uid": "acd245ae-8793-4860-9f1c-7fe04040ab7a"
          },
          "refId": "A"
        }
      ],
      "title": "Bandwidth",
      "type": "row"
    },
    {
      "datasource": {
        "type": "grafana-mongodb-opensource-datasource",
        "uid": "${DS_MONGODB}"
      },
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "palette-classic"
          },
          "custom": {
            "axisCenteredZero": false,
            "axisColorMode": "text",
            "axisLabel": "Mbps",
            "axisPlacement": "auto",
            "barAlignment": 0,
            "drawStyle": "line",
            "fillOpacity": 0,
            "gradientMode": "none",
            "hideFrom": {
              "legend": false,
              "tooltip": false,
              "viz": false
            },
            "lineInterpolation": "linear",
            "lineWidth": 1,
            "pointSize": 5,
            "scaleDistribution": {
              "type": "linear"
            },
            "showPoints": "auto",
            "spanNulls": false,
            "stacking": {
              "group": "A",
              "mode": "none"
            },
            "thresholdsStyle": {
              "mode": "off"
            }
          },
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              },
              {
                "color": "red",
                "value": 80
              }
            ]
          }
        },
        "overrides": []
      },
      "gridPos": {
        "h": 8,
        "w": 12,
        "x": 0,
        "y": 1
      },
      "id": 2,
      "options": {
        "legend": {
          "calcs": [],
          "displayMode": "list",
          "placement": "bottom",
          "showLegend": true
        },
        "tooltip": {
          "mode": "single",
          "sort": "none"
        }
      },
      "pluginVersion": "9.5.1",
      "targets": [
        {
          "datasource": {
            "type": "grafana-mongodb-opensource-datasource",
            "uid": "${DS_MONGODB}"
          },
          "hide": false,
          "rawQuery": true,
          "refId": "A",
          "target": "db.normalized_speedtest.aggregate([{\n        \"$match\": {\n            \"ts\": {\n                \"$gte\": \"$from\",\n                \"$lte\": \"$to\"\n            }\n        }\n    },\n    {\n        \"$sort\": {\n            \"ts\": 1\n        }\n    },\n    {\n        \"$project\": {\n            \"download\": \"$downloadMbps\",\n            \"time\": \"$ts\",\n            \"_id\": 0\n        }\n    }\n])",
          "type": "timeserie"
        },
        {
          "datasource": {
            "type": "grafana-mongodb-opensource-datasource",
            "uid": "${DS_MONGODB}"
          },
          "rawQuery": true,
          "refId": "B",
          "target": "db.normalized_speedtest.aggregate([{\n        \"$match\": {\n            \"ts\": {\n                \"$gte\": \"$from\",\n                \"$lte\": \"$to\"\n            }\n        }\n    },\n    {\n        \"$sort\": {\n            \"ts\": 1\n        }\n    },\n    {\n        \"$project\": {\n            \"upload\": \"$uploadMbps\",\n            \"time\": \"$ts\",\n            \"_id\": 0\n        }\n    }\n])",
          "type": "timeserie"
        }
      ],
      "title": "Bandwidth Graph",
      "type": "timeseries"
    },
    {
      "datasource": {
        "type": "grafana-mongodb-opensource-datasource",
        "uid": "${DS_MONGODB}"
      },
      "fieldConfig": {
        "defaults": {
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "red",
                "value": null
              },
              {
                "color": "#EAB839",
                "value": 7
              },
              {
                "color": "green",
                "value": 30
              }
            ]
          },
          "unit": "Mbps"
        },
        "overrides": []
      },
      "gridPos": {
        "h": 8,
        "w": 6,
        "x": 12,
        "y": 1
      },
      "id": 12,
      "options": {
        "colorMode": "value",
        "graphMode": "area",
        "justifyMode": "auto",
        "orientation": "auto",
        "reduceOptions": {
          "calcs": [
            "mean"
          ],
          "fields": "",
          "values": false
        },
        "textMode": "auto"
      },
      "pluginVersion": "9.5.1",
      "targets": [
        {
          "datasource": {
            "type": "grafana-mongodb-opensource-datasource",
            "uid": "${DS_MONGODB}"
          },
          "rawQuery": true,
          "refId": "A",
          "target": "db.normalized_speedtest.aggregate([{\n        \"$match\": {\n            \"ts\": {\n                \"$gte\": \"$from\",\n                \"$lte\": \"$to\"\n            }\n        }\n    },\n    {\n        \"$sort\": {\n            \"ts\": 1\n        }\n    },\n    {\n        \"$project\": {\n            \"value\": \"$downloadMbps\",\n            \"_id\": 0\n        }\n    }\n])",
          "type": "timeserie"
        }
      ],
      "title": "Download Stats",
      "type": "stat"
    },
    {
      "datasource": {
        "type": "grafana-mongodb-opensource-datasource",
        "uid": "${DS_MONGODB}"
      },
      "fieldConfig": {
        "defaults": {
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "red",
                "value": null
              },
              {
                "color": "#EAB839",
                "value": 1.5
              },
              {
                "color": "green",
                "value": 2.5
              }
            ]
          },
          "unit": "Mbps"
        },
        "overrides": []
      },
      "gridPos": {
        "h": 8,
        "w": 6,
        "x": 18,
        "y": 1
      },
      "id": 11,
      "options": {
        "colorMode": "value",
        "graphMode": "area",
        "justifyMode": "auto",
        "orientation": "auto",
        "reduceOptions": {
          "calcs": [
            "mean"
          ],
          "fields": "",
          "values": false
        },
        "textMode": "auto"
      },
      "pluginVersion": "9.5.1",
      "targets": [
        {
          "datasource": {
            "type": "grafana-mongodb-opensource-datasource",
            "uid": "${DS_MONGODB}"
          },
          "rawQuery": true,
          "refId": "A",
          "target": "db.normalized_speedtest.aggregate([{\n        \"$match\": {\n            \"ts\": {\n                \"$gte\": \"$from\",\n                \"$lte\": \"$to\"\n            }\n        }\n    },\n    {\n        \"$sort\": {\n            \"ts\": 1\n        }\n    },\n    {\n        \"$project\": {\n            \"value\": \"$uploadMbps\",\n            \"_id\": 0\n        }\n    }\n])",
          "type": "timeserie"
        }
      ],
      "title": "Upload Stats",
      "type": "stat"
    },
    {
      "collapsed": false,
      "datasource": {
        "type": "grafana-mongodb-opensource-datasource",
        "uid": "acd245ae-8793-4860-9f1c-7fe04040ab7a"
      },
      "gridPos": {
        "h": 1,
        "w": 24,
        "x": 0,
        "y": 9
      },
      "id": 8,
      "panels": [],
      "targets": [
        {
          "datasource": {
            "type": "grafana-mongodb-opensource-datasource",
            "uid": "acd245ae-8793-4860-9f1c-7fe04040ab7a"
          },
          "refId": "A"
        }
      ],
      "title": "Packets",
      "type": "row"
    },
    {
      "datasource": {
        "type": "grafana-mongodb-opensource-datasource",
        "uid": "${DS_MONGODB}"
      },
      "fieldConfig": {
        "defaults": {
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              },
              {
                "color": "#EAB839",
                "value": 80
              },
              {
                "color": "red",
                "value": 150
              }
            ]
          },
          "unit": "ms"
        },
        "overrides": []
      },
      "gridPos": {
        "h": 8,
        "w": 8,
        "x": 0,
        "y": 10
      },
      "id": 6,
      "options": {
        "colorMode": "value",
        "graphMode": "area",
        "justifyMode": "auto",
        "orientation": "auto",
        "reduceOptions": {
          "calcs": [
            "mean"
          ],
          "fields": "",
          "values": false
        },
        "textMode": "auto"
      },
      "pluginVersion": "9.5.1",
      "targets": [
        {
          "datasource": {
            "type": "grafana-mongodb-opensource-datasource",
            "uid": "${DS_MONGODB}"
          },
          "rawQuery": true,
          "refId": "A",
          "target": "db.normalized_speedtest.aggregate([{\n        \"$match\": {\n            \"ts\": {\n                \"$gte\": \"$from\",\n                \"$lte\": \"$to\"\n            }\n        }\n    },\n    {\n        \"$sort\": {\n            \"ts\": 1\n        }\n    },\n    {\n        \"$project\": {\n            \"value\": \"$pingLatency\",\n            \"_id\": 0\n        }\n    }\n])",
          "type": "timeserie"
        }
      ],
      "title": "Ping",
      "type": "stat"
    },
    {
      "datasource": {
        "type": "grafana-mongodb-opensource-datasource",
        "uid": "${DS_MONGODB}"
      },
      "fieldConfig": {
        "defaults": {
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              },
              {
                "color": "#EAB839",
                "value": 20
              },
              {
                "color": "red",
                "value": 30
              }
            ]
          },
          "unit": "ms"
        },
        "overrides": []
      },
      "gridPos": {
        "h": 8,
        "w": 8,
        "x": 8,
        "y": 10
      },
      "id": 13,
      "options": {
        "colorMode": "value",
        "graphMode": "area",
        "justifyMode": "auto",
        "orientation": "auto",
        "reduceOptions": {
          "calcs": [
            "mean"
          ],
          "fields": "",
          "values": false
        },
        "textMode": "auto"
      },
      "pluginVersion": "9.5.1",
      "targets": [
        {
          "datasource": {
            "type": "grafana-mongodb-opensource-datasource",
            "uid": "${DS_MONGODB}"
          },
          "rawQuery": true,
          "refId": "A",
          "target": "db.normalized_speedtest.aggregate([{\n        \"$match\": {\n            \"ts\": {\n                \"$gte\": \"$from\",\n                \"$lte\": \"$to\"\n            }\n        }\n    },\n    {\n        \"$sort\": {\n            \"ts\": 1\n        }\n    },\n    {\n        \"$project\": {\n            \"value\": \"$pingJitter\",\n            \"_id\": 0\n        }\n    }\n])",
          "type": "timeserie"
        }
      ],
      "title": "Jitter",
      "type": "stat"
    },
    {
      "datasource": {
        "type": "grafana-mongodb-opensource-datasource",
        "uid": "${DS_MONGODB}"
      },
      "fieldConfig": {
        "defaults": {
          "mappings": [],
          "max": 100,
          "min": 0,
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              },
              {
                "color": "dark-yellow",
                "value": 0.5
              },
              {
                "color": "red",
                "value": 1
              }
            ]
          },
          "unit": "percent"
        },
        "overrides": []
      },
      "gridPos": {
        "h": 8,
        "w": 8,
        "x": 16,
        "y": 10
      },
      "id": 4,
      "options": {
        "colorMode": "value",
        "graphMode": "area",
        "justifyMode": "auto",
        "orientation": "auto",
        "reduceOptions": {
          "calcs": [
            "mean"
          ],
          "fields": "",
          "values": false
        },
        "textMode": "auto"
      },
      "pluginVersion": "9.5.1",
      "targets": [
        {
          "datasource": {
            "type": "grafana-mongodb-opensource-datasource",
            "uid": "${DS_MONGODB}"
          },
          "rawQuery": true,
          "refId": "A",
          "target": "db.normalized_speedtest.aggregate([{\n        \"$match\": {\n            \"ts\": {\n                \"$gte\": \"$from\",\n                \"$lte\": \"$to\"\n            }\n        }\n    },\n    {\n        \"$sort\": {\n            \"ts\": 1\n        }\n    },\n    {\n        \"$project\": {\n            \"value\": \"$packetLoss\",\n            \"_id\": 0\n        }\n    }\n])",
          "type": "timeserie"
        }
      ],
      "title": "Packet Loss",
      "type": "stat"
    }
  ],
  "refresh": "",
  "schemaVersion": 38,
  "style": "dark",
  "tags": [],
  "templating": {
    "list": []
  },
  "time": {
    "from": "now-24h",
    "to": "now"
  },
  "timepicker": {
    "refresh_intervals": [
      "10s",
      "30s",
      "1m",
      "5m",
      "15m",
      "30m",
      "1h",
      "2h",
      "1d"
    ]
  },
  "timezone": "",
  "title": "Speedtest MongoDB",
  "uid": "9z0MQ7kGk",
  "version": 2,
  "weekStart": ""
}