mirror of
https://github.com/DeNNiiInc/Web-Page-Performance-Test.git
synced 2026-04-17 20:05:58 +00:00
Phase 3: Add filmstrip column to DB and update runner
This commit is contained in:
@@ -201,8 +201,8 @@ async function _executeTest(url, options) {
|
||||
const userIp = options.userIp || '0.0.0.0';
|
||||
|
||||
const insertQuery = `
|
||||
INSERT INTO test_results (id, url, timestamp, is_mobile, scores, metrics, user_uuid, user_ip)
|
||||
VALUES ($1, $2, $3, $4, $5, $6, $7, $8)
|
||||
INSERT INTO test_results (id, url, timestamp, is_mobile, scores, metrics, user_uuid, user_ip, filmstrip)
|
||||
VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9)
|
||||
`;
|
||||
const values = [
|
||||
testId,
|
||||
@@ -212,7 +212,8 @@ async function _executeTest(url, options) {
|
||||
summary.scores,
|
||||
summary.metrics,
|
||||
userUuid,
|
||||
userIp
|
||||
userIp,
|
||||
JSON.stringify(summary.filmstrip) // Ensure it's a JSON string
|
||||
];
|
||||
|
||||
try {
|
||||
@@ -277,7 +278,8 @@ async function getHistory(userUuid, userIp) {
|
||||
timestamp: row.timestamp, // JS Date
|
||||
isMobile: row.is_mobile,
|
||||
scores: row.scores,
|
||||
metrics: row.metrics
|
||||
metrics: row.metrics,
|
||||
filmstrip: row.filmstrip || [] // Return filmstrip if available
|
||||
}));
|
||||
} catch (err) {
|
||||
console.error('Error fetching history from DB:', err);
|
||||
|
||||
Reference in New Issue
Block a user