-
Notifications
You must be signed in to change notification settings - Fork 18
feat(ui): add quantity metadata to operator statistics #471
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
2981414
feat(ui): add quantities to operator statistics
johanpel 1c4a240
test(simulator): remove quantity mapping tests
johanpel 36721d2
test(ui): update DAG statistic fixture
johanpel dc68e89
feat(simulator): add duration quantities
johanpel 04ea807
add helper for quantity-aware stat formatting
cmatzenbach 3d748c5
fix(simulator): rename scaled duration statistics
johanpel 5e3f0e9
Merge branch 'stats-quantities' of github.com:johanpel/quent into sta…
cmatzenbach 800c6c7
type fixes
cmatzenbach 387989b
use quantity-aware formatting in DAGNodeInfoPanel
cmatzenbach c4c4904
use quantity-aware formatting for DAG node color labels and legend
cmatzenbach 05da69f
use quantity-aware formatting in operator statistics pivot table
cmatzenbach 577648a
fix(simulator): gate duration metadata on scaling
johanpel 519c968
Remove inline imports
cmatzenbach 5ac5df5
Set up hook and atoms to provide stat quantity specs
cmatzenbach f6b26ff
pass fmt function to ContinuousLegend instead of QuantitySpec
cmatzenbach 21861f3
Merge branch 'stats-quantities' of github.com:johanpel/quent into sta…
cmatzenbach 385de43
wire quantity specs through to operator statistics display, abandon c…
cmatzenbach 780b5b7
Remove prop - no longer needed
cmatzenbach 8e82c6d
Merge branch 'main' into stats-quantities
cmatzenbach 5904591
linting
cmatzenbach 84754fc
Fix type error, and ensure bigints go through bigint supported helper
cmatzenbach File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -11,10 +11,16 @@ import { | |
| } from '@quent/hooks'; | ||
| import { DataText } from '../ui/data-text'; | ||
| import { thinScrollbarClass } from '../ui/thin-scroll'; | ||
| import { inferFieldFormatter, isNumericValue } from '@quent/utils'; | ||
| import { formatStatWithQuantity, type QuantitySpec } from '@quent/utils'; | ||
| import { DataFlowMatrix } from './DataFlowMatrix'; | ||
|
|
||
| export const DAGNodeInfoPanel = ({ isDark = false }: { isDark?: boolean }) => { | ||
| export const DAGNodeInfoPanel = ({ | ||
| isDark = false, | ||
| quantitySpecs, | ||
| }: { | ||
| isDark?: boolean; | ||
| quantitySpecs?: { [key: string]: QuantitySpec | undefined }; | ||
| }) => { | ||
| const selectedNodeData = useSelectedNodeData(); | ||
| const dataFlowEnabled = useDataFlowEnabled(); | ||
| const dataFlowMeta = useDataFlowMeta(); | ||
|
|
@@ -78,7 +84,7 @@ export const DAGNodeInfoPanel = ({ isDark = false }: { isDark?: boolean }) => { | |
| {selectedNodeData.nodeId} | ||
| </DataText> | ||
| </div> | ||
| {selectedNodeData.statistics?.map(({ key, value }) => ( | ||
| {selectedNodeData.statistics?.map(({ key, value, quantity }) => ( | ||
| <div key={key} className="text-xs"> | ||
| {Array.isArray(value) ? ( | ||
| <div className="flex items-center justify-between gap-0.5"> | ||
|
|
@@ -95,7 +101,13 @@ export const DAGNodeInfoPanel = ({ isDark = false }: { isDark?: boolean }) => { | |
| <div className="flex items-center justify-between"> | ||
| <DataText className="capitalize">{key.replace(/_/g, ' ')}:</DataText> | ||
| <DataText className="text-muted-foreground ml-1"> | ||
| {isNumericValue(value) ? inferFieldFormatter(key)(value) : String(value)} | ||
| {typeof value === 'number' | ||
| ? formatStatWithQuantity( | ||
| value, | ||
| key, | ||
| quantity && quantitySpecs ? quantitySpecs[quantity] : undefined | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. golf: |
||
| ) | ||
| : String(value)} | ||
| </DataText> | ||
| </div> | ||
| )} | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
📐 Maintainability & Code Quality | 🟠 Major | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
Repository: rapidsai/quent
Length of output: 10902
🏁 Script executed:
Repository: rapidsai/quent
Length of output: 2127
🏁 Script executed:
Repository: rapidsai/quent
Length of output: 3347
🏁 Script executed:
Repository: rapidsai/quent
Length of output: 1412
🏁 Script executed:
Repository: rapidsai/quent
Length of output: 1408
Add tests for the new quantity helpers. Cover byte/second names, unknown names, nanosecond-to-second scaling, unchanged
None/non-U64values, and thequantity_specs()keys.🤖 Prompt for AI Agents
Source: Coding guidelines