sitespeedio / sitespeedio/sitespeed.io

My another question is I wanted do monitor my live website for some period of time ex - 10min. And wanted sitespeed performance result for that 10 min. So how can I achieve this form the sitespeed.

Open
#4,155 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
5k
Forks
624
Avg merge
4h 8m
Merged PRs (30d)
2

Description

Your question

This code I got from chatgpt. Lemme know is this correct. also after running this I'm facing some error as mentioned below.

import {run} from 'sitespeed.io';
import fs from 'fs';
import path from 'path';

const outputFolder1= 'demoresult';
if(!fs.existsSync(outputFolder1)) {
fs.mkdirSync(outputFolder1);
}

// const { run } = require('sitespeed.io');
// Configuration options
const options = {
urls: ['https://qa-www.incred.com'], // URL(s) to monitor
outputFolder: outputFolder1, // Directory to save results
deep: 1, // Depth of URLs to fetch (1 for the specified URLs only)
html: true, // Save HTML result files

// Configuration for Metrics
metrics: {
  timing: true, // Enable timing metrics (e.g., TTFB, FCP, TTI, etc.)
  custom: [], // Specify custom metrics to collect (optional)
},


budget: {
  "browsertime.alias": 200
},

reportCategories: ['performance'], // Specify categories of metrics to include in the reports

};
// Function to run Sitespeed.io and continuously monitor
async function runAndMonitor() {
try {
// Run Sitespeed.io with the specified options
await run(options);
// Wait for a specific interval before running again (e.g., 5 minutes)
await sleep(3000); // 300000 milliseconds = 5 minutes
// Run Sitespeed.io again for continuous monitoring
runAndMonitor();
} catch (error) {
console.error('Error:', error);
}
}
// Helper function to sleep for a specified duration (milliseconds)
function sleep() {
return new Promise(resolve => setTimeout(resolve, 300000));
}
// Start the monitoring process
runAndMonitor();

ERROR

2024-05-14 16:13:13] ERROR: TypeError: Cannot read properties of undefined (reading 'budget')
at BudgetPlugin.processMessage (file:///Users/madhanumesh/Desktop/GitLoad/LoadTesting/node_modules/sitespeed.io/lib/plugins/budget/index.js:46:18)
at file:///Users/madhanumesh/Desktop/GitLoad/LoadTesting/node_modules/sitespeed.io/lib/core/queueHandler.js:228:32
at drainItem (/Users/madhanumesh/Desktop/GitLoad/LoadTesting/node_modules/sitespeed.io/node_modules/concurrent-queue/index.js:96:21)
at Immediate.drain [as _onImmediate] (/Users/madhanumesh/Desktop/GitLoad/LoadTesting/node_modules/sitespeed.io/node_modules/concurrent-queue/index.js:77:84)
at process.processImmediate (node:internal/timers:476:21)
[2024-05-14 16:13:13] ERROR: TypeError: Cannot read properties of undefined (reading 'budget')
at BudgetPlugin.processMessage (file:///Users/madhanumesh/Desktop/GitLoad/LoadTesting/node_modules/sitespeed.io/lib/plugins/budget/index.js:46:18)
at file:///Users/madhanumesh/Desktop/GitLoad/LoadTesting/node_modules/sitespeed.io/lib/core/queueHandler.js:228:32
at drainItem (/Users/madhanumesh/Desktop/GitLoad/LoadTesting/node_modules/sitespeed.io/node_modules/concurrent-queue/index.js:96:21)
at Immediate.drain [as _onImmediate] (/Users/madhanumesh/Desktop/GitLoad/LoadTesting/node_modules/sitespeed.io/node_modules/concurrent-queue/index.js:77:84)
at process.processImmediate (node:internal/timers:476:21)
[2024-05-14 16:13:13] INFO: The server responded with a 403 status code for https://qa-www.incred.com/home/
[2024-05-14 16:13:13] INFO: The server responded with a 403 status code for https://qa-www.incred.com/home/
[2024-05-14 16:13:13] INFO: The server responded with a 403 status code for https://qa-www.incred.com/home/
[2024-05-14 16:13:13] ERROR: TypeError: Cannot read properties of undefined (reading 'budget')
at BudgetPlugin.processMessage (file:///Users/madhanumesh/Desktop/GitLoad/LoadTesting/node_modules/sitespeed.io/lib/plugins/budget/index.js:46:18)
at file:///Users/madhanumesh/Desktop/GitLoad/LoadTesting/node_modules/sitespeed.io/lib/core/queueHandler.js:228:32
at drainItem (/Users/madhanumesh/Desktop/GitLoad/LoadTesting/node_modules/sitespeed.io/node_modules/concurrent-queue/index.js:96:21)
at Immediate.drain [as _onImmediate] (/Users/madhanumesh/Desktop/GitLoad/LoadTesting/node_modules/sitespeed.io/node_modules/concurrent-queue/index.js:77:84)
at process.processImmediate (node:internal/timers:476:21)
[2024-05-14 16:13:13] ERROR: Error: Multiple summary messages of type aggregateassets.summary and group total
at validateSummaryMessage (file:///Users/madhanumesh/Desktop/GitLoad/LoadTesting/node_modules/sitespeed.io/lib/core/queueHandler.js:70:11)
at validateMessageFormat (file:///Users/madhanumesh/Desktop/GitLoad/LoadTesting/node_modules/sitespeed.io/lib/core/queueHandler.js:88:3)
at QueueHandler.postMessage (file:///Users/madhanumesh/Desktop/GitLoad/LoadTesting/node_modules/sitespeed.io/lib/core/queueHandler.js:201:5)
at AssetsPlugin.processMessage (file:///Users/madhanumesh/Desktop/GitLoad/LoadTesting/node_modules/sitespeed.io/lib/plugins/assets/index.js:56:19)
at file:///Users/madhanumesh/Desktop/GitLoad/LoadTesting/node_modules/sitespeed.io/lib/core/queueHandler.js:228:32
at drainItem (/Users/madhanumesh/Desktop/GitLoad/LoadTesting/node_modules/sitespeed.io/node_modules/concurrent-queue/index.js:96:21)
at Immediate.drain [as _onImmediate] (/Users/madhanumesh/Desktop/GitLoad/LoadTesting/node_modules/sitespeed.io/node_modules/concurrent-queue/index.js:77:84)
at process.processImmediate (node:internal/timers:476:21)
Waiting for the debugger to disconnect...
file:///Users/madhanumesh/Desktop/GitLoad/LoadTesting/node_modules/sitespeed.io/lib/core/queueHandler.js:70
throw new Error(
^

Error: Multiple summary messages of type browsertime.summary and group total
at validateSummaryMessage (file:///Users/madhanumesh/Desktop/GitLoad/LoadTesting/node_modules/sitespeed.io/lib/core/queueHandler.js:70:11)
at validateMessageFormat (file:///Users/madhanumesh/Desktop/GitLoad/LoadTesting/node_modules/sitespeed.io/lib/core/queueHandler.js:88:3)
at QueueHandler.postMessage (file:///Users/madhanumesh/Desktop/GitLoad/LoadTesting/node_modules/sitespeed.io/lib/core/queueHandler.js:201:5)
at BrowsertimePlugin.sendMessage (file:///Users/madhanumesh/Desktop/GitLoad/LoadTesting/node_modules/sitespeed.io/node_modules/@sitespeed.io/plugin/plugin.js:110:23)
at BrowsertimePlugin.processMessage (file:///Users/madhanumesh/Desktop/GitLoad/LoadTesting/node_modules/sitespeed.io/lib/plugins/browsertime/index.js:614:19)
at runNextTicks (node:internal/process/task_queues:60:5)
at process.processImmediate (node:internal/timers:447:9)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the provided run with the options in the issue, then inspect lib/plugins/budget/index.js and the summary validation in lib/core/queueHandler.js. Trace the related messages through lib/plugins/assets/index.js and lib/plugins/browsertime/index.js. Done means the requested monitoring run completes without the reported budget or duplicate-summary errors.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, node.js
Domain
performance, testing-qa
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.