Skip to main content

Component Performance Monitoring

Overview

This component demonstrates how to integrate the PERFORM Library into an IguanaX component for real-time performance tracking. It showcases CPU load, wall execution time, and memory footprint monitoring for simulated workloads.

Scenario Examples

  • CPU-bound computation (busy loop)

  • Memory allocation and garbage collection tracking

  • Sleep/IO wait simulation

  • Mixed workloads with combined CPU, sleep, and memory usage

  • Real-time performance report on the component card

Expected Output (Component Card)

cpu.busy~300ms           exeTime:   0s  cpu~:  7.5%  mem:0.26MB (mem Δ+ 0.09MB)   
mem.grow~1.5MB exeTime: 0s cpu~: 0.2% mem:0.35MB (mem Δ+ 0.09MB)
sleep~1200ms exeTime: 1s cpu~: 0.1% mem:0.35MB (mem Δ+ 0.00MB)
mem.churn~2MB.free exeTime: 0s cpu~: 0.8% mem:0.29MB (mem Δ+ 0.00MB)
mixed.small exeTime: 0s cpu~: 2.0% mem:0.24MB (mem Δ+ 0.00MB)

How to Use

  1. Import PERFORM library

  2. Adjust GC and core count with PERset{} to match your environment.

  3. Trace code sections with PERbegin(<process name>) and PERend(<process name>).

  4. Call PERreport("status") to display metrics on the component card, PERreport("status") to log metrics in the component logs, or PERreport() to see the results in the Translator annotations as a well-formatted string.

Tips

  • For PERreport():

    • Use the "status" output type in production to visualize real-time component performance.

    • Use "log" output mode for detailed logging during QA or load testing.

  • For long-running operations, add multiple PERbegin/ PERend sections to isolate slow areas.

  • Combine with Iguana's built-in logs for deeper insight into throughput and resource usage.