adwearing-jisc opened a new issue, #6784:
URL: https://github.com/apache/incubator-devlake/issues/6784

   ### Search before asking
   
   - [X] I had searched in the 
[issues](https://github.com/apache/incubator-devlake/issues?q=is%3Aissue) and 
found no similar issues.
   
   
   ### What happened
   
   Setup devlake connection to Azure Pipelines.
   Pipelines successfully imported with correct start and end dates.
   Mean pipeline duration is less than 1 minute, when most pipelines ran for 
over 30 minutes.
   Looking in the database, all pipelines are showing in seconds rather than 
the actual duration.
   
   ### What do you expect to happen
   
   Expect for the correct duration to be set based on the start and end time.
   
   ### How to reproduce
   
   Setup a pipeline in azure devops that runs for a few minutes (could just 
create a powershell task that sleeps for a bit)
   Run the pipeline a few times
   Setup devlake to connect to azure pipelines and collect data.
   Check imported data in database.
   Observe the duration is always in seconds, while the actual duration (end 
date - start date) is longer.
   
   
   ### Anything else
   
   Digging through code, looks like this line is the perpetrator:
   
   
https://github.com/apache/incubator-devlake/blob/b3ab61d22e3affc5b39edf266f8de7b93c1988ee/backend/python/plugins/azuredevops/azuredevops/streams/builds.py#L70
   
   `duration_sec = abs(b.finish_time.second - b.start_time.second)` should be 
`duration_sec = abs((b.finish_time - b.start_time).seconds)`
   
   ### Version
   
   v0.20.beta6
   
   ### Are you willing to submit PR?
   
   - [X] Yes I am willing to submit a PR!
   
   ### Code of Conduct
   
   - [X] I agree to follow this project's [Code of 
Conduct](https://www.apache.org/foundation/policies/conduct)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to