Skip to content

Commit 19b1043

Browse files
committed
docs: update documentation for usage metrics
- Update README with metrics feature details - Add metrics section to command usage documentation - Update CHANGELOG with new features - Create detailed usage metrics documentation 📝 Enhance documentation to explain the new metrics functionality
1 parent 6be8d9a commit 19b1043

File tree

3 files changed

+145
-5
lines changed

3 files changed

+145
-5
lines changed

CHANGELOG.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
11
# Changelog
22

3-
## [1.0.1] - 2024-12-10
3+
## [Unreleased]
4+
### ✨ Features
5+
- ✨ feat: add local metrics and usage statistics
6+
- 🔧 fix: update console print methods in stats command
7+
- 🐛 fix: continue staging files when a file is not found or deleted
48

9+
## [1.0.1] - 2024-12-10
510

611
### 📦 Build System
712
- bump version to 1.0.1

README.md

Lines changed: 46 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ loom -y # Non-interactive mode
6161
- 🧵 **Smart Batching**: Weaves multiple changes into coherent, logical commits
6262
- 📊 **Complexity Analysis**: Identifies when commits are getting too large or complex
6363
- 💰 **Cost Control**: Built-in token and cost estimation to keep API usage efficient
64+
- 📈 **Usage Metrics**: Track your usage, cost savings, and productivity gains with built-in metrics
6465
- 🔍 **Binary Support**: Special handling for binary files with size and type detection
6566
- 🎨 **Beautiful CLI**: Rich, colorful interface with clear insights and warnings
6667

@@ -85,16 +86,38 @@ CommitLoom can be invoked using either of these commands:
8586

8687
```bash
8788
# Using the full name
88-
loom [options]
89+
loom [command] [options]
8990

9091
# Using the short alias
91-
cl [options]
92+
cl [command] [options]
9293
```
9394

94-
Both commands support the same options:
95+
#### Available Commands
96+
97+
- `loom commit` (or simply `loom`): Generate a commit message and commit your changes
98+
- `loom stats`: Display detailed usage statistics and metrics
99+
100+
#### Options
101+
95102
- `-y, --yes`: Auto-confirm all prompts (non-interactive mode)
96103
- `-c, --combine`: Combine all changes into a single commit
97-
- `-v, --verbose`: Enable verbose logging
104+
- `-d, --debug`: Enable debug logging
105+
106+
#### Usage Examples
107+
108+
```bash
109+
# Basic usage (interactive mode)
110+
loom
111+
112+
# Non-interactive mode with combined commits
113+
loom -y -c
114+
115+
# View usage statistics
116+
loom stats
117+
118+
# View debug information with statistics
119+
loom stats -d
120+
```
98121

99122
### API Key Configuration
100123

@@ -196,6 +219,25 @@ Yes! Use the `-y` flag for non-interactive mode:
196219
loom -y
197220
```
198221

222+
### How does CommitLoom track metrics and usage statistics?
223+
224+
CommitLoom keeps track of various metrics to help you understand your usage patterns:
225+
226+
- **Usage tracking**: Number of commits generated, tokens used, and associated costs
227+
- **Time savings**: Estimated time saved compared to writing commit messages manually
228+
- **Repository statistics**: Which repositories you use CommitLoom with most frequently
229+
- **Model usage**: Performance metrics for different AI models
230+
- **Cost analysis**: Detailed breakdown of token usage and associated costs
231+
232+
All metrics are stored locally in your user data directory (`~/.local/share/commitloom/metrics` on Linux) and are never sent to external servers.
233+
234+
To view your metrics, simply run:
235+
```bash
236+
loom stats
237+
```
238+
239+
For detailed documentation on the metrics system, see the [Usage Metrics Documentation](docs/usage_metrics/README.md).
240+
199241
### How does CommitLoom handle large changes?
200242

201243
CommitLoom automatically:

docs/usage_metrics/README.md

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
# CommitLoom Usage Metrics
2+
3+
CommitLoom now includes comprehensive usage metrics to help you understand your usage patterns, track costs, and measure productivity improvements.
4+
5+
## Introduction
6+
7+
The metrics system is designed to be:
8+
- **Private**: All data is stored locally; nothing is sent to external servers
9+
- **Transparent**: Clear data collection with easy access to view your metrics
10+
- **Useful**: Provides insights about cost savings, time saved, and usage patterns
11+
12+
## Available Metrics
13+
14+
CommitLoom tracks the following metrics:
15+
16+
### Basic Metrics
17+
- Total commits generated
18+
- Total tokens used
19+
- Total cost in EUR
20+
- Total files processed
21+
- Estimated time saved
22+
23+
### Repository Metrics
24+
- Most active repositories
25+
- Usage frequency by repository
26+
- File changes by repository
27+
28+
### Model Usage Metrics
29+
- Token usage by model
30+
- Cost breakdown by model
31+
- Efficiency metrics (tokens per commit, cost per file)
32+
33+
### Processing Metrics
34+
- Batch vs. single commits
35+
- Average processing time
36+
- Success rates
37+
38+
## Viewing Metrics
39+
40+
To view your metrics, use the `stats` command:
41+
42+
```bash
43+
loom stats
44+
```
45+
46+
This will display a summary of your usage statistics. To see more detailed information, you can use the debug flag:
47+
48+
```bash
49+
loom stats -d
50+
```
51+
52+
## Data Storage
53+
54+
Metrics are stored locally in the following location, based on your operating system:
55+
56+
- **Linux**: `~/.local/share/commitloom/metrics/`
57+
- **macOS**: `~/Library/Application Support/commitloom/metrics/`
58+
- **Windows**: `%APPDATA%\commitloom\metrics\`
59+
60+
The data is stored in two JSON files:
61+
- `commit_metrics.json`: Contains detailed information about each commit
62+
- `usage_statistics.json`: Contains aggregated statistics about your usage
63+
64+
## Privacy
65+
66+
CommitLoom respects your privacy:
67+
- No telemetry or data collection occurs without your knowledge
68+
- All metrics are stored locally on your machine
69+
- No data is ever sent to external servers
70+
- You can delete the metrics files at any time to reset your statistics
71+
72+
## How Time Savings Are Calculated
73+
74+
CommitLoom estimates time savings based on the assumption that writing a quality commit message manually takes approximately 3 minutes on average. The time saved is calculated as:
75+
76+
```
77+
time_saved = estimated_manual_time - actual_processing_time
78+
```
79+
80+
Where:
81+
- `estimated_manual_time` is 3 minutes (180 seconds)
82+
- `actual_processing_time` is the time taken by CommitLoom to generate the commit message
83+
84+
This provides a conservative estimate of how much time you're saving by using CommitLoom.
85+
86+
## Future Enhancements
87+
88+
In future versions, we plan to enhance the metrics system with:
89+
- Interactive visualizations
90+
- Export capabilities (CSV, JSON)
91+
- More detailed analysis by file type
92+
- Team-based aggregated statistics (while maintaining privacy)
93+
- Integration with development workflows and productivity tools

0 commit comments

Comments
 (0)