{
  "annotations": {
    "list": [
      {
        "builtIn": 1,
        "datasource": "-- Grafana --",
        "enable": true,
        "hide": true,
        "iconColor": "rgba(0, 211, 255, 1)",
        "name": "Annotations & Alerts",
        "type": "dashboard"
      }
    ]
  },
  "description": "",
  "editable": true,
  "gnetId": null,
  "graphTooltip": 0,
  "id": 11,
  "iteration": 1568183350598,
  "links": [],
  "panels": [
    {
      "columns": [],
      "datasource": "psql",
      "description": "",
      "fontSize": "90%",
      "gridPos": {
        "h": 20,
        "w": 24,
        "x": 0,
        "y": 0
      },
      "hideTimeOverride": true,
      "id": 1,
      "interval": "",
      "links": [],
      "options": {},
      "pageSize": 1000,
      "scroll": true,
      "showHeader": true,
      "sort": {
        "col": 0,
        "desc": false
      },
      "styles": [
        {
          "alias": "Time",
          "dateFormat": "YYYY-MM-DD HH:mm:ss",
          "decimals": null,
          "pattern": "Time",
          "type": "hidden"
        },
        {
          "alias": "GitHub login",
          "colorMode": null,
          "colors": [
            "rgba(245, 54, 54, 0.9)",
            "rgba(237, 129, 40, 0.89)",
            "rgba(50, 172, 45, 0.97)"
          ],
          "dateFormat": "YYYY-MM-DD HH:mm:ss",
          "decimals": 2,
          "pattern": "name",
          "preserveFormat": false,
          "thresholds": [],
          "type": "string",
          "unit": "short"
        },
        {
          "alias": "Number",
          "colorMode": null,
          "colors": [
            "rgba(245, 54, 54, 0.9)",
            "rgba(237, 129, 40, 0.89)",
            "rgba(50, 172, 45, 0.97)"
          ],
          "dateFormat": "YYYY-MM-DD HH:mm:ss",
          "decimals": 0,
          "pattern": "value",
          "thresholds": [],
          "type": "number",
          "unit": "none"
        },
        {
          "alias": "",
          "colorMode": null,
          "colors": [
            "rgba(245, 54, 54, 0.9)",
            "rgba(237, 129, 40, 0.89)",
            "rgba(50, 172, 45, 0.97)"
          ],
          "dateFormat": "YYYY-MM-DD HH:mm:ss",
          "decimals": 2,
          "mappingType": 1,
          "pattern": "",
          "thresholds": [],
          "type": "number",
          "unit": "short"
        },
        {
          "alias": "",
          "colorMode": null,
          "colors": [
            "rgba(245, 54, 54, 0.9)",
            "rgba(237, 129, 40, 0.89)",
            "rgba(50, 172, 45, 0.97)"
          ],
          "decimals": 0,
          "pattern": "Rank",
          "thresholds": [],
          "type": "string",
          "unit": "short"
        }
      ],
      "targets": [
        {
          "alias": "",
          "dsType": "influxdb",
          "format": "table",
          "group": [],
          "groupBy": [
            {
              "params": [
                "$__interval"
              ],
              "type": "time"
            },
            {
              "params": [
                "null"
              ],
              "type": "fill"
            }
          ],
          "metricColumn": "none",
          "orderByTime": "ASC",
          "policy": "default",
          "query": "SELECT \"name\", \"value\" FROM \"developers_hist_[[metric]]_[[repogroup]]_[[period]]\" WHERE $timeFilter",
          "rawQuery": true,
          "rawSql": "select \n  sub.\"Rank\",\n  split_part(sub.name, '$$$', 1) as name,\n  split_part(sub.name, '$$$', 2) as \"Company\",\n  sub.value \nfrom (\n  select row_number() over (order by value desc, name asc) as \"Rank\",\n    name,\n    value\n  from\n    shdev\n  where\n    series = 'hdev_[[metric]][[repogroup]][[country]]'\n    and period = '[[period]]'\n    and ('[[companies:csv]]' = 'null' or split_part(name, '$$$', 2) in ([[companies]]))\n) sub",
          "refId": "A",
          "resultFormat": "table",
          "select": [
            [
              {
                "params": [
                  "value"
                ],
                "type": "field"
              },
              {
                "params": [],
                "type": "mean"
              }
            ]
          ],
          "tags": [],
          "timeColumn": "time",
          "where": [
            {
              "name": "$__timeFilter",
              "params": [],
              "type": "macro"
            }
          ]
        }
      ],
      "timeFrom": null,
      "title": "[[full_name]] Developers statistics ([[metric]], Range: [[period_name]], Repository group: [[repogroup_name]]), bots excluded",
      "transform": "table",
      "type": "table"
    },
    {
      "content": "${docs:raw}",
      "gridPos": {
        "h": 13,
        "w": 24,
        "x": 0,
        "y": 20
      },
      "id": 3,
      "links": [],
      "mode": "html",
      "options": {},
      "title": "Dashboard documentation",
      "type": "text"
    }
  ],
  "refresh": false,
  "schemaVersion": 19,
  "style": "dark",
  "tags": [
    "dashboard",
    "k8up",
    "repogroups",
    "table",
    "companies"
  ],
  "templating": {
    "list": [
      {
        "allValue": null,
        "current": {
          "text": "Last decade",
          "value": "Last decade"
        },
        "datasource": "psql",
        "definition": "",
        "hide": 0,
        "includeAll": false,
        "label": "Range",
        "multi": false,
        "name": "period_name",
        "options": [],
        "query": "select quick_ranges_name from tquick_ranges order by time",
        "refresh": 1,
        "regex": "",
        "skipUrlSync": false,
        "sort": 0,
        "tagValuesQuery": "",
        "tags": [],
        "tagsQuery": "",
        "type": "query",
        "useTags": false
      },
      {
        "allValue": null,
        "current": {
          "selected": true,
          "text": "Contributions",
          "value": "contributions"
        },
        "hide": 0,
        "includeAll": false,
        "label": "Metric",
        "multi": false,
        "name": "metric",
        "options": [
          {
            "selected": false,
            "text": "Comments",
            "value": "comments"
          },
          {
            "selected": false,
            "text": "Commit comments",
            "value": "commit_comments"
          },
          {
            "selected": false,
            "text": "Commits",
            "value": "commits"
          },
          {
            "selected": false,
            "text": "GitHub Events",
            "value": "events"
          },
          {
            "selected": false,
            "text": "GitHub pushes",
            "value": "pushes"
          },
          {
            "selected": false,
            "text": "Issue comments",
            "value": "issue_comments"
          },
          {
            "selected": false,
            "text": "Issues",
            "value": "issues"
          },
          {
            "selected": false,
            "text": "PRs",
            "value": "prs"
          },
          {
            "selected": false,
            "text": "Merged PRs",
            "value": "merged_prs"
          },
          {
            "selected": false,
            "text": "Review comments",
            "value": "review_comments"
          },
          {
            "selected": false,
            "text": "Reviews submitted",
            "value": "reviews"
          },
          {
            "selected": true,
            "text": "Contributions",
            "value": "contributions"
          },
          {
            "selected": false,
            "text": "Active repositories",
            "value": "active_repos"
          }
        ],
        "query": "comments,commit_comments,commits,events,pushes,contributions,issue_comments,issues,prs,merged_prs,review_comments,active_repos,reviews",
        "skipUrlSync": false,
        "type": "custom"
      },
      {
        "allValue": null,
        "current": {
          "text": "y10",
          "value": "y10"
        },
        "datasource": "psql",
        "definition": "",
        "hide": 2,
        "includeAll": false,
        "label": null,
        "multi": false,
        "name": "period",
        "options": [],
        "query": "select quick_ranges_suffix from tquick_ranges where quick_ranges_name = '[[period_name]]'",
        "refresh": 1,
        "regex": "",
        "skipUrlSync": true,
        "sort": 0,
        "tagValuesQuery": "",
        "tags": [],
        "tagsQuery": "",
        "type": "query",
        "useTags": false
      },
      {
        "allValue": null,
        "current": {
          "text": "All CNCF",
          "value": "All CNCF"
        },
        "datasource": "psql",
        "definition": "",
        "hide": 2,
        "includeAll": false,
        "label": null,
        "multi": false,
        "name": "full_name",
        "options": [],
        "query": "select value_s from gha_vars where name = 'full_name'",
        "refresh": 1,
        "regex": "",
        "skipUrlSync": true,
        "sort": 0,
        "tagValuesQuery": "",
        "tags": [],
        "tagsQuery": "",
        "type": "query",
        "useTags": false
      },
      {
        "allValue": null,
        "current": {
          "text": "All",
          "value": "All"
        },
        "datasource": "psql",
        "definition": "",
        "hide": 0,
        "includeAll": false,
        "label": "Repository group",
        "multi": false,
        "name": "repogroup_name",
        "options": [],
        "query": "select all_repo_group_name from tall_repo_groups order by 1",
        "refresh": 1,
        "regex": "",
        "skipUrlSync": false,
        "sort": 0,
        "tagValuesQuery": "",
        "tags": [],
        "tagsQuery": "",
        "type": "query",
        "useTags": false
      },
      {
        "allValue": null,
        "current": {
          "text": "all",
          "value": "all"
        },
        "datasource": "psql",
        "definition": "",
        "hide": 2,
        "includeAll": false,
        "label": "",
        "multi": false,
        "name": "repogroup",
        "options": [],
        "query": "select all_repo_group_value from tall_repo_groups where all_repo_group_name = '[[repogroup_name]]'",
        "refresh": 1,
        "regex": "",
        "skipUrlSync": true,
        "sort": 0,
        "tagValuesQuery": "",
        "tags": [],
        "tagsQuery": "",
        "type": "query",
        "useTags": false
      },
      {
        "allValue": null,
        "current": {
          "text": "<h1 id=\"kubernetes-dashboard\">All CNCF Developer Activity Counts by Repository Group dashboard</h1>\n<p>Links:</p>\n<ul>\n<li>Main metric <a href=\"https://github.com/cncf/devstats/blob/master/metrics/shared/project_developer_stats.sql\" target=\"_blank\">SQL file</a>.</li>\n<li>Approves metric <a href=\"https://github.com/cncf/devstats/blob/master/metrics/kubernetes/hist_approvers.sql\" target=\"_blank\">SQL file</a>.</li>\n<li>Reviews metric <a href=\"https://github.com/cncf/devstats/blob/master/metrics/kubernetes/hist_reviewers.sql\" target=\"_blank\">SQL file</a>.</li>\n<li>TSDB <a href=\"https://github.com/cncf/devstats/blob/master/metrics/kubernetes/metrics.yaml\" target=\"_blank\">series definition</a>. Search for <code>Developer activity</code></li>\n<li>Grafana dashboard <a href=\"https://github.com/cncf/devstats/blob/master/grafana/dashboards/kubernetes/developer-activity-counts-by-repository-group.json\" target=\"_blank\">JSON</a>.</li>\n</ul>\n<h1 id=\"description\">Description</h1>\n<ul>\n<li>This dashboard shows various developer metrics groupped by their affiliated companies.</li>\n<li>You can select last day, month, week etc. range or date range between releases, for example <code>v1.9 - v1.10</code>.</li>\n<li>You can select single repository group or summary for all of them.</li>\n<li>You can select country from a drop-down or summary for all countries.</li>\n<li>You can select company/companies from a drop-down or all to display all companies.</li>\n<li>See <a href=\"https://github.com/cncf/devstats/blob/master/docs/repository_groups.md\" target=\"_blank\">here</a> for more informations about repository groups.</li>\n<li>We are skipping bots when calculating statistics, see <a href=\"https://github.com/cncf/devstats/blob/master/docs/excluding_bots.md\" target=\"_blank\">excluding bots</a> for details.</li>\n<li>We are determining user's company affiliation from <a href=\"https://github.com/cncf/devstats/blob/master/github_users.json\" target=\"_blank\">this file</a>, which is imported from <code>cncf/gitdm</code>.</li>\n</ul>",
          "value": "<h1 id=\"kubernetes-dashboard\">All CNCF Developer Activity Counts by Repository Group dashboard</h1>\n<p>Links:</p>\n<ul>\n<li>Main metric <a href=\"https://github.com/cncf/devstats/blob/master/metrics/shared/project_developer_stats.sql\" target=\"_blank\">SQL file</a>.</li>\n<li>Approves metric <a href=\"https://github.com/cncf/devstats/blob/master/metrics/kubernetes/hist_approvers.sql\" target=\"_blank\">SQL file</a>.</li>\n<li>Reviews metric <a href=\"https://github.com/cncf/devstats/blob/master/metrics/kubernetes/hist_reviewers.sql\" target=\"_blank\">SQL file</a>.</li>\n<li>TSDB <a href=\"https://github.com/cncf/devstats/blob/master/metrics/kubernetes/metrics.yaml\" target=\"_blank\">series definition</a>. Search for <code>Developer activity</code></li>\n<li>Grafana dashboard <a href=\"https://github.com/cncf/devstats/blob/master/grafana/dashboards/kubernetes/developer-activity-counts-by-repository-group.json\" target=\"_blank\">JSON</a>.</li>\n</ul>\n<h1 id=\"description\">Description</h1>\n<ul>\n<li>This dashboard shows various developer metrics groupped by their affiliated companies.</li>\n<li>You can select last day, month, week etc. range or date range between releases, for example <code>v1.9 - v1.10</code>.</li>\n<li>You can select single repository group or summary for all of them.</li>\n<li>You can select country from a drop-down or summary for all countries.</li>\n<li>You can select company/companies from a drop-down or all to display all companies.</li>\n<li>See <a href=\"https://github.com/cncf/devstats/blob/master/docs/repository_groups.md\" target=\"_blank\">here</a> for more informations about repository groups.</li>\n<li>We are skipping bots when calculating statistics, see <a href=\"https://github.com/cncf/devstats/blob/master/docs/excluding_bots.md\" target=\"_blank\">excluding bots</a> for details.</li>\n<li>We are determining user's company affiliation from <a href=\"https://github.com/cncf/devstats/blob/master/github_users.json\" target=\"_blank\">this file</a>, which is imported from <code>cncf/gitdm</code>.</li>\n</ul>"
        },
        "datasource": "psql",
        "definition": "select value_s from gha_vars where name = 'developer_company_stats_docs_html'",
        "hide": 2,
        "includeAll": false,
        "label": null,
        "multi": false,
        "name": "docs",
        "options": [],
        "query": "select value_s from gha_vars where name = 'developer_company_stats_docs_html'",
        "refresh": 1,
        "regex": "",
        "skipUrlSync": true,
        "sort": 0,
        "tagValuesQuery": "",
        "tags": [],
        "tagsQuery": "",
        "type": "query",
        "useTags": false
      },
      {
        "allValue": null,
        "current": {
          "text": "all",
          "value": "all"
        },
        "datasource": "psql",
        "definition": "",
        "hide": 2,
        "includeAll": false,
        "label": "",
        "multi": false,
        "name": "country",
        "options": [],
        "query": "select sub.value from (select country_value as value, 0 as ord from tcountries where country_name = '[[country_name]]' union select 'all', 1 as ord) sub order by sub.ord limit 1",
        "refresh": 1,
        "regex": "",
        "skipUrlSync": true,
        "sort": 0,
        "tagValuesQuery": "",
        "tags": [],
        "tagsQuery": "",
        "type": "query",
        "useTags": false
      },
      {
        "allValue": "all",
        "current": {
          "text": "All",
          "value": "All"
        },
        "datasource": "psql",
        "definition": "",
        "hide": 0,
        "includeAll": false,
        "label": "Country",
        "multi": false,
        "name": "country_name",
        "options": [],
        "query": "select 'All' union select country_name from tcountries order by 1",
        "refresh": 1,
        "regex": "",
        "skipUrlSync": false,
        "sort": 0,
        "tagValuesQuery": "",
        "tags": [],
        "tagsQuery": "",
        "type": "query",
        "useTags": false
      },
      {
        "allValue": "null",
        "current": {
          "text": "All",
          "value": [
            "$__all"
          ]
        },
        "datasource": "psql",
        "definition": "select companies_name from tcompanies order by time",
        "hide": 0,
        "includeAll": true,
        "label": "Companies",
        "multi": true,
        "name": "companies",
        "options": [],
        "query": "select companies_name from tcompanies order by time",
        "refresh": 1,
        "regex": "",
        "skipUrlSync": false,
        "sort": 0,
        "tagValuesQuery": "",
        "tags": [],
        "tagsQuery": "",
        "type": "query",
        "useTags": false
      }
    ]
  },
  "time": {
    "from": "now-5y",
    "to": "now"
  },
  "timepicker": {
    "hidden": true,
    "refresh_intervals": [
      "5s",
      "10s",
      "30s",
      "1m",
      "5m",
      "15m",
      "30m",
      "1h",
      "2h",
      "1d"
    ],
    "time_options": [
      "5m",
      "15m",
      "1h",
      "6h",
      "12h",
      "24h",
      "2d",
      "7d",
      "30d"
    ]
  },
  "timezone": "",
  "title": "Developer Activity Counts by Companies",
  "uid": "66",
  "version": 2
}
