You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Update to remove nan rows in the dataset
* Add functionality to get team history from the Github API
* add documentation of the team historic metrics
* add support for query params - since
* update docs
Copy file name to clipboardExpand all lines: docs/team_usage.md
+43Lines changed: 43 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -23,3 +23,46 @@ A user within ONSDigital. Upon authentication, the app identifies the teams they
23
23
24
24
#### Admin User
25
25
An enhanced regular user with the ability to search for any team. This user belongs to a specific whitelisted team, enabling them to view metrics for any team that meets the CoPilot usage data requirements.
26
+
27
+
## Metrics
28
+
29
+
### Team History Metrics
30
+
The team history metrics function retrieves historical usage data for each team identified with CoPilot usage. This data includes detailed metrics about the team's activity over time. New data for a team is fetched only from the last captured date in the file.
31
+
32
+
#### Functionality
33
+
-**Input**: The function in addition to the GitHub Client takes a team name, organisation and the optional "since" as a query parameter as input.
34
+
-**Process**:
35
+
- Fetches historical data for the specified team using the GitHub API.
36
+
- If the since query parameter exist then fetch data only after the specified date.
37
+
- Filters and organizes the data into a structured format.
38
+
-**Output**: A JSON object containing the team's historical metrics, including:
39
+
- Team name
40
+
- Activity data
41
+
- CoPilot usage statistics
42
+
43
+
#### Usage
44
+
The historical metrics are stored in an S3 bucket as a json file (`teams_history.json`).
45
+
46
+
#### Example
47
+
For a team named `kehdev`, the historical metrics might include:
48
+
```json
49
+
{
50
+
"team": {
51
+
"name": "kehdev",
52
+
"slug": "kehdev",
53
+
"description": "Team responsible for CI/CD pipelines",
0 commit comments