-
Notifications
You must be signed in to change notification settings - Fork 24
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
Add filter ratio dynamic metric #24
base: main
Are you sure you want to change the base?
Conversation
spark-ui/src/reducers/SqlReducer.ts
Outdated
return updatedMetrics; | ||
} | ||
|
||
const filterRatio = ((totalInputRows - outputRows) / totalInputRows) * 100; |
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.
use formatPercentage util method
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.
Also "filter ratio" is the opposite I think, if you filter 1000 from 1M it's 0.1% filtered not 99%. Maybe the naming should be better here like "filtered rows percentage"
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.
I didn't find formatPercentage util I can use in typescript but found NumberFormat, hope it is what you intended :)
@@ -399,6 +400,7 @@ export function updateSqlNodeMetrics( | |||
|
|||
const notEffectedSqls = currentStore.sqls.filter((sql) => sql.id !== sqlId); | |||
const runningSql = runningSqls[0]; | |||
const graph = generateGraph(runningSql.edges, runningSql.nodes); |
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.
This means we are generating the graph for every metric update cycle. This is not ideal.
We should cache the graph if there is no change.
Please at least add a todo comment to cache the graph.
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.
Yes, I thought about it, but my bad to forget the todo.
I think it should work with map with sqlId key easily.
But detecting actual changes is something different. We can do a check on node metrics before and after or compare their hashes. What do you think?
were replaced with updateNodeMetrics function.