{
  "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"
      }
    ]
  },
  "editable": true,
  "fiscalYearStartMonth": 0,
  "graphTooltip": 0,
  "id": 16,
  "iteration": 1692692761672,
  "links": [],
  "liveNow": false,
  "panels": [
    {
      "datasource": {
        "type": "postgres",
        "uid": "P172949F98CB31475"
      },
      "description": "Shows [[full_name]] [[typ:text]] [[metric:text]] [[period_name]] Elephant/Bus Factor stats",
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "thresholds"
          },
          "custom": {
            "align": "auto",
            "displayMode": "auto",
            "inspect": false
          },
          "decimals": 0,
          "displayName": "",
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              },
              {
                "color": "red",
                "value": 80
              }
            ]
          },
          "unit": "none"
        },
        "overrides": [
          {
            "matcher": {
              "id": "byName",
              "options": "BF%"
            },
            "properties": [
              {
                "id": "decimals",
                "value": 2
              },
              {
                "id": "custom.width",
                "value": 56
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "Oth. %"
            },
            "properties": [
              {
                "id": "decimals",
                "value": 2
              },
              {
                "id": "custom.width",
                "value": 71
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "Top 10 %"
            },
            "properties": [
              {
                "id": "decimals",
                "value": 2
              },
              {
                "id": "custom.width",
                "value": 87
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "Rem. %"
            },
            "properties": [
              {
                "id": "decimals",
                "value": 2
              },
              {
                "id": "custom.width",
                "value": 80
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "BF"
            },
            "properties": [
              {
                "id": "custom.width",
                "value": 38
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "Bus/Elephant Factor Organizations"
            },
            "properties": [
              {
                "id": "custom.width",
                "value": 553
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "Oth. #"
            },
            "properties": [
              {
                "id": "custom.width",
                "value": 73
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "Rem. #"
            },
            "properties": [
              {
                "id": "custom.width",
                "value": 76
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "Project/Repository Group"
            },
            "properties": [
              {
                "id": "custom.width",
                "value": 337
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "Top Organizations"
            },
            "properties": [
              {
                "id": "custom.width",
                "value": 770
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "Bus/Elephant Factor Users"
            },
            "properties": [
              {
                "id": "custom.width",
                "value": 553
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "Top Users"
            },
            "properties": [
              {
                "id": "custom.width",
                "value": 770
              }
            ]
          }
        ]
      },
      "gridPos": {
        "h": 25,
        "w": 24,
        "x": 0,
        "y": 0
      },
      "hideTimeOverride": true,
      "id": 1,
      "interval": "",
      "links": [],
      "options": {
        "footer": {
          "fields": "",
          "reducer": [
            "sum"
          ],
          "show": false
        },
        "showHeader": true,
        "sortBy": [
          {
            "desc": false,
            "displayName": "Project/Repository Group"
          }
        ]
      },
      "pluginVersion": "8.5.27",
      "targets": [
        {
          "alias": "",
          "datasource": {
            "type": "postgres",
            "uid": "P172949F98CB31475"
          },
          "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 \"top_commenters_[[repogroup]]_[[period]]\" WHERE $timeFilter",
          "rawQuery": true,
          "rawSql": "select\n  split_part(name, '$$', 1) as \"Project/Repository Group\",\n  value as \"BF\",\n  split_part(name, '$$', 2)::numeric as \"BF%\",\n  split_part(name, '$$', 3) as \"Bus/Elephant Factor [[typ:text]]\",\n  split_part(name, '$$', 4)::numeric as \"Oth. #\",\n  split_part(name, '$$', 5)::numeric as \"Oth. %\",\n  -- split_part(name, '$$', 6) as \"Top 10\",\n  split_part(name, '$$', 7)::numeric as \"Top 10 %\",\n  split_part(name, '$$', 8) as \"Top [[typ:text]]\",\n  split_part(name, '$$', 9)::numeric as \"Rem. #\",\n  split_part(name, '$$', 10)::numeric as \"Rem. %\"\nfrom\n  shbf\nwhere\n  series = 'hbus[[typ]][[metric]]'\n  and period = '[[period]]'\norder by\n  1",
          "refId": "A",
          "resultFormat": "table",
          "select": [
            [
              {
                "params": [
                  "value"
                ],
                "type": "field"
              },
              {
                "params": [],
                "type": "mean"
              }
            ]
          ],
          "tags": [],
          "timeColumn": "time",
          "where": [
            {
              "name": "$__timeFilter",
              "params": [],
              "type": "macro"
            }
          ]
        }
      ],
      "title": "[[full_name]] [[typ]] [[metric]] [[period_name]] Elephant/Bus Factor stats",
      "transformations": [
        {
          "id": "merge",
          "options": {
            "reducers": []
          }
        }
      ],
      "type": "table"
    },
    {
      "datasource": {
        "type": "postgres",
        "uid": "P172949F98CB31475"
      },
      "gridPos": {
        "h": 18,
        "w": 24,
        "x": 0,
        "y": 25
      },
      "id": 11,
      "links": [],
      "options": {
        "content": "${docs:raw}",
        "mode": "html"
      },
      "pluginVersion": "8.5.27",
      "title": "Dashboard documentation",
      "type": "text"
    }
  ],
  "refresh": false,
  "schemaVersion": 36,
  "style": "dark",
  "tags": [
    "companies",
    "dashboard",
    "table",
    "all"
  ],
  "templating": {
    "list": [
      {
        "current": {
          "selected": false,
          "text": "Last decade",
          "value": "Last decade"
        },
        "datasource": {
          "type": "postgres",
          "uid": "P172949F98CB31475"
        },
        "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": "",
        "tagsQuery": "",
        "type": "query",
        "useTags": false
      },
      {
        "current": {
          "selected": false,
          "text": "y10",
          "value": "y10"
        },
        "datasource": {
          "type": "postgres",
          "uid": "P172949F98CB31475"
        },
        "definition": "",
        "hide": 2,
        "includeAll": false,
        "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": "",
        "tagsQuery": "",
        "type": "query",
        "useTags": false
      },
      {
        "current": {
          "selected": false,
          "text": "All CNCF",
          "value": "All CNCF"
        },
        "datasource": {
          "type": "postgres",
          "uid": "P172949F98CB31475"
        },
        "definition": "",
        "hide": 2,
        "includeAll": false,
        "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": "",
        "tagsQuery": "",
        "type": "query",
        "useTags": false
      },
      {
        "current": {
          "selected": false,
          "text": "<h1 id=\"dashboard-header\">All CNCF Elephant/Bus factor in Repository Groups dashboard</h1>\n<p>Links:</p>\n<ul>\n<li>Metric <a href=\"https://github.com/cncf/devstats/blob/master/metrics/shared/bus_factor.sql\" target=\"_blank\">SQL file</a>.</li>\n<li>TSDB <a href=\"https://github.com/cncf/devstats/blob/master/metrics/all/metrics.yaml\" target=\"_blank\">series definition</a>. Search for <code>bus_factor</code></li>\n<li>Grafana dashboard <a href=\"https://github.com/cncf/devstats/blob/master/grafana/dashboards/all/elephant-bus-factor-in-repository-groups.json\" target=\"_blank\">JSON</a>.</li>\n</ul>\n<h1 id=\"description\">Description</h1>\n<ul>\n<li>This dashboard show elephant/bus factor and top 10 companies/contributors data for a given repository group and metric combination.</li>\n<li>You can choose between organizations/companies and users/contributors elephant/bus factor/top 10 stats.</li>\n<li>Bus factor value for a selected repository group/project is a minimal number of companies/contributors that contribute to >50% of all contributions of given type.</li>\n<li>When calculating for companies, we name it \"elephant\" factor, while for contributors we name it \"bus\" factor.</li>\n<li>It also displays companies/users who contribute to a bus factor and top 10 and percentage value of those contributions plus percentage and counts of the remaining contributors/organizations.</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>See <a href=\"https://github.com/cncf/devstats/blob/master/docs/periods.md\" target=\"_blank\">here</a> for more informations about periods.</li>\n<li>We are skipping bots activity, see <a href=\"https://github.com/cncf/devstats/blob/master/docs/excluding_bots.md\" target=\"_blank\">excluding bots</a> for details.</li>\n<li><code>Project/Repository Group</code>: CNCF project name (in case of All CNCF DevStats instance).</li>\n<li><code>BF</code>: Bus Factor value - the smallest number of users/organizations who contribute over 50% of a given metric type in a selected time range.</li>\n<li><code>BF %</code>: Percent value of contributions for bus factor number of top organizations/users.</li>\n<li><code>Bus Factor</code>: List of organizations/users which belong to the calculated bus factor.</li>\n<li>This is truncated at 10, so if the bus factor is > 10 then only 1st 10 will show (otherwise cell value will be too long, as is quite rare to have a bus factor > 10, so not a big limitation, and I can eventually change it if needed).</li>\n<li><code>Oth. #</code>: Count of the remaining users/organizations (those not in the bus factor, the remaining tail length).</li>\n<li><code>Oth. %</code>: Percent of remaining contributions.</li>\n<li><code>Top 10 %</code>: How many percent contributions are coming from the top 10 organizations/users (if this is 100% then it can be from less than 10 - it can happen that only 4 organizations contribute to a project in a given time period for example).</li>\n<li><code>Top</code>: Top 10 companies/users listed (there can be less than 10).</li>\n<li><code>Rem. #</code>: Count of the remaining companies/users outside of top 10 (can be 0).</li>\n<li><code>Rem. %</code>: Percent of contributions from companies/users outside of top 10.</li>\n</ul>",
          "value": "<h1 id=\"dashboard-header\">All CNCF Elephant/Bus factor in Repository Groups dashboard</h1>\n<p>Links:</p>\n<ul>\n<li>Metric <a href=\"https://github.com/cncf/devstats/blob/master/metrics/shared/bus_factor.sql\" target=\"_blank\">SQL file</a>.</li>\n<li>TSDB <a href=\"https://github.com/cncf/devstats/blob/master/metrics/all/metrics.yaml\" target=\"_blank\">series definition</a>. Search for <code>bus_factor</code></li>\n<li>Grafana dashboard <a href=\"https://github.com/cncf/devstats/blob/master/grafana/dashboards/all/elephant-bus-factor-in-repository-groups.json\" target=\"_blank\">JSON</a>.</li>\n</ul>\n<h1 id=\"description\">Description</h1>\n<ul>\n<li>This dashboard show elephant/bus factor and top 10 companies/contributors data for a given repository group and metric combination.</li>\n<li>You can choose between organizations/companies and users/contributors elephant/bus factor/top 10 stats.</li>\n<li>Bus factor value for a selected repository group/project is a minimal number of companies/contributors that contribute to >50% of all contributions of given type.</li>\n<li>When calculating for companies, we name it \"elephant\" factor, while for contributors we name it \"bus\" factor.</li>\n<li>It also displays companies/users who contribute to a bus factor and top 10 and percentage value of those contributions plus percentage and counts of the remaining contributors/organizations.</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>See <a href=\"https://github.com/cncf/devstats/blob/master/docs/periods.md\" target=\"_blank\">here</a> for more informations about periods.</li>\n<li>We are skipping bots activity, see <a href=\"https://github.com/cncf/devstats/blob/master/docs/excluding_bots.md\" target=\"_blank\">excluding bots</a> for details.</li>\n<li><code>Project/Repository Group</code>: CNCF project name (in case of All CNCF DevStats instance).</li>\n<li><code>BF</code>: Bus Factor value - the smallest number of users/organizations who contribute over 50% of a given metric type in a selected time range.</li>\n<li><code>BF %</code>: Percent value of contributions for bus factor number of top organizations/users.</li>\n<li><code>Bus Factor</code>: List of organizations/users which belong to the calculated bus factor.</li>\n<li>This is truncated at 10, so if the bus factor is > 10 then only 1st 10 will show (otherwise cell value will be too long, as is quite rare to have a bus factor > 10, so not a big limitation, and I can eventually change it if needed).</li>\n<li><code>Oth. #</code>: Count of the remaining users/organizations (those not in the bus factor, the remaining tail length).</li>\n<li><code>Oth. %</code>: Percent of remaining contributions.</li>\n<li><code>Top 10 %</code>: How many percent contributions are coming from the top 10 organizations/users (if this is 100% then it can be from less than 10 - it can happen that only 4 organizations contribute to a project in a given time period for example).</li>\n<li><code>Top</code>: Top 10 companies/users listed (there can be less than 10).</li>\n<li><code>Rem. #</code>: Count of the remaining companies/users outside of top 10 (can be 0).</li>\n<li><code>Rem. %</code>: Percent of contributions from companies/users outside of top 10.</li>\n</ul>"
        },
        "datasource": {
          "type": "postgres",
          "uid": "P172949F98CB31475"
        },
        "definition": "select value_s from gha_vars where name = 'bus_factor_docs_html'",
        "hide": 2,
        "includeAll": false,
        "multi": false,
        "name": "docs",
        "options": [],
        "query": "select value_s from gha_vars where name = 'bus_factor_docs_html'",
        "refresh": 1,
        "regex": "",
        "skipUrlSync": true,
        "sort": 0,
        "tagValuesQuery": "",
        "tagsQuery": "",
        "type": "query",
        "useTags": false
      },
      {
        "current": {
          "selected": false,
          "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": "commitcomments"
          },
          {
            "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": "issuecomments"
          },
          {
            "selected": false,
            "text": "Issues",
            "value": "issues"
          },
          {
            "selected": false,
            "text": "PRs",
            "value": "prs"
          },
          {
            "selected": false,
            "text": "Merged PRs",
            "value": "mergedprs"
          },
          {
            "selected": false,
            "text": "Review comments",
            "value": "reviewcomments"
          },
          {
            "selected": false,
            "text": "Reviews submitted",
            "value": "reviews"
          },
          {
            "selected": true,
            "text": "Contributions",
            "value": "contributions"
          },
          {
            "selected": false,
            "text": "Active repositories",
            "value": "activerepos"
          }
        ],
        "query": "comments,commitcomments,commits,events,pushes,contributions,issuecomments,issues,prs,mergedprs,reviewcomments,activerepos,reviews",
        "queryValue": "",
        "skipUrlSync": false,
        "type": "custom"
      },
      {
        "current": {
          "selected": true,
          "text": "Organizations",
          "value": "org"
        },
        "hide": 0,
        "includeAll": false,
        "label": "Type",
        "multi": false,
        "name": "typ",
        "options": [
          {
            "selected": true,
            "text": "Organizations",
            "value": "org"
          },
          {
            "selected": false,
            "text": "Users",
            "value": "usr"
          }
        ],
        "query": "org,usr",
        "queryValue": "",
        "skipUrlSync": false,
        "type": "custom"
      }
    ]
  },
  "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": "Elephant/Bus Factor in Repository Groups",
  "uid": "84",
  "version": 2,
  "weekStart": ""
}
