Page History
...
Timing test is done for mongod running on psanaphi105 and scripts on psanagpu106.
Initialization
Code Block | ||||
---|---|---|---|---|
| ||||
import gridfs from pymongo import MongoClient #client = MongoClient('localhost') client = MongoClient('psanaphi105', 27017) db = client['calib-cxi12345'] fs = gridfs.GridFS(db) col = db['camera-0-cxids1-0'] |
...
Code Block | ||||
---|---|---|---|---|
| ||||
doc = { "experiment": "cxi12345", "run": 126, "detector": col.name, "ctype": "pedestals", "data_size": nda.size, "data_shape": nda.shape, "data_type": str(nda.dtype), "data_id": ida, ... } doc_id = col.insert_one(doc).inserted_id |
...
Insert metadata time 0.5-0.6ms.
Get
Code Block | ||||
---|---|---|---|---|
| ||||
docs = col.find({"time_stamp" : "2018-01-25T09:33:10PST"}) doc = docs[0] |
Metadata find and get time: 0.7ms
Code Block | ||||
---|---|---|---|---|
| ||||
s = fs.get(doc['data_id']).read() nda = gu.np.fromstring(s) |
...
Overview
Content Tools