Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Take diff size into account when estimating first commit work in each session #72

Open
rMazeiks opened this issue Oct 4, 2022 · 0 comments

Comments

@rMazeiks
Copy link

rMazeiks commented Oct 4, 2022

For the first commit of each "coding session", we cannot tell how much time was spent on it based on the timestamps alone. Currently, the algorithm simply uses a constant to estimate the work for those commits. I believe better estimates can be easily made.

Proposed algorithm:

  • Group commits into commit sessions, separating where time between commits > 2h (same as current algorithm)
  • Estimate average time to edit a line of code:
    • let known_work be the set of commits with known hours of work (i.e., all but the first commit in each session)
    • average time to edit a line of code = total lines edited in known_work / total time spent in known_work
  • Estimate total time spent:
    • For the first commit in each session, multiply the number of lines changed in that commit by the average time to edit a line of code
    • For other commits, assume the entire duration since the last commit was spent working (same as current algorithm)

Other considerations and alternatives:

  • Instead of time per line, we could use time per character or other metric
  • Instead of estimating hours of work based on time per line, we could assume that the time spent on the first commit in a session would be similar to the time spent on other commits.
  • For first commits, the estimated time may be capped by the duration since last commit
  • Current algorithms assume there is 1 author if I understand correctly. Would be nice to compute time per-author. Not only would this be a more detailed metric, but it would also be more accurate, as 2 people committing at the same time shouldn't be considered a single session.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant