Research
Security News
Malicious npm Package Targets Solana Developers and Hijacks Funds
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
@probe.gl/stats
Advanced tools
@probe.gl/stats is a JavaScript library designed for performance monitoring and statistics collection. It provides tools to track and analyze various metrics, making it useful for performance optimization and debugging in web applications.
Stat Tracking
This feature allows you to track various statistics, such as frame rates, memory usage, or any custom metrics. The code sample demonstrates how to create a Stats object, increment a frame rate counter, and log the count.
const { Stats } = require('@probe.gl/stats');
const stats = new Stats({id: 'app-stats'});
stats.get('frameRate').incrementCount();
console.log(stats.get('frameRate').count);
Timer
This feature allows you to measure the time taken for specific operations. The code sample shows how to start and end a timer for a 'loadTime' metric and log the last timing.
const { Stats } = require('@probe.gl/stats');
const stats = new Stats({id: 'app-stats'});
stats.get('loadTime').timeStart();
// Perform some operations
stats.get('loadTime').timeEnd();
console.log(stats.get('loadTime').lastTiming);
Aggregated Stats
This feature allows you to aggregate statistics over time. The code sample demonstrates how to add counts to a 'requests' metric and log the total count.
const { Stats } = require('@probe.gl/stats');
const stats = new Stats({id: 'app-stats'});
stats.get('requests').addCount(5);
stats.get('requests').addCount(3);
console.log(stats.get('requests').count);
stats.js is a lightweight JavaScript library for monitoring performance metrics such as frame rate, memory usage, and custom metrics. It provides a simple interface and visual display for real-time performance tracking. Compared to @probe.gl/stats, stats.js is more focused on real-time visualization and is often used in game development and interactive applications.
perf_hooks is a Node.js module that provides an API for measuring performance metrics. It includes high-resolution timers and performance observers for tracking various performance-related events. While @probe.gl/stats is more specialized for web applications and custom metrics, perf_hooks offers a broader range of performance measurement tools suitable for Node.js environments.
performance-now is a simple library that provides a high-resolution timer for measuring performance in JavaScript. It is often used for benchmarking and performance analysis. Compared to @probe.gl/stats, performance-now is more focused on providing precise timing information rather than a comprehensive statistics tracking system.
Logging and instrumentation tools for JavaScript
probe.gl is a collection of logging, instrumentation, bench-marking and test tools for JavaScript applications.
For documentation please visit the website.
v4.0.9
FAQs
Stats object for reporting performance statistics
We found that @probe.gl/stats demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 3 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.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.