Getting a `build_started` value lower than `build_created`

I’m trying to compute some metrics from my drone database, and for most of my builds, I get a build_started value lower than the build_created and build_enqueued value. Is that normal? If not, what could possibly cause this issue?
I’m trying to compute the queue time for a build by substracting build_enqueued to build_started, but it gives me values lower than 0.

1 Like

Just noting that I have observed the same issue.

Note that when the build has not started yet, build_started defers to 0. Yet even if that case is excluded, I’m still getting a negative value. It’s hardly ever more than a few seconds though.

Note that when the build has not started yet, build_started defers to 0.

This is expected because the zero value of an integer is 0. In this case a build has not started, so the field will not have been set and will use the zero value.

I get a build_started value lower than the build_created and build_enqueued value

My first thought when hearing this is your host machine server clock is slow and you need to run NTP. The only way the started timestamp could be older than the created timestamp is if server clocks are out of sync.