@squapale/performance-analyzer-lib
v1.0.0
Published
A comprehensive performance analysis library for React applications (Core - MIT License)
Maintainers
Readme
Performance Analyzer Library
A comprehensive performance analysis library for React applications that provides monitoring, benchmarking, and optimization tools.
Features
- Performance Monitoring: Real-time performance tracking with hooks and HOCs
- Visual Dashboard: Interactive dashboard with charts and metrics
- Benchmarking: Automated performance testing and comparison
- Console Tools: Command-line analysis and debugging utilities
- Export Reports: Generate and export performance reports
- Modular Design: Use only the components you need
Installation
npm install performance-analyzer-libQuick Start
import { usePerformanceMonitoring, PerformanceDashboard } from 'performance-analyzer-lib';
// Use performance monitoring hook
function MyComponent() {
const { startTiming, endTiming, getMetrics } = usePerformanceMonitoring();
useEffect(() => {
startTiming('data-fetch');
fetchData().then(() => {
endTiming('data-fetch');
});
}, []);
return <div>My Component</div>;
}
// Add dashboard to your app
function App() {
return (
<div>
<MyComponent />
<PerformanceDashboard />
</div>
);
}Documentation
API Reference
Core
usePerformanceMonitoring()- Main monitoring hookwithPerformanceMonitoring()- HOC for class componentsPerformanceMonitor- Global monitoring instance
Components
PerformanceDashboard- Visual dashboardPerformanceToggle- Toggle for enabling/disabling monitoring
Testing
PerformanceTestSuite- Automated testing utilitiesPerformanceComparator- Before/after comparison tools
Utils
performanceAnalysisExamples- Console analysis toolsperformanceExamples- Advanced usage examples
License
MIT
