Git Product home page Git Product logo

Comments (5)

pklaus avatar pklaus commented on September 23, 2024

Thanks. I agree. But it seems that with Python v3.3 time.time()'s use is now deprecated. Instead, time.process_time() or time.perf_counter() should be used. I need to give it some thought. If you have a quick fix, fell free to provide my with a patch or pull request.

from wsgi-request-logger.

haufes avatar haufes commented on September 23, 2024

I'm in python2.7. Is time.time() deprecated in 3.3? I didn't see that in the docs.

If so, what I would do is abstract the time call in call and have the init test what runtime is being used and set the method that will be called for the timer.

from wsgi-request-logger.

pklaus avatar pklaus commented on September 23, 2024

Oops, yes, you're right. It's not time.time() that's deprecated but time.clock() and thus the one being currently used to calculcate the runtime in wsgi-request-logger.
Should the runtime of the script stand for actual time passed or for the CPU time spent on the process?

from wsgi-request-logger.

haufes avatar haufes commented on September 23, 2024

I would think time passed, if it's just the process you would miss anything that is offloaded to an other process. As well in my system time.time is giving me 6 decimal places where as time.clock is only 3. I have a lot of calls that are reported to be 0ms

from wsgi-request-logger.

pklaus avatar pklaus commented on September 23, 2024

In 963b2e7 I fixed this now. The updated version 0.4.3 is on PyPI. You can install it with

pip install --upgrade wsgi-request-logger

(I'm now using time.perf_counter() where it's available and time.time() as a backup. The actual time passed is what you want as this is the one related to user experience on your web site. If you want to benchmark CPU time spend on the script you would have to use Python 3.3+ and use [https://docs.python.org/3/library/time.html#time.process_time](time.process_time() as clock.)

from wsgi-request-logger.

Related Issues (12)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.