#metrics #git #commit #notes #store #display #tags

app git-metrics

A git extension to store metrics directly in git, using the notes

3 releases

0.1.2 Jun 4, 2024
0.1.1 May 28, 2024
0.1.0 May 19, 2024

#3 in #notes

Download history 80/week @ 2024-05-13 104/week @ 2024-05-20 162/week @ 2024-05-27 159/week @ 2024-06-03

505 downloads per month

MIT license

81KB
2.5K SLoC

Git Metrics

Right now, if you want to track the evolution of some metrics for your project over time, you need an external tool to store those metrics. But these metrics could be stored withing the git repository. Git provides a mechanism of notes that git-metrics simplifies.

How to install

From sources

cargo install --git https://github.com/jdrouet/git-metrics

How to use it

# fetch the remote metrics
$ git metrics pull
# add a new metric
$ git metrics add binary-size \
    --tag "platform.arch: amd64" \
    --tag "unit: byte" \
    1024.0
# push the metrics to remote
$ git metrics push
# log all the metrics for the past commits
$ git metrics log --filter-empty
# display the metrics on current commit
$ git metrics show
binary-size{platform.arch="amd64", unit="byte"} 1024.0
# display the metrics difference between commits
$ git metrics diff HEAD~2..HEAD
- binary-size{platform.arch="amd64", unit="byte"} 512.0
+ binary-size{platform.arch="amd64", unit="byte"} 1024.0 (+200.00 %)

Project goals

  • git-metrics show displays the metrics to the current commit
  • git-metrics add adds a metric to the current commit
  • git-metrics remove removes a metric from the current commit
  • git-metrics fetch fetches the metrics
  • git-metrics push pushes the metrics
  • git-metrics log displays the metrics for the last commits
  • git-metrics diff computes the diff of the metrics between 2 commits
  • git-metrics page generates a web page with charts for every metrics

Dependencies

~3–16MB
~169K SLoC