Skip to content

Considerations

Performance Considerations

  • Minimal Overhead: The monitor is designed to have minimal impact on function performance
  • Selective Monitoring: Disable features you don't need for better performance
  • Memory Monitoring: Uses psutil for accurate memory measurements
  • CPU Monitoring: Lightweight CPU usage tracking
  • Logging: Structured logging with configurable levels to reduce I/O overhead

Error Handling and Debugging

Common Issues

  1. Import Errors: Ensure all dependencies are installed
  2. Permission Issues: Check file permissions for log files
  3. Memory Monitoring: Requires psutil package
  4. Type Validation: Requires proper type hints for validation to work

Debug Mode

Enable debug mode for detailed logging:

from pyfuncmonitor import configure_monitor

configure_monitor(
    log_level=10,  # DEBUG level
    log_to_file=True,
    log_file_path="./debug.log"
)