Repository: risingwavelabs/risingwave
File: grafana/dashboard/dev/streaming_fragments.py (Python)

Code before:
                        )
                    ],
                    ["fragment_id", "Value"],
                    dict.fromkeys(["Time"], True),
                    {"Value": "rate"},
                    "",
                    {"rate": "percent"},
                ),
                panels.table_info(
                    "Top Fragments by CPU",
                    "Top 10 fragments with the highest CPU rate (%).",
                    [
                        panels.table_target(
                            _fragment_topk_percent_expr(
                                f"{poll_duration_expr} / 1000000000"
                            )
                        )
                    ],
                    ["fragment_id", "Value"],
                    dict.fromkeys(["Time"], True),
                    {"Value": "rate"},
                    "",
                    {"rate": "percent"},
                ),
                panels.table_info(
                    "Top Fragments by Idle Time",
                    "Top 10 fragments with the highest idle time rate (%).",
                    [
                        panels.table_target(
                            _fragment_topk_percent_expr(
                                f"{idle_duration_expr} / 1000000000"
                            )
                        )
                    ],
                    ["fragment_id", "Value"],
                    dict.fromkeys(["Time"], True),
                    {"Value": "rate"},
                    "",
                    {"rate": "percent"},
                ),
                panels.table_info(
                    "Top Fragments by Scheduling Delay",
                    "Top 10 fragments with the highest scheduling delay rate (%).",
                    [
                        panels.table_target(
                            _fragment_topk_percent_expr(
                                f"{scheduled_duration_expr} / 1000000000"
                            )
                        )
                    ],
                    ["fragment_id", "Value"],

Review comment (suggestion):
The table title "Top Fragments by Idle Time" is misleading because it measures idle time rate (as a percentage), not absolute idle time. Consider renaming to "Top Fragments by Idle Rate" for consistency with "Top Fragments by Busy Rate" and to match the description.
```suggestion
                    "Top Fragments by Idle Rate",
```

Code after:
    )
    return [
        outer_panels.row_collapsed(
            "Streaming Fragments",
            [
                panels.subheader("Overview"),
                panels.table_info(
                    "Top Fragments by Busy Rate",
                    "Top 10 fragments with the highest peak busy rate (%).",
                    [
                        panels.table_target(
                            topk_percent_expr(
                                _fragment_peak_rate_with_id_at_step(
                                    _actor_busy_rate_expr("$__rate_interval")
                                )
                            )
                        )
                    ],
                    ["id", "Value"],
                    dict.fromkeys(["Time", "fragment_id"], True),
                    {"Value": "rate"},
                    {"rate": "percent"},
                ),
                panels.table_info(
                    "Top Fragments by CPU Rate",
                    "Top 10 fragments with the highest peak CPU rate (%).",
                    [
                        panels.table_target(
                            topk_percent_expr(
                                _fragment_peak_rate_with_id_at_step(
                                    poll_duration_expr
                                )
                            )
                        )
                    ],
                    ["id", "Value"],
                    dict.fromkeys(["Time", "fragment_id"], True),
                    {"Value": "rate"},
                    {"rate": "percent"},
                ),
                panels.table_info(
                    "Top Fragments by Idle Rate",
                    "Top 10 fragments with the highest peak idle rate (%).",
                    [
                        panels.table_target(
                            topk_percent_expr(
                                _fragment_peak_rate_with_id_at_step(
                                    idle_duration_expr
                                )
                            )
                        )