|
| 1 | +# eBPF Performance Visualization Script |
| 2 | + |
| 3 | +## Overview |
| 4 | + |
| 5 | +`visualize_ebpf_performance.py` creates comprehensive visualizations of eBPF agent performance data from CSV files generated by prow. |
| 6 | + |
| 7 | +## Usage |
| 8 | + |
| 9 | +```bash |
| 10 | +python3 scripts/visualize_ebpf_performance.py <csv_file> <prow_id> [--output <output_file>] |
| 11 | +``` |
| 12 | + |
| 13 | +### Arguments |
| 14 | + |
| 15 | +- `csv_file`: Path to CSV file containing performance data such as `https://gcsweb-ci.apps.ci.l2s4.p1.openshiftapps.com/gcs/test-platform-results/pr-logs/pull/netobserv_netobserv-ebpf-agent/824/pull-ci-netobserv-netobserv-ebpf-agent-main-ebpf-node-density-heavy-25nodes/1985348508604960768/artifacts/ebpf-node-density-heavy-25nodes/openshift-qe-orion/artifacts/data-netobserv-perf-node-density-heavy-AWS-25w.csv` |
| 16 | +- `prow_id`: Prow ID of the target run to compare against previous runs such as `1985348508604960768` |
| 17 | +- `--output`, `-o`: (Optional) Output PNG file path (default: `perf/ebpf_performance_visualization.png`) |
| 18 | + |
| 19 | +### Examples |
| 20 | + |
| 21 | +```bash |
| 22 | +# Basic usage |
| 23 | +python3 scripts/visualize_ebpf_performance.py data.csv 1985348508604960768 |
| 24 | + |
| 25 | +# Specify custom output file |
| 26 | +python3 scripts/visualize_ebpf_performance.py data.csv 1985348508604960768 --output custom_output.png |
| 27 | + |
| 28 | +# With full paths |
| 29 | +python3 scripts/visualize_ebpf_performance.py /path/to/data.csv 1985348508604960768 -o /path/to/output.png |
| 30 | +``` |
| 31 | + |
| 32 | +## Requirements |
| 33 | + |
| 34 | +- Python 3 |
| 35 | +- matplotlib |
| 36 | +- numpy |
| 37 | + |
| 38 | +Install dependencies: |
| 39 | +```bash |
| 40 | +pip3 install matplotlib numpy |
| 41 | +``` |
| 42 | + |
| 43 | +## Output |
| 44 | + |
| 45 | +The script generates an 8-panel visualization (5 rows × 2 columns) showing: |
| 46 | + |
| 47 | +**Row 1:** |
| 48 | +1. **Flows Processed Over Time** - Scatter plot with previous average line |
| 49 | +2. **Flows Processed Comparison** - Bar chart comparing min/avg/max vs current |
| 50 | + |
| 51 | +**Row 2:** |
| 52 | +3. **CPU Usage Over Time** - CPU usage trends with previous average line |
| 53 | +4. **Memory Usage Over Time** - RSS memory usage trends with previous average line |
| 54 | + |
| 55 | +**Row 3:** |
| 56 | +5. **CPU Efficiency** - Flows per minute per core scatter plot with efficiency trend line |
| 57 | +6. **Memory Efficiency** - Flows per minute per MB scatter plot with efficiency trend line |
| 58 | + |
| 59 | +**Row 4:** |
| 60 | +7. **Efficiency Comparison** - Percentage change bar chart (CPU and Memory efficiency vs previous average), full width spanning both columns |
| 61 | + |
| 62 | +**Row 5:** |
| 63 | +8. **Summary Statistics** - Comprehensive text panel split into 3 columns: |
| 64 | + - **Column 1**: Flows metrics (Flows Processed, Flows Per Minute) |
| 65 | + - **Column 2**: Resource usage (CPU Usage, Memory RSS) |
| 66 | + - **Column 3**: Efficiency metrics and Dropped Flows information |
| 67 | + |
| 68 | +## Metrics Visualized |
| 69 | + |
| 70 | +- **Flows Processed**: Total flows and flows per minute |
| 71 | +- **CPU Usage**: Resource consumption (cores) over time |
| 72 | +- **Memory Usage**: RSS memory consumption (GB) over time |
| 73 | +- **Efficiency Metrics**: |
| 74 | + - **CPU Efficiency**: Flows per minute per core (scatter plot + percentage change) |
| 75 | + - **Memory Efficiency**: Flows per minute per MB (scatter plot + percentage change) |
| 76 | +- **Dropped Flows**: Reliability indicator (zero is ideal) - shown in summary panel only |
| 77 | + |
| 78 | +## Notes |
| 79 | + |
| 80 | +- The script compares the target prow ID against all previous runs in the CSV |
| 81 | +- Efficiency calculations use rate-based metrics (flows per minute) for accurate comparison |
| 82 | +- Memory efficiency is calculated per MB (not GB) for more granular analysis |
| 83 | +- Efficiency comparison shows percentage change from previous average (green = improvement, orange = regression) |
| 84 | +- All plots include trend lines and reference averages for easy comparison |
| 85 | +- Dropped flows information is displayed in the summary panel (not as a separate plot) |
| 86 | +- Summary statistics are organized into 3 columns for better readability |
| 87 | +- Output is saved at 300 DPI for high-quality visualization |
| 88 | +- By default, output is saved to `perf/` folder (created automatically if it doesn't exist) |
| 89 | +- The `perf/` folder is ignored by git (added to `.gitignore`) |
| 90 | + |
0 commit comments