green-coding-solutions / eco-ci-energy-estimation

Eco CI Energy estimation for Github Actions Runner VMs
MIT License
48 stars 10 forks source link

Adding time to total-data.json and lap-data.json #60

Closed nstruharova closed 4 months ago

nstruharova commented 4 months ago

Hi, I added the time (or duration) parameter to the data files. I was not sure if this is a desirable feature for anyone else, however I needed this information for my research, and I thought it may be useful for other people too.

What prompted me to add the duration was the discrepancy I noticed between the duration calculated by EcoCI and the duration of the given step provided directly by the GitHub API. I am not sure if this is a big problem, but I wanted to leave this here as well in case it is an uncaught issue.

ArneTR commented 4 months ago

Uhh, this looks nice, ty!

We are actually not using that data export too often, so I have to loop Dan in to give it a review. Looks legit for me though on first glimpse.

@dan-mm Please give it a look and merge if ok

dan-mm commented 4 months ago

Hi @nstruharova - it looks good to me! I'll merge it in after tests.

Also I think I can shed some light on the time discrepancy - the timer in Eco-CI only starts its internal timer after the initial setup, so that overhead is not attributed to the user's workflow. Additionally, the timer is reset at the end of the make_measurement step, so similarly some of Eco-CI's functionality is similarly not attributed to the user's workflow (though, as I'm taking another look at the code to verify this, the actual model run does happen within the timer, so that will be a part of it). In general, our design philosophy was that Eco-CI's functionality itself should not be a part of the energy estimation.