Fix: python agent: 'time' has no attribute 'clock'
authorJonathan Rajotte <jonathan.rajotte-julien@efficios.com>
Wed, 17 Jun 2020 22:40:22 +0000 (18:40 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Tue, 30 Jun 2020 15:12:17 +0000 (11:12 -0400)
commit5e15e5e8a7ac066f00e540583c4bd8f0042a3d21
tree0a16df4c940a4bf29398c51a112f7c65c9aa1db9
parenta32694f47853412174b0efe3823fc7d0af6df121
Fix: python agent: 'time' has no attribute 'clock'

The time.clock() function was removed in python 3.8 and is marked as
deprecated since python 3.3. See PEP 418 for more details [1].

Solution
=====

When the python version is greater than 3.2 use the
`time.perf_counter()` function [2]. Otherwise, fall back to
`time.clock()`.

Introduce a compat module to the lttngust agent package providing the
`_clock` function.

[1] https://www.python.org/dev/peps/pep-0418/
[2] https://docs.python.org/3/library/time.html#time.perf_counter

Signed-off-by: Jonathan Rajotte <jonathan.rajotte-julien@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Change-Id: I3d6d8b24309d45d43b634dc2a6b4d5dbc12da3aa
configure.ac
python-lttngust/lttngust/agent.py
python-lttngust/lttngust/compat.py [new file with mode: 0644]
python-lttngust/lttngust/debug.py
This page took 0.026078 seconds and 4 git commands to generate.