Requests Is A Popular Library To Query An HTTP Service
Submitted By Theabbo99
Words: 499
Pages: 2
Tggdxxccccfcsghhggg
Effddd
Gtgfl
School:
Course Title: (ex. Bio 101 or Algebra I)
Professor:
3. Choose how you submit
Requests is a popular library to query an HTTP service, and is widely used in the Python community.
Let’s say you want to load test the Elastic Search root page that’s running on your local host.
Write a test case like this one and save it in an example.py file:
from loads.case import TestCase
class TestWebSite(TestCase):
def test_es(self): res = self.session.get('http://localhost:9200') self.assertEqual(res.status_code, 200)
The TestCase class provided by Loads has a session attribute you can use to interact with an HTTP server. It’s a Session instance from Requests.
Hits: 1
Started: 2013-06-14 12:15:42.860586
Duration: 0.03 seconds
Approximate Average RPS: 39
Average request time: 0.01s
Opened web sockets: 0
Bytes received via web sockets : 0
Success: 1
Errors: 0
Failures: 0
This will execute your test just once - so you can control that your test works as expected.
Now, try to run it using 100 virtual users (-u), each of them running the test 10 times (–hits):
$ bin/loads-runner example.TestWebSite.test_es -u 100 --hits 10
[======================================================================] 100%
Hits: 1000
Started: 2013-06-14 12:15:06.375365
Duration: 2.02 seconds
Approximate Average RPS: 496
Average request time: 0.04s
Opened web sockets: 0
Bytes received via web sockets : 0
Success: 1000
Errors: 0
Failures: 0r
F by Joseph Glutting, Wayne Adams, David Shelow Purpose: Examines a childs level of cognitive ability by assessing both verbal and non-verbal abilities by means of verbal and visual scales
Age: 4 through to 85 yrs
Admin: Individual
Time: 20-30 minutes Intelligence consists of a general factor underpinning all purposeful thinking and behavior together with certain specific factors. It may be better defined as a person’s capacity for processing information. Intelligence is measured in terms of Intelligence Quotient (IQ).
The national average is 100 with 34% of the population having IQs between 85 and 100 and 34% of the population having IQs between 100 and 115. This is known as the 'average’ range.