Network
getRecentPerformanceSamples
Returns recent performance samples
Parameters
Number of samples to return (default: 720)
Response
Code Examples
Basic Request
Request with Limit
Using web3.js
Notes
- Returns recent performance samples from the network
- Each sample covers a period of time (typically 60 seconds)
- Samples include transaction counts and slot information
- The response is immediate as it reads from the current state
- The default limit is 720 samples (approximately 12 hours)
Best Practices
- Use appropriate limit based on your analysis needs
- Cache results when appropriate to reduce RPC load
- Monitor for significant changes in performance
- Consider using websocket subscription for real-time updates
- Handle network errors and retry when appropriate
Common Errors
Code | Message | Solution |
---|---|---|
-32601 | Method not found | Verify you’re connected to a Solana RPC node |
-32602 | Invalid params | Check limit parameter |
-32007 | Performance samples unavailable | Node may be bootstrapping or syncing |
Use Cases
-
Performance Analysis
-
Performance Monitoring
-
Performance History