This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Thu Feb 9 15:21:26 [conn60] command admin.$cmd command: { applyOps: [ { ts: Timestamp 1328818874000|1, h: -823979429724744787, op: "i", ns: "test.test", o: { _id: ObjectId('4f342abab09cc797e9f6ce89') } } ] } ntoreturn:1 reslen:50 0ms | |
PRIMARY> use local | |
switched to db local | |
PRIMARY> db.oplog.rs.find() | |
{ "ts" : { "t" : 1328818308000, "i" : 1 }, "h" : NumberLong(0), "op" : "n", "ns" : "", "o" : { "msg" : "initiating set" } } | |
{ "ts" : { "t" : 1328818529000, "i" : 1 }, "h" : NumberLong("4789225745807310865"), "op" : "i", "ns" : "test.test", "o" : { "_id" : ObjectId("4f33f724b09cc797e9f6ce87") } } | |
{ "ts" : { "t" : 1328818541000, "i" : 1 }, "h" : NumberLong("8176887930741101556"), "op" : "c", "ns" : "admin.$cmd", "o" : { "applyOps" : [ { "ts" : { "t" : 1328805668000, "i" : 1 }, "h" : NumberLong("4788286707042615313"), "op" : "i", "ns" : "test.test", "o" : { "_id" : ObjectId("4f33f724b09cc797e9f6ce87") } } ] } } | |
{ "ts" : { "t" : 1328818575000, "i" : 1 }, "h" : NumberLong("7782250113577456557"), "op" : "c" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ mongo --port 4000 | |
MongoDB shell version: 2.0.2 | |
connecting to: 127.0.0.1:4000/test | |
PRIMARY> db.test.insert({'foo':'bar'}) | |
PRIMARY> use local | |
PRIMARY> db.oplog.rs.find().sort({$natural:-1}) | |
{ "ts" : { "t" : 1329058902000, "i" : 1 }, "h" : NumberLong("-9209932462579884476"), "op" : "i", "ns" : "test.test", "o" : { "_id" : ObjectId("4f37d45611558d5848a3d21a"), "foo" : "bar" } } | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import thread | |
from thread import _local as local | |
import time | |
class Reaper(object): | |
def __init__(self, pool, sock): | |
self.pool = pool | |
self.sock = sock | |
def __del__(self): | |
print 'E.__del__' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<class 'pymongo.pool.SocketInfo'> SocketInfo(<socket._socketobject object at 0x2156930>, <pymongo.pool.Pool object at 0x2159670>) at 3 ... | |
| <type 'frame'> <frame object at 0xa24810> | |
| | <type 'frame'> <frame object at 0x467910> | |
| | | <type 'list'> [<frame object at 0xa24810>, {'sock_info': SocketInfo(<socket._socketobject object at 0x2156930>, <p ... | |
| | | | <type 'listiterator'> <listiterator object at 0x2159750> | |
| | | | | <type 'frame'> <frame object at 0xa24c10> | |
| | | | | | <type 'list'> [<listiterator object at 0x2159750>, [<frame object at 0x467910>, [<frame object at 0xa24810>, {'soc ... | |
| | | | | | <type 'frame'> <frame object at 0x467220> | |
| | | | | | <type 'list'> [<frame object at 0xa24c10>, [<listiterator object at 0x2159750>, [<frame object at 0x467910>, [<fra ... | |
| | | | | | <type 'frame'> <frame object at 0xa24e10> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import shutil | |
import threading | |
import sys | |
import time | |
import pymongo | |
import re | |
# Two steps: 1. run the test. 2. parse the log. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os, time, functools, types, unittest | |
from tornado import gen, ioloop | |
import asyncmongo | |
import asyncmongo.errors | |
def async_test_engine(timeout_sec=5): | |
if not isinstance(timeout_sec, int) and not isinstance(timeout_sec, float): | |
raise TypeError( | |
"Expected int or float, got %s\n" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from tornado import ioloop, testing | |
import asyncmongo | |
import asyncmongo.errors | |
class MyTestCase(testing.AsyncTestCase): | |
def get_new_ioloop(self): | |
# See discussion at | |
# https://groups.google.com/d/msg/python-tornado/2xLfv0hhi54/CFIfX4WqLaAJ | |
return ioloop.IOLoop.instance() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.Calendar; | |
import java.util.TimeZone; | |
import java.util.List; | |
import java.util.Set; | |
import java.util.ArrayList; | |
import com.mongodb.Mongo; | |
import com.mongodb.DB; | |
import com.mongodb.DBCollection; | |
import com.mongodb.BasicDBObject; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import random | |
import threading | |
import os | |
import unittest | |
from gevent import Greenlet, monkey | |
from pymongo.connection import Connection | |
DB = "pymongo-pooling-tests" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os, random, string | |
nobjs = int(1e7) | |
objsz = 1 | |
print 'str catenation' | |
s = '' | |
for i in range(nobjs): |
OlderNewer