Coder Social home page Coder Social logo

Comments (1)

heyman avatar heyman commented on May 9, 2024

Hi!

Sorry for not replying to this sooner.

In the current master branch of locust (and soon in the 0.6 release), the old HTTP client has been replaced with a small wrapper around python-requests (http://python-requests.org). The events.request_success event has also been modified to not take a response object as argument, but rather the content-length as an integer. So if you're rolling your own client it should now be easy to trigger the request_success event and sending in the length of the response body instead of the content-length header.

We could do this change in the locust code (report the length of response.content instead of the content-length header). However, this would trigger a full body download even if the user has made the request using prefetch=False (http://docs.python-requests.org/en/latest/user/advanced/#body-content-workflow), and I'm not sure if we really want to disable that feature.

One option could be to use the length of response.content unless prefetch is set to False, in which case we try to use the content-length header, and last we fallback to 0. However, this would result in us having two different ways of getting the content size which doesn't seem optimal. Despite this, it might be the solution that would work best in most situations. Any input on this @Jahaja @cgbystrom ?

from locust.

Related Issues (20)

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.