Skip to content

Use timeit.default_timer instead of time.time - #106

Merged
brian-brazil merged 1 commit into
prometheus:masterfrom
acdha:use-timeit
Oct 3, 2016
Merged

brian-brazil merged 1 commit into
prometheus:masterfrom
acdha:use-timeit

Conversation

@acdha

@acdha acdha commented Oct 3, 2016

Copy link
Copy Markdown
Contributor

On Python 3, this uses time.perf_counter on all platforms.

On Python 2, it will use time.clock on Windows and time.time everywhere else

On Python 3, this uses time.perf_counter.

On Python 2, it will use time.clock on Windows and time.time
everywhere else
@brian-brazil
brian-brazil merged commit bde3259 into prometheus:master Oct 3, 2016
@brian-brazil

Copy link
Copy Markdown
Contributor

Thanks!

@melnikk

melnikk commented Jul 5, 2017

Copy link
Copy Markdown
Contributor

Just FYI, this leads to short timestamp on my system (Centos 7.3, python 3.4.5):

process_resident_memory_bytes 30285824.0 160435

Graphite drops that metrics, and, as a workaround, I had to switch back from default_timer:

gb = GraphiteBridge((GRAPHITE_HOST, GRAPHITE_PORT), _timer=time.time)

@brian-brazil

Copy link
Copy Markdown
Contributor

That would be a bug, would you like to send a PR switching that one back to time.time?

@melnikk

melnikk commented Jul 5, 2017

Copy link
Copy Markdown
Contributor

@brian-brazil, sure, PR #175

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants