-
-
Notifications
You must be signed in to change notification settings - Fork 173
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
File statistics #80
Comments
Great feature request. I'm thinking of adding another bar- or pie chart for this. However, the file statistics should be project-specific, otherwise, things would become too messy. There could be a drop-down to select a specific project for which file statistics are shown then. |
Honestly, this is more than perfect. File statistics per project will be extremely useful but statistics for all files in general won't be that helpful, in my opinion. |
I'll add this feature to my project roadmap. But please be aware that this is a change of more than just a few lines of code, as a whole new SummaryType will have to be introduced, so it might take a bit. |
No worries, I know how FOSS projects, developed by one guy go. Also, is the file data being collected right now (and just not displayed)? |
Yes, every heartbeat sent by the Wakatime CLI contains an |
What would you like to be considered a "file"? A raw heartbeat looks like so: [
{
"time": 1610092483.0600193,
"entity": "/home/ferdinand/dev/website-watcher-script/adapters/email.py",
"type": "file",
"category": null,
"is_write": false,
"project": "website-watcher",
"branch": "master",
"language": "Python",
"dependencies": [],
"lines": 77,
"lineno": null,
"cursorpos": null,
"user_agent": "wakatime/13.0.7 (Linux-5.9.16-200.fc33.x86_64-x86_64-with-glibc2.4) Python3.8.0.final.0 vscode/1.50.1 vscode-wakatime/5.0.0"
}
] Probably it would be cool to have a file path relative to the project root, i.e. Would this still be acceptable for you? Or do you have any further ideas? |
This would be great. Just a question: How would editing the same project on different machines would be handled? Especially when the project is in a different path? |
The easiest way would be to aggregate by the unique, absolute file paths. However, editing the same file on two different computers under two different paths would result in it being considered two separate files. I.e. If you can come up with a smarter solution how to address this issues, feel free to share your thoughts. |
Well the only thing doable for me is taking the project field of the heartbeat into account. This would mean comparing filepaths from the right and summarizing heartbeats when they have the same project. Although this would cause issues when you e.g. have the same filename in multiple directories as we don't have a project path. |
Yes, right, the project name is not necessarily an infix of the file's path. You could well have a project called |
Another why I could imagine is additionally taking the machine field into account. Then grouping by project is possible as the project path is available (calculatable by evaluating all file paths + project + machine and taking the path beginning equal for all file paths). Although this would cause issues with the WSL as the machine name is the same but a different file system and therefore other paths might be used. But I think thats okay, as one might solve this using (project maps)? |
I revisited this issue while planning the feature for v2. Just for the record, what WakaTime does is group file paths by projects and ignore the fact that those paths may vary for same project on different machines. Here's an example from the durations endpoint: {
"branches": [],
"data": [
{
"branch": "",
"dependencies": [],
"duration": 19.376436,
"entity": "/tmp/my-new-project-1/src/index.js",
"language": "JavaScript",
"project": "my-new-project-1",
"time": 1634130204.408579,
"type": "file"
},
{
"branch": "",
"dependencies": [],
"duration": 70.211374,
"entity": "/tmp/my-new-project-1/src/utils.js",
"language": "JavaScript",
"project": "my-new-project-1",
"time": 1634130223.785015,
"type": "file"
},
{
"branch": "",
"dependencies": [],
"duration": 6.22923,
"entity": "/home/ferdinand/dev/my-new-project-1/src/index.js",
"language": "JavaScript",
"project": "my-new-project-1",
"time": 1634130293.996389,
"type": "file"
},
{
"branch": "",
"dependencies": [],
"duration": 3.001593,
"entity": "/home/ferdinand/dev/my-new-project-1/src/app.js",
"language": "JavaScript",
"project": "my-new-project-1",
"time": 1634130300.225619,
"type": "file"
}
],
"end": "2021-10-13T21:59:59Z",
"start": "2021-10-12T22:00:00Z",
"timezone": "Europe/Berlin"
} I want to implement this the same way. Files without a project ( |
I thought about this again and decided that Wakapi is not going to implement file statistics. Sorry for all shattered hopes. |
File statistics are required in order to display domains / web pages for the Chrome / Firefox plugin. I guess we'll add them in, after all. Implementation will be analogously to branches. Also, in WakaTime Can't give a promise about how soon I'll get to this, though. Sorry! |
I would like to be able to get info for how long I've been working on a given file, not only on a given project. This is especially important for the "unknown" project.
The text was updated successfully, but these errors were encountered: