Instrument last Git write operation per user
Problem to solve
Repository write operations are the smallest unit of measure for user activity in the Create stage. To track AMAU (Action Monthly Active Users) for the Create stage, we want to know how many users are performing repository write operations.
Tracking the number of commits pushed is a harder metric to track than the timestamp of the last write operation. This is because some write operations might rewrite history, others might create a new branch but not actually add a commit. All of these are write operations, which means they trigger the internal API to verify if the user has write permissions to the repo/branch. This gives us enough data to work out how many users are doing write activities on repositories.
When Gitaly receives a write operation, Gitaly calls the internal API to check if writes are permitted by that user.
We can use this API call to track when the last write operation occurred.
The usage ping should contain a count of the number of users who performed a repository write operation in the last month.