Advertisement
Guest User

Untitled

a guest
Mar 28th, 2013
336
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.64 KB | None | 0 0
  1. mattb@capdev2:~/src/golang $ time ./test_mongo.py
  2. 821226
  3. 426964
  4.  
  5. real    0m7.742s
  6. user    0m6.636s
  7. sys     0m0.312s
  8. mattb@capdev2:~/src/golang $ time ./test_mongo.py
  9. 821226
  10. 426964
  11.  
  12. real    0m7.889s
  13. user    0m6.768s
  14. sys     0m0.356s
  15. mattb@capdev2:~/src/golang $ time ./test_mongo.py
  16. 821226
  17. 426964
  18.  
  19. real    0m7.350s
  20. user    0m6.436s
  21. sys     0m0.340s
  22. mattb@capdev2:~/src/golang $ cat test_mongo.py
  23. #!/usr/bin/env python
  24.  
  25. import pymongo
  26.  
  27. conn = pymongo.MongoClient("127.0.0.1:27017")
  28.  
  29. tot = cnt = 0
  30. for doc in conn.logdb.log.find():
  31.     tot += 1
  32.     if doc.get('eventType') == 'VIDEO':
  33.         cnt += 1
  34.  
  35. print tot
  36. print cnt
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement