1
0
mirror of synced 2025-12-23 11:54:18 -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

@@ -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.