10K_children.py 467 B

12345678910111213141516171819
  1. #!/usr/bin/env python
  2. import arrow
  3. import requests
  4. # Generate 10,000 children of root node.
  5. requests.put('http://localhost:5000/ldp/pomegranate')
  6. start = arrow.utcnow()
  7. for i in range(1, 10000):
  8. requests.post('http://localhost:5000/ldp/pomegranate')
  9. if i % 100 == 0:
  10. tdelta = arrow.utcnow() - start
  11. print('Record: \t{} Time elapsed: \t{}'.format(i, tdelta))
  12. tdelta = arrow.utcnow() - start
  13. print('Total elapsed time: {}'.format(tdelta))