
Security News
vlt Launches "reproduce": A New Tool Challenging the Limits of Package Provenance
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
@vrbo/fpsmeter
Advanced tools
Small utility that measures frames per second in a browser context.
Optimized javascript utility for measuring frames per second in a browser environment. Useful for observing end-user client run-time performance without adversly impacting performance.
npm install --save @vrbo/fpsmeter
Within your javascript files, import the component:
import FPSMeter from '@vrbo/fpsmeter';
// Configure FPSMeter
const meter = new FPSMeter({
calculatePerMs: 500, // calculation window for FPS
onUpdate: (update) => {
// update.fps - FPS of last window (per defined calculatePerMs option)
// update.avgfps - FPS average since start()
},
onStop: (reason) {
// reasons why FPSMeter can halt:
// FPSMeter.stop() initiated by: user
// FPSMeter.stop() initiated by: document visibilitychange event
// FPSMeter.stop() initiated by: rAF timed out
// FPSMeter.stop() initiated by: window blur event
}
});
// Start
meter.start();
// Stop
meter.stop();
Example of collecting 10 FPS calculations of 500ms windows to add to client telemetry summary:
import FPSMeter from '@vrbo/fpsmeter';
const meter = new FPSMeter({
calculatePerMs: 500,
maxCalculations: 10
});
meter.start();
function onSummarizeClientTelemetry() {
let summary = {};
// stop meter
meter.stop();
// collect fps windows into string attribute
summary.fps = meter.fpsWindows.join(',');
return summary;
}
setTimeout(() => {
let summary = onSummarizeClientTelemetry();
console.log(summary.fps); // prints "60,60,60,60,60,60,60,60,60,60" if perfect client performance
}, 10000);
** Note: You may see less than 10 FPS measurements if FPSMeter stops for any reason (see below Caveat)
When a user loses focus on the page for any reason, we need to halt the measure of FPS due to the browser engine no longer actively executing the internal API requestAnimationFrame which the FPSMeter library relies on, otherwise our FPS measurements will be skewed.
To mitigate this, FPSMeter will halt when either of the following three conditions occur:
This ensures that FPSMeter data is clean and comparable across page views.
To test this for yourself, try the demo link at the top of the page.
npm start
This projects supports auto-formatting of source code! Simply find your favorite IDE from the list in the following list: https://prettier.io/docs/en/editors.html
For VSCode support, perform the following steps:
ext install esbenp.prettier-vscode
FAQs
Small utility that measures frames per second in a browser context.
The npm package @vrbo/fpsmeter receives a total of 5 weekly downloads. As such, @vrbo/fpsmeter popularity was classified as not popular.
We found that @vrbo/fpsmeter demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 9 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
Research
Security News
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
Research
The Socket Research Team discovered a malicious npm package, '@ton-wallet/create', stealing cryptocurrency wallet keys from developers and users in the TON ecosystem.