hangxingliu / vscode-coding-tracker

:clock10: A coding activities tracker(time, file, type)
GNU General Public License v3.0
169 stars 36 forks source link

Nice project #1

Closed ted-piotrowski closed 7 years ago

ted-piotrowski commented 7 years ago

Thanks, I've been using your extension to track my coding times this week. It's worked great.

I wanted to run some analysis on the data I've collected and noticed that you opted for a custom data format YYMDDHHMMSS instead of using a timestamp. I was curious why you decided to use a custom format when many utilities/libraries work natively with timestamps. Is it because it was more human readable or something else?

I would recommend you return back to timestamps because if people want to parse/analyze the data they can use existing utilities instead of having to parse the custom date format. Also, timestamps are universal across timezones, where DateTime formats are specific to a single timezone. Cheers!

hangxingliu commented 7 years ago

Hello Ted,

Thanks for your using and your advice. Actually, I had long time don't update this extension because studying and working on my hands. So I delayed its develop to 4 or 5 days after today(winter holiday). Return to your issue, I don't remember exactly the reason why I change timestamp to datetime format string. But maybe two reasons following

  1. I was sleeping less that time
  2. I want to easy to split daliy activity(1 week analyze, 30 days analyze like what things WakaTime do) by using C language(actually I don't know C language deeply and I was using C to archive some algorithm questions).

And I think using timestamp maybe better than datetime format after reading your description. Some I decided to change it in next version work(4 or 5 days after today) included web visual analyze tools.

And you can give me issue or email if you have more good advice or you want to joining this project/ visual tools develop or other developing things.

Cheers!

Liu Yue

ted-piotrowski commented 7 years ago

Hi Liu,

Working on the code, maybe you used datetime to name individual files. I made some modifications to keep naming the files with datetime, but then to use timestamp inside the files themselves.

In regards to analyzing 30 days/one week, I think you can still do this with timestamp approach because each file contains one day of work.

Cheers.

hangxingliu commented 7 years ago

Hello Ted, Thanks for your advice and codes. Timestamp instead of date time format string in latest version 0.1.5. And there new storage and upload version in version 0.1.5.(include tracking computer ID to recognize which computer you code more and storage file upgrade util in the server side)

ted-piotrowski commented 7 years ago

Thanks for the quick release Liu. I am upgrading now and will let you know if the time totals become more accurate. I just wanted to inform you of another strange behavior which you may have fixed in your latest release but I will tell you anyways. In the database log files I often see duplicate entries: same timestamp and duration. Not sure why this happens. Here is an excerpt of one of my log files:

2.0     
0   1484778331830   7779
0   1484778345958   7338
0   1484778353296   256369
2   1484778610218   1000
2   1484778610218   1000
2   1484778643066   1000
2   1484780674208   1000
2   1484780891892   2000
2   1484780891892   2000

Thank you for taking time to improve this extension.

hangxingliu commented 7 years ago

Haha! You found this bug. Yes, I have fixed this bug in version 0.1.5.

The reason why this bug happens is because that I careless and VSCode upgrade. First one is I had not use deeply copy and second one is VSCode latest version will emit a document content changed event when you switch to another file (if this file in under a git version control folder).

My suggestion is you could ignore or delete old record files if you could find too many faults like you mention above and I am very sorry for that.

And If you want to keep them is all right, because the latest server program will automatic upgrade old version database file to latest database format.

hangxingliu commented 7 years ago

@ted-piotrowski Version 0.2.0 server of this extension has published. You can have a try latest server program included beta visual report page. In repositoryvscode-coding-tracker-server. And welcome give me some advice or report me some bug.

ted-piotrowski commented 7 years ago

@hangxingliu I installed version 0.3.0 but I do not think it works. It says I no longer need to start the server just set codingTracker.localServerMode: true which I have done. However, when I try to execute commands such as show your coding activities report VSCode just gives me an error. Also, I do not see anything about Time Tracking in the bottom status bar as I did before when I installed the extension. Maybe your local environment has something that is missing in mine?

screen shot 2017-02-03 at 11 08 59 pm

hangxingliu commented 7 years ago

@ted-piotrowski Hello, Ted. Could you give me more information about this bug. I think maybe the extension init function has throw an error so has not register the command. So could you restart your VSCode and open Developer Tools Window in help menu item and get some error information in its console to me? Because It is working good in my VSCode. Thanks

hangxingliu commented 7 years ago

@ted-piotrowski I think that I have fixed it. You can try to upgrade to latest version. I have test it on my ubuntu laptop and windows laptop (windows laptop has initialized develop environment and it was passing)

ted-piotrowski commented 7 years ago

Sorry for the poor bug report. I forgot VSCode is an electron app and I could just look in the developer tools 😞

It looks like it could not resolve the request module. However, I can confirm that 0.3.2 works!! Thank you for the quick fix. The visuals look great.