Skip to content

Commit 0258597

Browse files
committed
cleanup
1 parent 24b9b1d commit 0258597

File tree

4 files changed

+45
-1
lines changed

4 files changed

+45
-1
lines changed

tools/analytics/org/.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Stores cached data for GitHub API responses
2+
cache/
3+
4+
# Gets temporarily created by the script
5+
scale-config.yml

tools/analytics/org/README.md

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# Organization Analytics Tools
2+
3+
This directory contains a collection of scripts designed to analyze GitHub Actions runner usage and other organizational metrics across a GitHub organization's repositories.
4+
5+
## Overview
6+
7+
The tools in this directory help us understand how GitHub Actions runners are being utilized across our repositories.
8+
9+
## Scripts
10+
11+
### `analyze_runner_usage.py`
12+
13+
**Purpose**: Analyzes GitHub Actions runner label usage across all repositories in a specified GitHub organization.
14+
15+
**Key Features**:
16+
- Fetches all non-archived repositories in a GitHub organization
17+
- Extracts runner labels used in workflow jobs from recent workflow runs
18+
- Aggregates runner usage statistics across repositories
19+
- Compares runner labels against those defined in `scale-config.yml` and standard GitHub-hosted runners
20+
- Identifies unused or undefined runners
21+
- Generates comprehensive usage reports
22+
23+
**Output**: Creates `runner_labels_summary.yml` with detailed analytics including:
24+
- Runner usage by repository
25+
- Repository usage by runner type
26+
- Repositories with zero workflow runs
27+
- Runners not defined in scale-config or standard GitHub runners
28+
- Usage patterns and trends
29+
30+
### `cache_manager.py`
31+
32+
**Purpose**: Helper script. Provides efficient caching functionality for GitHub API responses to optimize performance and avoid rate limiting.
33+
34+
**Features**:
35+
- URL-based cache key generation
36+
- Intelligent cache invalidation
37+
- Rate limit optimization
38+
- Reduces redundant API calls during analysis
39+

tools/analytics/analyze_runner_usage.py renamed to tools/analytics/org/analyze_runner_usage.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@
6767
import yaml
6868
from dotenv import load_dotenv
6969

70-
from tools.analytics.cache_manager import CACHE_DIR, CacheManager
70+
from cache_manager import CACHE_DIR, CacheManager
7171

7272

7373
load_dotenv()

0 commit comments

Comments
 (0)