Ejemplo n.º 1
0
    def test_aggregate_table(self):
        """Insert 47 datasets from ID 10 and test against this """
        _id = 10
        sampling = 1 # seconds
        src = "Profiles_060_WTH_STATIC_EL90"
        dest = "Profiles_060_WTH_STATIC_EL90_Images_1_TEST"
        con = db.connect("cube", "cube", "HDCP2")

        self.assertEqual(True, image.aggregate_table(con, _id, sampling, src, dest))
        self.cursor.execute("SELECT COUNT(img_id) FROM `Profiles_060_WTH_STATIC_EL90_Images_1_TEST`")
        total = self.cursor.fetchone()
        self.assertEqual(47, total[0])
Ejemplo n.º 2
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(con, _id, sampling, src, dest, gate, logging=True)
    row = cursor.fetchone()

elapsed = time.time() - tstart

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