Grafana dashboard: Gerrit - Caches

# Gerrit Caches dashboard

This dashboard is being maintained as part of the [gerrit-monitoring project](https://gerrit-review.googlesource.com/admin/repos/gerrit-monitoring). It is meant to be used with the [metrics-reporter-prometheus plugin](https://gerrit-review.googlesource.com/admin/repos/plugins/metrics-reporter-prometheus) for Gerrit and Prometheus. The project provides a Kubernetes-based setup to install a complete monitoring and logging stack. Multiple dashboards are available.

{
  "__inputs": [
    {
      "description": "",
      "label": "Prometheus",
      "name": "DS_PROMETHEUS",
      "pluginId": "prometheus",
      "pluginName": "Prometheus",
      "type": "datasource"
    }
  ],
  "__requires": [
    {
      "id": "grafana",
      "name": "Grafana",
      "type": "grafana",
      "version": "7.1.5"
    },
    {
      "id": "graph",
      "name": "Graph",
      "type": "panel",
      "version": ""
    },
    {
      "id": "prometheus",
      "name": "Prometheus",
      "type": "datasource",
      "version": "1.0.0"
    }
  ],
  "annotations": {
    "list": []
  },
  "editable": false,
  "gnetId": 13429,
  "graphTooltip": 2,
  "hideControls": false,
  "id": null,
  "links": [],
  "panels": [
    {
      "aliasColors": {},
      "bars": false,
      "dashLength": 10,
      "dashes": false,
      "datasource": "${DS_PROMETHEUS}",
      "fill": 0,
      "gridPos": {
        "h": 11,
        "w": 12,
        "x": 0,
        "y": 0
      },
      "id": 2,
      "legend": {
        "alignAsTable": true,
        "avg": true,
        "current": true,
        "max": true,
        "min": true,
        "rightSide": false,
        "show": true,
        "sideWidth": null,
        "total": false,
        "values": true
      },
      "lines": true,
      "linewidth": 1,
      "links": [],
      "nullPointMode": "null",
      "percentage": false,
      "pointradius": 5,
      "points": false,
      "renderer": "flot",
      "repeat": null,
      "seriesOverrides": [],
      "spaceLength": 10,
      "stack": false,
      "steppedLine": false,
      "targets": [
        {
          "expr": "100-caches_memory_hit_ratio_accounts{instance=\"$instance\",replica=\"$replica\"}",
          "format": "time_series",
          "intervalFactor": 2,
          "legendFormat": "accounts",
          "refId": "A"
        },
        {
          "expr": "100-caches_memory_hit_ratio_groups{instance=\"$instance\",replica=\"$replica\"}",
          "format": "time_series",
          "intervalFactor": 2,
          "legendFormat": "groups",
          "refId": "B"
        },
        {
          "expr": "100-caches_memory_hit_ratio_groups_byuuid{instance=\"$instance\",replica=\"$replica\"}",
          "format": "time_series",
          "intervalFactor": 2,
          "legendFormat": "groups_byuuid",
          "refId": "C"
        },
        {
          "expr": "100-caches_memory_hit_ratio_ldap_groups_byinclude{instance=\"$instance\",replica=\"$replica\"}",
          "format": "time_series",
          "intervalFactor": 2,
          "legendFormat": "ldap_groups_byinclude",
          "refId": "D"
        }
      ],
      "thresholds": [],
      "timeFrom": null,
      "timeShift": null,
      "title": "ACCOUNT cache misses",
      "tooltip": {
        "shared": true,
        "sort": 0,
        "value_type": "individual"
      },
      "type": "graph",
      "xaxis": {
        "buckets": null,
        "mode": "time",
        "name": null,
        "show": true,
        "values": []
      },
      "yaxes": [
        {
          "format": "percent",
          "label": "Cache Misses",
          "logBase": 1,
          "max": null,
          "min": null,
          "show": true
        },
        {
          "format": "short",
          "label": "",
          "logBase": 1,
          "max": null,
          "min": null,
          "show": true
        }
      ]
    },
    {
      "aliasColors": {},
      "bars": false,
      "dashLength": 10,
      "dashes": false,
      "datasource": "${DS_PROMETHEUS}",
      "fill": 0,
      "gridPos": {
        "h": 11,
        "w": 12,
        "x": 12,
        "y": 0
      },
      "id": 3,
      "legend": {
        "alignAsTable": true,
        "avg": true,
        "current": true,
        "max": true,
        "min": true,
        "rightSide": false,
        "show": true,
        "sideWidth": null,
        "total": false,
        "values": true
      },
      "lines": true,
      "linewidth": 1,
      "links": [],
      "nullPointMode": "null",
      "percentage": false,
      "pointradius": 5,
      "points": false,
      "renderer": "flot",
      "repeat": null,
      "seriesOverrides": [],
      "spaceLength": 10,
      "stack": false,
      "steppedLine": false,
      "targets": [
        {
          "expr": "100-caches_memory_hit_ratio_change_kind{instance=\"$instance\",replica=\"$replica\"}",
          "format": "time_series",
          "intervalFactor": 2,
          "legendFormat": "change_kind",
          "refId": "A"
        },
        {
          "expr": "100-caches_memory_hit_ratio_change_notes{instance=\"$instance\",replica=\"$replica\"}",
          "format": "time_series",
          "intervalFactor": 2,
          "legendFormat": "change_notes",
          "refId": "B"
        },
        {
          "expr": "100-caches_memory_hit_ratio_changeid_project{instance=\"$instance\",replica=\"$replica\"}",
          "format": "time_series",
          "intervalFactor": 2,
          "legendFormat": "changeid_project",
          "refId": "C"
        }
      ],
      "thresholds": [],
      "timeFrom": null,
      "timeShift": null,
      "title": "CHANGE cache misses",
      "tooltip": {
        "shared": true,
        "sort": 0,
        "value_type": "individual"
      },
      "type": "graph",
      "xaxis": {
        "buckets": null,
        "mode": "time",
        "name": null,
        "show": true,
        "values": []
      },
      "yaxes": [
        {
          "format": "percent",
          "label": "Cache Misses",
          "logBase": 1,
          "max": null,
          "min": null,
          "show": true
        },
        {
          "format": "short",
          "label": "",
          "logBase": 1,
          "max": null,
          "min": null,
          "show": true
        }
      ]
    },
    {
      "aliasColors": {},
      "bars": false,
      "dashLength": 10,
      "dashes": false,
      "datasource": "${DS_PROMETHEUS}",
      "fill": 0,
      "gridPos": {
        "h": 11,
        "w": 12,
        "x": 0,
        "y": 11
      },
      "id": 4,
      "legend": {
        "alignAsTable": true,
        "avg": true,
        "current": true,
        "max": true,
        "min": true,
        "rightSide": false,
        "show": true,
        "sideWidth": null,
        "total": false,
        "values": true
      },
      "lines": true,
      "linewidth": 1,
      "links": [],
      "nullPointMode": "null",
      "percentage": false,
      "pointradius": 5,
      "points": false,
      "renderer": "flot",
      "repeat": null,
      "seriesOverrides": [],
      "spaceLength": 10,
      "stack": false,
      "steppedLine": false,
      "targets": [
        {
          "expr": "100-caches_memory_hit_ratio_conflicts{instance=\"$instance\",replica=\"$replica\"}",
          "format": "time_series",
          "intervalFactor": 2,
          "legendFormat": "conflicts",
          "refId": "A"
        },
        {
          "expr": "100-caches_memory_hit_ratio_mergeability{instance=\"$instance\",replica=\"$replica\"}",
          "format": "time_series",
          "intervalFactor": 2,
          "legendFormat": "mergeability",
          "refId": "B"
        }
      ],
      "thresholds": [],
      "timeFrom": null,
      "timeShift": null,
      "title": "CONFLICT cache misses",
      "tooltip": {
        "shared": true,
        "sort": 0,
        "value_type": "individual"
      },
      "type": "graph",
      "xaxis": {
        "buckets": null,
        "mode": "time",
        "name": null,
        "show": true,
        "values": []
      },
      "yaxes": [
        {
          "format": "percent",
          "label": "Cache Misses",
          "logBase": 1,
          "max": null,
          "min": null,
          "show": true
        },
        {
          "format": "short",
          "label": "",
          "logBase": 1,
          "max": null,
          "min": null,
          "show": true
        }
      ]
    },
    {
      "aliasColors": {},
      "bars": false,
      "dashLength": 10,
      "dashes": false,
      "datasource": "${DS_PROMETHEUS}",
      "fill": 0,
      "gridPos": {
        "h": 11,
        "w": 12,
        "x": 12,
        "y": 11
      },
      "id": 5,
      "legend": {
        "alignAsTable": true,
        "avg": true,
        "current": true,
        "max": true,
        "min": true,
        "rightSide": false,
        "show": true,
        "sideWidth": null,
        "total": false,
        "values": true
      },
      "lines": true,
      "linewidth": 1,
      "links": [],
      "nullPointMode": "null",
      "percentage": false,
      "pointradius": 5,
      "points": false,
      "renderer": "flot",
      "repeat": null,
      "seriesOverrides": [],
      "spaceLength": 10,
      "stack": false,
      "steppedLine": false,
      "targets": [
        {
          "expr": "100-caches_memory_hit_ratio_project_list{instance=\"$instance\",replica=\"$replica\"}",
          "format": "time_series",
          "intervalFactor": 2,
          "legendFormat": "project_list",
          "refId": "A"
        },
        {
          "expr": "100-caches_memory_hit_ratio_projects{instance=\"$instance\",replica=\"$replica\"}",
          "format": "time_series",
          "intervalFactor": 2,
          "legendFormat": "projects",
          "refId": "B"
        }
      ],
      "thresholds": [],
      "timeFrom": null,
      "timeShift": null,
      "title": "PROJECT cache misses",
      "tooltip": {
        "shared": true,
        "sort": 0,
        "value_type": "individual"
      },
      "type": "graph",
      "xaxis": {
        "buckets": null,
        "mode": "time",
        "name": null,
        "show": true,
        "values": []
      },
      "yaxes": [
        {
          "format": "percent",
          "label": "Cache Misses",
          "logBase": 1,
          "max": null,
          "min": null,
          "show": true
        },
        {
          "format": "short",
          "label": "",
          "logBase": 1,
          "max": null,
          "min": null,
          "show": true
        }
      ]
    },
    {
      "aliasColors": {},
      "bars": false,
      "dashLength": 10,
      "dashes": false,
      "datasource": "${DS_PROMETHEUS}",
      "fill": 0,
      "gridPos": {
        "h": 11,
        "w": 12,
        "x": 0,
        "y": 22
      },
      "id": 6,
      "legend": {
        "alignAsTable": true,
        "avg": true,
        "current": true,
        "max": true,
        "min": true,
        "rightSide": false,
        "show": true,
        "sideWidth": null,
        "total": false,
        "values": true
      },
      "lines": true,
      "linewidth": 1,
      "links": [],
      "nullPointMode": "null",
      "percentage": false,
      "pointradius": 5,
      "points": false,
      "renderer": "flot",
      "repeat": null,
      "seriesOverrides": [],
      "spaceLength": 10,
      "stack": false,
      "steppedLine": false,
      "targets": [
        {
          "expr": "100-caches_memory_hit_ratio_diff{instance=\"$instance\",replica=\"$replica\"}",
          "format": "time_series",
          "intervalFactor": 2,
          "legendFormat": "diff",
          "refId": "A"
        },
        {
          "expr": "100-caches_memory_hit_ratio_diff_intraline{instance=\"$instance\",replica=\"$replica\"}",
          "format": "time_series",
          "intervalFactor": 2,
          "legendFormat": "diff_intraline",
          "refId": "B"
        },
        {
          "expr": "100-caches_memory_hit_ratio_diff_summary{instance=\"$instance\",replica=\"$replica\"}",
          "format": "time_series",
          "intervalFactor": 2,
          "legendFormat": "diff_summary",
          "refId": "C"
        }
      ],
      "thresholds": [],
      "timeFrom": null,
      "timeShift": null,
      "title": "DIFF cache misses",
      "tooltip": {
        "shared": true,
        "sort": 0,
        "value_type": "individual"
      },
      "type": "graph",
      "xaxis": {
        "buckets": null,
        "mode": "time",
        "name": null,
        "show": true,
        "values": []
      },
      "yaxes": [
        {
          "format": "percent",
          "label": "Cache Misses",
          "logBase": 1,
          "max": null,
          "min": null,
          "show": true
        },
        {
          "format": "short",
          "label": "",
          "logBase": 1,
          "max": null,
          "min": null,
          "show": true
        }
      ]
    },
    {
      "aliasColors": {},
      "bars": false,
      "dashLength": 10,
      "dashes": false,
      "datasource": "${DS_PROMETHEUS}",
      "fill": 0,
      "gridPos": {
        "h": 11,
        "w": 12,
        "x": 12,
        "y": 22
      },
      "id": 7,
      "legend": {
        "alignAsTable": true,
        "avg": true,
        "current": true,
        "max": true,
        "min": true,
        "rightSide": false,
        "show": true,
        "sideWidth": null,
        "total": false,
        "values": true
      },
      "lines": true,
      "linewidth": 1,
      "links": [],
      "nullPointMode": "null",
      "percentage": false,
      "pointradius": 5,
      "points": false,
      "renderer": "flot",
      "repeat": null,
      "seriesOverrides": [],
      "spaceLength": 10,
      "stack": false,
      "steppedLine": false,
      "targets": [
        {
          "expr": "100-caches_memory_hit_ratio_web_sessions{instance=\"$instance\",replica=\"$replica\"}",
          "format": "time_series",
          "intervalFactor": 2,
          "legendFormat": "web_sessions",
          "refId": "A"
        },
        {
          "expr": "100-caches_memory_hit_ratio_sshkeys{instance=\"$instance\",replica=\"$replica\"}",
          "format": "time_series",
          "intervalFactor": 2,
          "legendFormat": "sshkeys",
          "refId": "B"
        },
        {
          "expr": "100-caches_memory_hit_ratio_git_tags{instance=\"$instance\",replica=\"$replica\"}",
          "format": "time_series",
          "intervalFactor": 2,
          "legendFormat": "git_tags",
          "refId": "C"
        },
        {
          "expr": "100-caches_memory_hit_ratio_permission_sort{instance=\"$instance\",replica=\"$replica\"}",
          "format": "time_series",
          "intervalFactor": 2,
          "legendFormat": "permission_sort",
          "refId": "D"
        }
      ],
      "thresholds": [],
      "timeFrom": null,
      "timeShift": null,
      "title": "MISC cache misses",
      "tooltip": {
        "shared": true,
        "sort": 0,
        "value_type": "individual"
      },
      "type": "graph",
      "xaxis": {
        "buckets": null,
        "mode": "time",
        "name": null,
        "show": true,
        "values": []
      },
      "yaxes": [
        {
          "format": "percent",
          "label": "Cache Misses",
          "logBase": 1,
          "max": null,
          "min": null,
          "show": true
        },
        {
          "format": "short",
          "label": "",
          "logBase": 1,
          "max": null,
          "min": null,
          "show": true
        }
      ]
    }
  ],
  "refresh": "1m",
  "rows": [],
  "schemaVersion": 22,
  "style": "dark",
  "tags": [
    "gerrit"
  ],
  "templating": {
    "list": [
      {
        "allValue": null,
        "current": {},
        "datasource": "${DS_PROMETHEUS}",
        "hide": 0,
        "includeAll": false,
        "label": "Gerrit Instance",
        "multi": false,
        "name": "instance",
        "options": [],
        "query": "label_values(git_upload_pack_phase_writing_total, instance)",
        "refresh": 1,
        "regex": "",
        "sort": 0,
        "tagValuesQuery": "",
        "tags": [],
        "tagsQuery": "",
        "type": "query",
        "useTags": false
      },
      {
        "allValue": null,
        "current": {},
        "datasource": "${DS_PROMETHEUS}",
        "hide": 0,
        "includeAll": false,
        "label": "Replica",
        "multi": false,
        "name": "replica",
        "options": [],
        "query": "label_values(git_upload_pack_phase_writing_total{instance=\"$instance\"}, replica)",
        "refresh": 2,
        "regex": "",
        "sort": 0,
        "tagValuesQuery": "",
        "tags": [],
        "tagsQuery": "",
        "type": "query",
        "useTags": false
      }
    ]
  },
  "time": {
    "from": "now-24h",
    "to": "now"
  },
  "timepicker": {
    "refresh_intervals": [
      "5s",
      "10s",
      "30s",
      "1m",
      "5m",
      "15m",
      "30m",
      "1h",
      "2h",
      "1d"
    ],
    "time_options": [
      "5m",
      "15m",
      "1h",
      "6h",
      "12h",
      "24h",
      "2d",
      "7d",
      "30d"
    ]
  },
  "timezone": "browser",
  "title": "Gerrit - Caches",
  "version": 0
}