8000 Use timeit.default_timer instead of time.time by acdha · Pull Request #106 · prometheus/client_python · GitHub
[go: up one dir, main page]

Skip to content

Use timeit.default_timer instead of time.time #106

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 3, 2016

Conversation

acdha
Copy link
Contributor
@acdha acdha commented Oct 3, 2016

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
Contributor

Thanks!

@melnikk
Copy link
Contributor
melnikk commented Jul 5, 2017

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
Contributor

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

@melnikk
Copy link
Contributor
melnikk commented Jul 5, 2017

@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
0