1
0
mirror of synced 2025-12-19 09:57:42 -05:00

[2025-12-5] Build Lines of Code Metrics into the Copilot Usage Metrics Enterprise Dashboard [public preview] (#58673)

This commit is contained in:
Sophie
2025-12-03 14:01:21 +01:00
committed by GitHub
parent 3cecb5b9b2
commit 97b71c20d7
8 changed files with 87 additions and 21 deletions

View File

@@ -25,6 +25,7 @@ Metrics are available through:
* The {% data variables.product.prodname_copilot_short %} usage metrics APIs, which provide detailed, user-level data you can export for further analysis.
* The {% data variables.product.prodname_copilot_short %} usage metrics dashboard, which visualizes 28-day usage trends across your enterprise.
* The code generation dashboard, which breaks down how code is being generated by users and agents across your enterprise.
* The {% data variables.product.prodname_copilot_short %} usage metrics NDJSON export, which offers raw data for custom BI tools or long-term storage.
For a complete list of available metrics and data fields, see [AUTOTITLE](/copilot/reference/copilot-usage-metrics).
@@ -89,6 +90,8 @@ Look for patterns across these signals rather than focusing on any single number
## Next steps
Now that you understand what each {% data variables.product.prodname_copilot_short %} metric measures and how to use them, you can explore the dashboard to see these metrics in action.
Now that you understand what each {% data variables.product.prodname_copilot_short %} metric measures and how to use them, you can explore the dashboards to see these metrics in action.
To learn how to access and interpret these metrics in the {% data variables.product.prodname_copilot_short %} usage metrics dashboard, see [AUTOTITLE](/copilot/how-tos/administer-copilot/manage-for-enterprise/view-usage-and-adoption).
* To view adoption and usage trends across your enterprise, see [AUTOTITLE](/copilot/how-tos/administer-copilot/manage-for-enterprise/view-usage-and-adoption).
* To analyze how code is being generated by users and agents, see [AUTOTITLE](/copilot/how-tos/administer-copilot/manage-for-enterprise/view-code-generation).
* To access these metrics programmatically, see [AUTOTITLE](/rest/copilot/copilot-usage-metrics).

View File

@@ -13,6 +13,7 @@ children:
- /manage-agents
- /manage-spark
- /view-usage-and-adoption
- /view-code-generation
- /use-your-own-api-keys
redirect_from:
- /copilot/managing-copilot/managing-copilot-for-your-enterprise

View File

@@ -0,0 +1,42 @@
---
title: Viewing the code generation dashboard
shortTitle: View code generation
intro: You can use the code generation dashboard to monitor how {% data variables.product.prodname_copilot_short %} generates code across your enterprise, including activity from both users and agents.
permissions: '{% data reusables.copilot.usage-metrics-permissions %}'
versions:
feature: copilot
topics:
- Copilot
contentType: how-tos
allowTitleToDifferFromFilename: true
---
{% data reusables.copilot.usage-metrics-preview %}
The code generation dashboard shows how {% data variables.product.prodname_copilot_short %} is generating code across your enterprise. By comparing user-initiated and agent-initiated activity across models, languages, and modes, you can see how teams are adopting AI-assisted and agent-driven development.
## Prerequisite
"{% data variables.product.prodname_copilot_short %} usage metrics" must be enabled on the AI Control tab. See [AUTOTITLE](/copilot/how-tos/administer-copilot/manage-for-enterprise/manage-enterprise-policies#defining-policies-for-your-enterprise).
## Accessing the dashboard
{% data reusables.copilot.access-copilot-metrics-dashboard %}
1. In the left sidebar, click **Code generation**.
## What you can view
The dashboard shows aggregated code generation activity across your enterprise, including:
* **Lines of code changed with AI**. The total lines of code added and deleted across all modes.
* **User-initiated code changes**. Lines suggested or manually added through completions and chat actions.
* **Agent-initiated code changes**. Lines automatically added or deleted by agents across edit, agent, and custom modes.
* **Activity by model and language**. User-initiated and agent-initiated activity grouped by model and language.
For a full list of available metrics and definitions, see [AUTOTITLE](/copilot/reference/copilot-usage-metrics/copilot-usage-metrics#code-generation-dashboard-metrics).
## Next steps
* To explore adoption and usage trends across your enterprise, see [AUTOTITLE](/copilot/how-tos/administer-copilot/manage-for-enterprise/view-usage-and-adoption).
* To understand how Lines of Code (LoC) metrics are measured and what affects their accuracy and coverage, see [AUTOTITLE](/copilot/reference/copilot-usage-metrics/lines-of-code-metrics).
* To access usage data programmatically, see [AUTOTITLE](/rest/copilot/copilot-usage-metrics).

View File

@@ -1,7 +1,7 @@
---
title: Viewing the Copilot usage metrics dashboard
shortTitle: View usage and adoption
intro: You can use the {% data variables.product.prodname_copilot_short %} usage metrics dashboard to monitor adoption and usage trends across your enterprise.
intro: You can use the {% data variables.product.prodname_copilot_short %} usage metrics dashboard to monitor how developers across your enterprise are adopting and using {% data variables.product.prodname_copilot_short %}.
permissions: '{% data reusables.copilot.usage-metrics-permissions %}'
versions:
feature: copilot
@@ -22,6 +22,7 @@ After your initial rollout, the {% data variables.product.prodname_copilot_short
## Accessing the dashboard
{% data reusables.copilot.access-copilot-metrics-dashboard %}
1. In the left sidebar, click **{% data variables.product.prodname_copilot_short %} usage**.
Data in the dashboard is based only on IDE telemetry and may appear up to three full UTC days behind the current date. See [AUTOTITLE](/copilot/concepts/copilot-metrics#data-freshness).
@@ -38,3 +39,4 @@ For deeper analysis, you can export NDJSON reports from the dashboard and use {%
* To learn how to interpret the data in each chart and act on usage trends, see [AUTOTITLE](/copilot/reference/interpret-copilot-metrics).
* To learn how to track license activation and initial usage of {% data variables.product.prodname_copilot %} with usage metrics, see [AUTOTITLE](/copilot/tutorials/roll-out-at-scale/assign-licenses/track-usage-and-adoption).
* To access usage data programmatically, see [AUTOTITLE](/rest/copilot/copilot-usage-metrics).

View File

@@ -15,11 +15,11 @@ topics:
{% data reusables.copilot.usage-metrics-preview %}
The {% data variables.product.prodname_copilot_short %} usage metrics dashboard and APIs display and export data using a consistent set of fields. This reference lists all available metrics and describes how to interpret their values in both dashboard visuals and NDJSON or API exports.
The {% data variables.product.prodname_copilot_short %} usage metrics dashboard and APIs display and export data using a consistent set of fields. This reference lists all available metrics and describes how to interpret their values in both dashboard visuals and NDJSON or API exports. To retrieve this data programmatically, see [AUTOTITLE](/rest/copilot/copilot-usage-metrics).
For guidance on how to read and interpret these metrics, see [AUTOTITLE](/copilot/concepts/copilot-metrics).
## Dashboard metrics
## {% data variables.product.prodname_copilot_short %} usage dashboard metrics
These metrics appear directly in the {% data variables.product.prodname_copilot_short %} usage dashboard.
@@ -41,10 +41,26 @@ These metrics appear directly in the {% data variables.product.prodname_copilot_
| Most used chat model | The most frequently used chat model in the current calendar month. |
| Requests per chat mode | Number of chat requests by mode (Ask, Edit, Agent). |
## Code generation dashboard metrics
These metrics appear in the code generation dashboard and provide a breakdown of how code is being generated across user-initiated and agent-initiated activity. All values are derived from lines of code (LoC) added or deleted in the IDE.
| Metric | Description |
|:--|:--|
| Lines of code changed with AI | Total lines of code added and deleted across all modes during the current calendar month. |
| Agent contribution | Percentage of lines of code added and deleted by agents (including Edit, Agent, and custom modes) during the current calendar month. |
| Average lines deleted by agent | Average number of lines automatically deleted by agents on behalf of active users during the current calendar month. |
| Daily total of lines added and deleted | Total number of lines added to and deleted from the codebase across all modes for each day. |
| User-initiated code changes | Lines suggested or manually added by users through code completions and chat panel actions (insert, copy, or apply). |
| Agent-initiated code changes | Lines automatically added to or deleted from the codebase by agents on behalf of users across Edit, Agent, and custom modes. |
| User-initiated code changes per model | User-initiated lines of code, grouped by model used in the IDE. |
| Agent-initiated code changes per model | Agent-initiated lines of code, grouped by model performing the agent actions. |
| User-initiated code changes per language | User-initiated lines of code, grouped by programming language. |
| Agent-initiated code changes per language | Agent-initiated lines of code, grouped by programming language. |
## API and export fields
These fields appear in the exported NDJSON reports and in the {% data variables.product.prodname_copilot_short %} usage metrics APIs.
They provide granular daily records for each user in the enterprise.
These fields appear in the exported NDJSON reports and in the {% data variables.product.prodname_copilot_short %} usage metrics APIs. They provide granular daily records for each user in the enterprise.
| Field | Description |
|:--|:--|

View File

@@ -14,10 +14,12 @@ redirect_from:
- /copilot/reference/interpret-copilot-metrics
---
>[!NOTE] The {% data variables.product.prodname_copilot %} usage metrics dashboard is currently in {% data variables.release-phases.public_preview %} and subject to change.
>[!NOTE] The {% data variables.product.prodname_copilot_short %} usage metrics dashboard is currently in {% data variables.release-phases.public_preview %} and subject to change.
After youve viewed usage data in the {% data variables.product.prodname_copilot_short %} usage metrics dashboard, you can use this article to interpret what each chart means and identify opportunities to increase adoption and engagement across your enterprise.
You can also access these metrics programmatically through the {% data variables.product.prodname_copilot_short %} usage metrics REST API, see [AUTOTITLE](/rest/copilot/copilot-usage-metrics).
## Reviewing overall usage trends
Use the main usage charts in the dashboard to understand overall adoption and engagement patterns across your enterprise. These charts help you identify where usage is growing, leveling off, or declining, so you can take action to maintain engagement.

View File

@@ -16,7 +16,19 @@ allowTitleToDifferFromFilename: true
{% data reusables.copilot.usage-metrics-preview %}
Lines of Code (LoC) metrics offer a directional way to measure {% data variables.product.prodname_copilot_short %}s tangible output. These metrics quantify how many lines {% data variables.product.prodname_copilot_short %} suggested, added, or deleted in the editor—helping key stakeholders and decision makers understand {% data variables.product.prodname_copilot_short %}s contribution to the codebase over time.
Lines of Code (LoC) metrics provide a directional measure of {% data variables.product.prodname_copilot_short %}s output by quantifying the lines it suggested, added, or deleted across completions, chat, and agent features.
## Where LoC metrics appear
You may encounter LoC metrics in:
* **Code generation dashboard** — visualizes LoC-based user and agent activity. See [AUTOTITLE](/copilot/how-tos/administer-copilot/manage-for-enterprise/view-code-generation).
* **Exports and APIs** — expose LoC fields such as `loc_suggested_to_add_sum`, `loc_added_sum`, and `loc_deleted_sum`. See [AUTOTITLE](/rest/copilot/copilot-usage-metrics).
* **"Data available in {% data variables.product.prodname_copilot_short %} usage metrics" reference** — lists all dashboard and API fields derived from LoC. See [AUTOTITLE](/copilot/reference/copilot-usage-metrics/copilot-usage-metrics).
This article covers how LoC is measured and what affects its accuracy and coverage. For detailed definitions, refer to the reference article above.
## Considerations for LoC metrics
LoC metrics may vary across IDEs and versions. Keep the following considerations in mind:
@@ -43,17 +55,6 @@ LoC metrics require specific minimum versions of IDEs and {% data variables.prod
| | <ul><li>`chat_panel` (Ask, Edit, Agent)</li></ul> | 15.0 | 0.43.0 |
| | <ul><li>`agent_edit`</li></ul> | 15.2 | 0.41.0 |
## Available LoC metrics
LoC metrics **are** included in:
* The {% data variables.product.prodname_copilot_short %} user-level report
* The {% data variables.product.prodname_copilot_short %} usage metrics API
They are **not** included in the {% data variables.product.prodname_copilot_short %} usage metrics dashboard.
LoC metrics measure {% data variables.product.prodname_copilot_short %}s activity across completions, chat, and agent features. For detailed field descriptions and definitions, see [AUTOTITLE](/copilot/reference/copilot-usage-metrics/copilot-usage-metrics#api-and-export-fields).
## How agent mode affects LoC metrics
Unlike completions or chat, {% data variables.copilot.copilot_agent_short %} does not follow a “suggest then accept” flow. Agents plan and execute multi-step tasks, often editing multiple files iteratively without explicit acceptance by the user. Because of this, LoC metrics for agent activity are measured differently.

View File

@@ -1,3 +1,2 @@
1. Go to the [Enterprises](https://github.com/settings/enterprises) page and select your enterprise.
1. Click the **Insights** tab.
1. In the left sidebar, click **{% data variables.product.prodname_copilot_short %} usage**.