-
Notifications
You must be signed in to change notification settings - Fork 17
feat: Added client memory stats + cleaned up diagnostics prefabs #316
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
base: main
Are you sure you want to change the base?
Conversation
| )} | ||
| {tabPrefab.content({ selectedClient, selectedPlugin })} | ||
| </VSCodePanelView> | ||
| ))} |
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 is so cool.
| // Filter out data points that are older than the latest tick | ||
| newData = newData.filter(dataPoint => { | ||
| const latestTick = latestTicks.get(dataPoint.category!); | ||
| return latestTick !== undefined && dataPoint.time === latestTick; |
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.
Nit non-blocking, shouldn't this be enough?
| return latestTick !== undefined && dataPoint.time === latestTick; | |
| return dataPoint.time === latestTick; |
| newData.sort((a, b) => { | ||
| if (selectedSortType === MinecraftStatisticTableSortType.Alphabetical) { | ||
| return selectedSortOrder === MinecraftStatisticTableSortOrder.Ascending | ||
| ? a.category!.localeCompare(b.category!) | ||
| : b.category!.localeCompare(a.category!); | ||
| } else { | ||
| return selectedSortOrder === MinecraftStatisticTableSortOrder.Ascending | ||
| ? a.absoluteValue - b.absoluteValue | ||
| : b.absoluteValue - a.absoluteValue; | ||
| } | ||
| }); |
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.
Nit non-blocking, for performance it would be better to split into 4 sort sentences, otherwise it is making the comparison of filter types in every nested iteration.
| const statsTab: TabPrefab = { | ||
| name: 'Client - Memory', | ||
| dataSource: TabPrefabDataSource.Client, | ||
| content: ({ selectedClient }: TabPrefabParams) => { |
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.
Non-blocking: Would be awesome to use some react memoize mechanism to the content rendering :)
…reshed) (#337) This is a refresh of the original PR for this work #316 by @JakeShirley - Adds support for the client memory stats - Cleans up the diagnostics prefabs to make them more readable and maintainable - Splits out prefabs to one tab per file to make the system more scalable Co-authored-by: Jake Shirley <jake@xbox.com>
This PR accomplishes two main things:
Screenshot