示例#1
0
 def test_aggregate_stitch(self):
     """Stitch 47 images (1 minute) from 2826 rows (1 sec) """
     _id = 8
     sampling = 60
     src = "Profiles_060_WTH_STATIC_EL90"
     onesec = "Profiles_060_WTH_STATIC_EL90_IM_S1_8000_JET"
     dest = "Profiles_060_WTH_STATIC_EL90_Images_60_TEST"
     con = db.connect("cube", "cube", "HDCP2")
     
     self.assertEqual(True, image.aggregate_table_stitch(con, _id, sampling, src, onesec, dest))
     self.cursor.execute("SELECT COUNT(img_id) FROM `Profiles_060_WTH_STATIC_EL90_Images_60_TEST`")
     total = self.cursor.fetchone()
     self.assertEqual(48, total[0])
           timestamp BIGINT(20),
           width int,
           height int, 
           image BLOB, 
           P_Id int,
           RG_start DOUBLE(5,2),
           RG_end DOUBLE(5,2),
       PRIMARY KEY (img_id), 
       FOREIGN KEY (P_Id) 
   REFERENCES Profiles_060_WTH_Event(Id))"""

tstart = time.time()

row = cursor.fetchone()
while row:
    _id = row[0]
    image.aggregate_table_stitch(con, _id, sampling, src, onesec, dest, logging=True)
    row = cursor.fetchone()

elapsed = time.time() - tstart
print "==Profiler=="
print "Time taken: " + str(elapsed)
print "Done."