Skip to content

Commit eeecb2b

Browse files
sophiethekingCopilotlecoursen
authored
[Improvement]: Add more content about Lines of Code metrics (#58252)
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Co-authored-by: Laura Coursen <lecoursen@github.com>
1 parent 5829d2e commit eeecb2b

File tree

7 files changed

+119
-5
lines changed

7 files changed

+119
-5
lines changed

content/copilot/concepts/copilot-metrics.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,7 @@ redirect_from:
1212
- /early-access/copilot-metrics
1313
- /early-access/copilot-metrics/apis
1414
- /early-access/copilot-metrics/dashboards
15-
- /early-access/copilot-metrics/LoC
1615
- /early-access/copilot-metrics/apis/about-the-copilot-metrics-apis
17-
- /early-access/copilot-metrics/LoC/about-the-copilot-metrics-LoC
1816
- /early-access/copilot-metrics/dashboards/about-the-copilot-metrics-dashboard
1917
- /early-access/copilot-metrics/apis/rest-api-endpoints-for-copilot-enterprise-and-user-usage-metrics
2018
---

content/copilot/reference/copilot-usage-metrics.md renamed to content/copilot/reference/copilot-usage-metrics/copilot-usage-metrics.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ They provide granular daily records for each user in the enterprise.
4848

4949
| Field | Description |
5050
|:--|:--|
51+
| `agent_edit` | A dedicated bucket in the API and reports. Captures lines added and deleted directly by {% data variables.product.prodname_copilot_short %} Agent and Edit mode.<br>These are not included in suggested metrics, since agent edits don’t follow a simple suggestion to acceptance flow. |
5152
| `report_start_day` / `report_end_day` | Start and end dates for the 28-day reporting period. |
5253
| `day` | Calendar day this record represents. |
5354
| `enterprise_id` | Unique ID of the enterprise or organization. |
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
title: GitHub Copilot usage metrics
3+
shortTitle: Copilot usage metrics
4+
intro: Find information about usage metrics for {% data variables.product.prodname_copilot %}.
5+
versions:
6+
feature: copilot
7+
topics:
8+
- Copilot
9+
children:
10+
- /copilot-usage-metrics
11+
- /interpret-copilot-metrics
12+
- /reconciling-usage-metrics
13+
- /lines-of-code-metrics
14+
---

content/copilot/reference/interpret-copilot-metrics.md renamed to content/copilot/reference/copilot-usage-metrics/interpret-copilot-metrics.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ contentType: reference
1111
allowTitleToDifferFromFilename: true
1212
redirect_from:
1313
- /early-access/copilot-metrics/dashboards/interpreting-the-metrics
14+
- /copilot/reference/interpret-copilot-metrics
1415
---
1516

1617
>[!NOTE] The {% data variables.product.prodname_copilot %} usage metrics dashboard is currently in {% data variables.release-phases.public_preview %} and subject to change.
@@ -72,4 +73,5 @@ Use trends in usage, feature adoption, and language activity to guide enablement
7273
7374
## Further reading
7475

75-
To learn how to access and navigate the {% data variables.product.prodname_copilot_short %} usage metrics dashboard, see [AUTOTITLE](/copilot/how-tos/administer-copilot/manage-for-enterprise/view-usage-and-adoption).
76+
* [AUTOTITLE](/copilot/reference/copilot-usage-metrics/reconciling-usage-metrics)
77+
* [AUTOTITLE](/copilot/reference/copilot-usage-metrics/lines-of-code-metrics)
Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
---
2+
title: Lines of Code metrics
3+
shortTitle: Copilot LoC metrics
4+
intro: Understand how Lines of Code metrics measure {% data variables.product.prodname_copilot_short %}’s output and what factors affect their coverage and accuracy.
5+
permissions: Enterprise owners and billing managers
6+
versions:
7+
feature: copilot
8+
redirect_from:
9+
- /early-access/copilot-metrics/LoC
10+
- /early-access/copilot-metrics/LoC/about-the-copilot-metrics-LoC
11+
topics:
12+
- Copilot
13+
contentType: reference
14+
allowTitleToDifferFromFilename: true
15+
---
16+
17+
{% data reusables.copilot.usage-metrics-preview %}
18+
19+
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 enterprise administrators understand {% data variables.product.prodname_copilot_short %}’s contribution to the codebase over time.
20+
21+
LoC metrics may vary across IDEs and versions. Keep the following considerations in mind:
22+
23+
* **Coverage:** Not all IDEs and users will emit LoC telemetry until they upgrade to the required versions. Reports include the `last_known_ide_version` and `last_known_plugin_version` fields so you can monitor coverage across your enterprise.
24+
* **Stability:** As {% data variables.product.prodname_copilot_short %} evolves, telemetry definitions may change. Expect small shifts in data as accuracy improves over time.
25+
26+
## Version requirements
27+
28+
LoC metrics require specific minimum versions of IDEs and {% data variables.product.prodname_copilot_short %} plugins to function. Users on older versions will not contribute LoC data, which may lead to underreporting until they upgrade.
29+
30+
| IDE | Feature | Minimum IDE version | Minimum {% data variables.copilot.copilot_chat_short %} extension version |
31+
|:--|:--|:--|:--|
32+
| Eclipse | <ul><li>`code_completion`</li></ul> | 4.31 | 0.9.3.202507240902 |
33+
| | <ul><li>`chat_panel` (Ask, Edit, Agent)</li></ul> | 4.31 | 0.11.0.202508291001 |
34+
| | <ul><li>`agent_edit`</li></ul> | 4.31 | 0.10.0.202508110512 |
35+
| IntelliJ/JetBrains | <ul><li>`code_completion`</li><li>`chat_panel` (Ask, Edit, Agent)</li><li>`chat_inline`</li><li>`agent_edit`</li></ul> | 2024.2.6 | 1.5.52-241 |
36+
| {% data variables.product.prodname_vs %} | <ul><li>`code_completion`</li><li>`chat_panel` (Ask, Edit, Agent)</li></ul> | 17.14.13 | 18.0.471.29466 |
37+
| | <ul><li>`chat_inline`</li><li>`agent_edit`</li></ul> | 17.14.14 | 18.0.471.29466 |
38+
| {% data variables.product.prodname_vscode_shortname %} | <ul><li>`code_completion`</li></ul> | 1.104.0 | 0.31.0 |
39+
| | <ul><li>`chat_panel` (Ask, Edit, Agent)</li></ul> | 1.102.0 | 0.29.0 |
40+
| | <ul><li>`chat_inline`</li></ul> | 1.103.2 | 0.30.3 |
41+
| | <ul><li>`agent_edit`</li></ul> | 1.103.0 | 0.30.0 |
42+
| XCode | <ul><li>`code_completion`</li></ul> | 14.3.1 | 0.40.0 |
43+
| | <ul><li>`chat_panel` (Ask, Edit, Agent)</li></ul> | 15.0 | 0.43.0 |
44+
| | <ul><li>`agent_edit`</li></ul> | 15.2 | 0.41.0 |
45+
46+
## Available LoC metrics
47+
48+
LoC metrics **are** included in:
49+
50+
* The {% data variables.product.prodname_copilot_short %} user-level report
51+
* The {% data variables.product.prodname_copilot_short %} usage metrics API
52+
53+
They are **not** included in the {% data variables.product.prodname_copilot_short %} usage metrics dashboard.
54+
55+
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).
56+
57+
## How agent mode affects LoC metrics
58+
59+
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.
60+
61+
| Behavior | How it’s reflected in LoC metrics |
62+
|:--|:--|
63+
| Agent code suggestions | Counted as `loc_suggested_to_add_sum` when visible code blocks are shown in the chat panel. |
64+
| Agent edits in files | Counted as `loc_added_sum` and `loc_deleted_sum` under the `agent_edit` feature bucket. These edits are not included in suggested metrics. |
65+
| Multi-file operations | Each file edit contributes to total added and deleted lines, even if triggered by one prompt. |
66+
67+
Example output for agent-related LoC activity:
68+
69+
```json
70+
"totals_by_language_feature": [
71+
{
72+
"language": "unknown",
73+
"feature": "chat_panel_agent_mode",
74+
"code_generation_activity_count": 12,
75+
"code_acceptance_activity_count": 0,
76+
"loc_suggested_to_add_sum": 86, // code block suggestions in chat panel in agent mode
77+
"loc_suggested_to_delete_sum": 0,
78+
"loc_added_sum": 5, // only includes code block copy or apply in chat panel, not agent edits
79+
"loc_deleted_sum": 0
80+
},
81+
{
82+
"language": "unknown",
83+
"feature": "agent_edit",
84+
"code_generation_activity_count": 345,
85+
"code_acceptance_activity_count": 0,
86+
"loc_suggested_to_add_sum": 0,
87+
"loc_suggested_to_delete_sum": 0,
88+
"loc_added_sum": 2342, // agent and edit mode edits in files
89+
"loc_deleted_sum": 947
90+
}
91+
]
92+
```
93+
94+
For a single agent edit, you may see metrics such as:
95+
96+
```json
97+
"user_initiated_interaction_count": 0,
98+
"code_generation_activity_count": 1,
99+
"code_acceptance_activity_count": 0
100+
```

content/copilot/reference/reconciling-usage-metrics.md renamed to content/copilot/reference/copilot-usage-metrics/reconciling-usage-metrics.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ contentType: reference
1111
allowTitleToDifferFromFilename: true
1212
redirect_from:
1313
- /early-access/copilot-metrics/dashboards/best-practices-for-correlating-usage-metrics
14+
- /copilot/reference/reconciling-usage-metrics
1415
---
1516

1617
{% data reusables.copilot.usage-metrics-preview %}

content/copilot/reference/index.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,5 @@ children:
1818
- /agentic-audit-log-events
1919
- /extensions-glossary
2020
- /copilot-usage-metrics
21-
- /interpret-copilot-metrics
22-
- /reconciling-usage-metrics
2321
contentType: reference
2422
---

0 commit comments

Comments
 (0)