-
Notifications
You must be signed in to change notification settings - Fork 3
#78 - Implement Render Mode Options #89
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: dev
Are you sure you want to change the base?
Conversation
|
@jamesmarkchan ready for review – this completes #78 |
|
@vpstackhub I was thinking this is a less likely to be configured item that the items in the main settings area so should be under the options file menu if possible and default to "Per Sample" where the graph would update per sample. If the user selected the option "Per Operation" the chart would update after a read or write operation is complete. and if a per interval is selected we would need to do some time stamping and computation if the update window has passed before the next update occurs. Should be free to tag up tomorrow or thursday or this weekend if you are free.
|
|
The the publish samples i believe is where the graph gets updated so if we're not on per sample, instead of just publishing the sample we'll want to put the sample into an array or some container so it can all be added later when the rendering interval is up. |
src/jdiskmark/App.java
Outdated
| TABLE, | ||
| CHARTS_AND_TABLE; | ||
|
|
||
| @Override |
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.
so here the modes would be like:
- PER_SAMPLE
- PER_OPERATION
- PER_100MS
- PER_500MS
- PER_1000MS
src/jdiskmark/App.java
Outdated
| return switch (this) { | ||
| case CHARTS -> "Charts"; | ||
| case TABLE -> "Table"; | ||
| case CHARTS_AND_TABLE -> "Charts + Table"; |
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.
for your awareness lines 47-52 would be indented all by x4 spaces more.
src/jdiskmark/App.java
Outdated
| case CHARTS_AND_TABLE -> "Charts + Table"; | ||
| }; | ||
| } | ||
| } |
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.
Maybe good to put RenderMode enum into the Gui.java class or it's own class entirely.
|
it's likely we'll want to pull this from here and save the slot for a Profiles dropdown that we'll add later as part of #42.
|
|
Hey James!Saw all your comments and suggestions ;totally makes sense. Thanks for the detailed breakdown.Just a heads-up: this week’s packed on my end, so I might not be able to hop on a call as soon as you proposed. That said, I wanted to make sure I understood your feedback . Here’s what I took away: • Move the RenderMode enum out of App.java, ideally into Gui.java or its own class. • Rename and redefine the enum to reflect rendering frequency, not display mode (e.g. PER_SAMPLE, PER_OPERATION, PER_100MS, etc.). • Create a new submenu under the Options menu using a JMenu and JMenuItems for the different render intervals. • Default to PER_SAMPLE, but wire in logic so other modes can be implemented later (starting with just storing the selected mode). • Possibly reserve that renderCombo slot in the future for Profiles (#42).If I missed anything major, feel free to nudge me. Otherwise I’ll try to start chipping away at this as soon as time allows.As always, thank you for your precious guidance Best,ValerioOn Sep 16, 2025, at 9:41 PM, James Mark Chan ***@***.***> wrote:jamesmarkchan left a comment (JDiskMark/jdm-java#89)
it's likely we'll want to pull this from here and save the slot for a Profiles dropdown that we'll add later as part of #42.
image.png (view on web)
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you were mentioned.Message ID: ***@***.***>
|
|
another option is we start a new dialog window called Advanced Options that is brought up from the Options Menu where the user can select a dropdown with the options we are talking about. Later we can migrate the other advanced options that are not that commonly set to this menu to keep the front primary controls for the common user clutter free and the enthusiast would bring up the advanced options to tune their benchmarks to their liking. See #90 for a brief description of the advanced options dialogue window approach, which we can start to migrate advanced options into. |
| private static jdiskmark.RenderFrequencyMode renderFrequencyMode = jdiskmark.RenderFrequencyMode.PER_SAMPLE; | ||
|
|
||
| public static RenderFrequencyMode getRenderFrequencyMode() { | ||
| return renderFrequencyMode; |
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 and line 49 could be indented by 4 spaces.
|
hey @vpstackhub, i checked out and tested and noticed a few things:
Unfortunately I'm not sure what is causing some of these artifacts and how to correct at the moment but wanted to share some initial feedback. |
|
This PR completes Issue #78 by finalizing the Render Mode functionality and cleaning up the rendering logic. Features ImplementedRender Mode Options now available in the UI: Charts – show JFreeChart only Table – show results table only Charts + Table – show both Render Mode submenu added under Options with radio buttons. New RenderFrequencyMode enum (PER_SAMPLE, PER_OPERATION, PER_100MS, PER_500MS, PER_1000MS). Dropdown wiring completed in MainFrame and Gui, with dynamic chart visibility toggle. Code ChangesConsolidated duplicate logic in BenchmarkWorker: Removed redundant switch(currentMode) blocks. Centralized per-sample, per-operation, and interval-based buffering logic. Added getIntervalMillis() helper for clean timing control. Integrated with existing metrics (App.updateMetrics, publish, etc.). Preserved thread safety and UI responsiveness with buffered sample publishing. Testing PerformedPer Sample: results update continuously (no mid-test warnings). Per Operation: results batch flush correctly at operation boundaries. Per 500ms / 1000ms: results render at expected intervals, with charts/table progressively updating. Verified toggling between Charts / Table / Charts+Table updates the UI correctly. Clean + Build and Run behave consistently, no regressions observed. Next Steps Follow-up PR could focus on: Persisting Render Mode preference in jdm.properties. Additional GUI refinements if requested. |
|
Hey @vpstackhub i pulled and tested your branch really quickly but have not had a chance to look at the code, really quickly it seems there is a Render Mode in the Options menu that has different options from the Render mode on the main control panel. I feel this could confuse users and we can probably remove the Render mode in the control panel area and leave the one in the Options menu? Or were you thinking there is another render mode control we should introduce. Generally for less used controls like the Render mode it is good to hide them away in an options since it might not be of interest to most users and we can save the main control area for the primary controls. Our tool has more controls than the other competing tools. also noticed that some of the stats were not getting filled out as each record was completed.
should be free this evening if you have time for a call. |
|
Thanks @jamesmarkchan for the detailed review and testing. Based on your notes, here’s my plan:
Per Sample = update each sample
|
|
there are two identical pull request and I think this is the better one to keep open for this branch. it is okay to rebranch from dev and start over to reset the gui builder portions if needed. |
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 think there are functional aspects to address first or possible you did not push the latest code changes to the branch. i know the generated code can be challenging to maintain, usually what i do is to revert the generated code if it gets a little too jumbled. we'll have to look at breaking up the generated code more so it is easier to maintain in the future.
|
|
||
| // Dynamically add Render Mode column | ||
| DefaultTableModel model = (DefaultTableModel) runTable.getModel(); | ||
| model.addColumn("Render Mode"); |
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.
oh sorry i should have been more specific, even though we should save the render mode to the database i don't think we need to add a column. but we should save the value and load it and send it back to the community portal. we do need a solution to show the render mode when a selected benchmark is loaded.
| public static void updateRenderView() { | ||
| RenderFrequencyMode mode = Gui.mainFrame.getRenderMode(); | ||
|
|
||
| boolean showChart = true; // all modes show chart in this example |
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'm not sure we need showChart and showTable or possible to share what you had in mind for them?
| mode == RenderFrequencyMode.PER_500MS || | ||
| mode == RenderFrequencyMode.PER_1000MS); | ||
|
|
||
| if (chartPanel != null) { |
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 don't believe we need to hide the chart, can likely remove lines 113-114 unless I'm overlooking something.
| chartPanel.setVisible(showChart); | ||
| } | ||
|
|
||
| Gui.mainFrame.setTableVisible(showTable); |
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 probably not needed also right? or let me know if otherwise.
| if (renderModeLabel != null) { | ||
| renderModeLabel.setText("Render Mode: " + getRenderFrequencyMode()); | ||
| } | ||
| } |
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.
so if a render mode is displayed on the chart i believe it should show the render mode of the active selected benchmark or the selected loaded benchmark and not the mode selected for the next benchmark because the user can see the mode selected for the next benchmark from the menu. good to keep in mind that we have controls that tell us the info of a selected or current benchmark and controls that tell us what will be used for the next benchmark that is run. I might have confused the behavior with how the main benchmark controls are being used for both. In theory it is nice to keep them separate.
| wrapperPanel.add(chartPanel, java.awt.BorderLayout.CENTER); | ||
|
|
||
| return wrapperPanel; | ||
| } |
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.
going to ignore formatting comments for now since we'll want to get the functionality working first but normally we would not want to see the return and the closing bracket on the same column like here. the closing bracket would be lined up with the first line of the open bracket usually. does this make sense?
| return label; | ||
| } | ||
| } | ||
|
|
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 class looks good!
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.
we might not need an attribute converter class as the RenderFrequencyMode is an enumeration and we have been able to store enumerations into our derby database wo attribute converters in the past for instance there is the BenchmarkType enumeration and the IOMode enumeration. Perhaps we can model those for storing the Render frequency into the db.
| orderComboBox.addItem(BenchmarkOperation.BlockSequence.SEQUENTIAL); | ||
| orderComboBox.addItem(BenchmarkOperation.BlockSequence.RANDOM); | ||
| } | ||
|
|
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.
@vpstackhub are you using vs code or netbeans for code editing? want to warn you that the entire constructor appears to have had it's indentation bumped by four making the entire function appear as a new change and the old remove. usually we want to avoid this so a git diff can in the review tell us specifically which lines changed instead of saying the entire function changed and the user has to look for the changes specifically. it might be good to use vs code to review the changes in the source control panel before making the commit so we an avoid accidental white space adjustments.
| public void initializeComboSettings() { | ||
| typeCombo.setSelectedItem(App.benchmarkType); | ||
| loadSettings(); | ||
| loadSettings(); |
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.
minor but looks like we are adding extra spaces after the line.







This PR completes Issue #78 by adding Render Mode options to the UI:
Changes made:
RenderModeenum inApp.javarenderCombodropdown added toMainFrame.javaGui.javaLet me know if you'd like any refinements!