Conversation
Keep track of the longest execution time, as opposed to just the most recent one.
clevengr
left a comment
There was a problem hiding this comment.
Reviewed src/edu/csus/ecs/pc2/clics/API202306/JSON202306Utilities.java; left several comments.
| * event notification prefix. | ||
| * Adds event, (event) id, customProperty (an customValue) (if non-null) and data keyword to string. | ||
| * | ||
| * @param stringBuilder |
There was a problem hiding this comment.
This statement lists "stringBuilder" as a method parameter, but there's no such parameter actually declared in the method signature.
There was a problem hiding this comment.
Copied from legacy comment in method above, which was not kept up-to-date. Fixed both the legacy comment above as well as this one. Next push.
| * Adds event, (event) id, customProperty (an customValue) (if non-null) and data keyword to string. | ||
| * | ||
| * @param stringBuilder | ||
| * @param eventType |
There was a problem hiding this comment.
There is no such parameter "eventType" in the method signature.
There was a problem hiding this comment.
Same response. Legacy comment was copied, and legacy comment was wrong.
| * | ||
| * @param stringBuilder | ||
| * @param eventType | ||
| * @param data - json data for object |
There was a problem hiding this comment.
I would expect to see @param declarations for parameters eventSequence and id -- but there's no such statements here.
clevengr
left a comment
There was a problem hiding this comment.
Reviewed src/edu/csus/ecs/pc2/core/execute/ExecutionData.java; left one comment that I think is rather important.
|
|
||
| public void setExecuteTimeMS(long inExecuteTime){ | ||
| executeTimeMS = inExecuteTime; | ||
| // Keep track of longest execution time |
There was a problem hiding this comment.
If I recall correctly how the code works, there is a separate ExecutionData object associated with the execution of each test case. If that's true, it doesn't seem logical to me to be storing the "longest execution time" in the ExecutionData object since each such object relates to (only) one test case execution. Rather, it seems like "longest execution time" should be stored in some higher-level object that associated with the entire sequence of test case executions. Am I mis-remembering how the code is structured?
There was a problem hiding this comment.
Recall I wrote up a document explaining how ExecutionData is used. Here is a link: PC2 Execution Data Class
That should explain it. In a nutshell, the "per-test-case" execution information is only part of what is stored in ExecutionData. Compile results, and the final judgment for the Run is stored in there as well and examined by the caller to determine the disposition of the Run.
clevengr
left a comment
There was a problem hiding this comment.
Reviewed src/edu/csus/ecs/pc2/ui/AutoJudgingMonitor.java. See comments.
| long totalSeconds = milliDiff / 1000; | ||
| judgementRecord.setHowLongToJudgeInSeconds(totalSeconds); | ||
| judgementRecord.setExecuteMS(executeTimeMS); | ||
| judgementRecord.setExecuteMS(executionData.getMaxExecuteTimeMS()); |
There was a problem hiding this comment.
The name of the setter now seems inappropriate; it's no longer setting an "execution time", it's setting a "maximum execution time over all the test cases".
There was a problem hiding this comment.
The comment in JudgementRecord says, "Number of seconds it took to execute the run." Aside from the comment specifying the incorrect units (seconds, vs. MS), before this PR, that value was essentially meaningless (it was the execute time of the LAST test case). Now, it contains what I believe to be the original intent which is the time of the longest test case, since this value is used in the ViewJudgementsPane as the "X time", indicating (I would imagine) maximum execute time. What else could it possibly be? The "X time" column was added in 2011 by Doug:
bug 668: now sets the ms for the execute time into the system.
Shows on reports, added column to View Judgement X time for execute time in ms.
svn path=/trunk/; revision=2419
Keep in mind that JudgementRecord is different than ExecutionData. JudgementRecord is created from the information in ExecutionData. (ref. core.execute.JudgementUtilities.createJudgementRecord(...))
clevengr
left a comment
There was a problem hiding this comment.
Reviewed src/edu/csus/ecs/pc2/ui/SelectJudgementPaneNew.java; left minor comments.
There was a problem hiding this comment.
All the other changed files included updates to the copyright date; why not this one?
There was a problem hiding this comment.
Fixed in next push.
There was a problem hiding this comment.
I reviewed all four changes files in the PR. I left individual review comments; a few of them are minor but a couple are things that I think either need to be fixed or I need to obtain a better understanding of how the code is working...
Proceeding to runtime testing of the PR...
|
@johnbrvc : I loaded your branch for this PR, pulled to make sure it was up to date, built a new distribution from scratch in that branch, and ran the test steps listed in the PR. I got the following results on the Event Feed: As you can see, the "max_run_time" in the judgement is 0.046, but there are several "run_time" entries that are larger than that. I'm not sure what to make of this. (I also looked at the "Run Judgements" pane in the Admin's RunContest>Runs pane as suggested in the PR; it also says "X time = 46ms".) Any suggestions as to what may be going wrong? Could this perhaps be related to the comments I made while reviewing the source -- specifically, about seeming to recall that there is a different |
This really looks like you're not using the correct version of PC2 - it seems like it is doing what the non-PR version does. Are you running this from the debugger in Eclipse or from the command line? If the latter, check pc2ver to make sure it's running the right version. (Maybe try: I just repeatedly made several submissions and they all worked as expected. |
Fixed some legacy comments that specified incorrect parameters. Fixed wrong calling sequence for added method (left off the new parameters).
clevengr
left a comment
There was a problem hiding this comment.
I was finally able to resolve the issues that were not allowing me to produce the expected results when running the PR. For future reviewers, here's a potential issue to be aware of:
JohnB's GitHub fork (which I cloned and worked on locally on my Windows machine) has (or at least, had at the time I was testing) two separate but similarly-named branches: i1280_max_run_time_fix and i1280_fix_max_run_time. The former was apparently an old version which shouldn't be used (probably should be deleted) -- but it was the one I had selected for testing. It doesn't work; it doesn't contain the fixes implied by this PR. You should make sure that any testing you do uses the newer one: i1280_fix_max_run_time. That branch worked for me.
I approve the PR.
Description of what the PR does
Keep track of the longest execution time in
ExecutionDatausing a new member (maxExecuteTimeMS) along with the appropriate accessor and mutator. Previously, theexecuteTimeMS(getExecuteTimeMS()) member was used and this represents the execution time of the last test case. This caused the wrong value to appear on the CLICS event feed, as well as on the PC2 GUI that shows the execution data for a run.Issue which the PR addresses
Fixes #1280
Environment in which the PR was developed (OS,IDE, Java version, etc.)
java version "1.8.0_321"
Java(TM) SE Runtime Environment (build 1.8.0_321-b07)
Java HotSpot(TM) 64-Bit Server VM (build 25.321-b07, mixed mode)
Precise steps for testing the PR (i.e., how to demonstrate that it works correctly)
curl -k https://administrator1:administrator1@localhost:50443/contests/SumH/event-feedpc2team) and log in as team1/team1.isumit.cpp).max_run_time" property (it's the last one).run_time" property. The data for my run is shown below. The "max_run_time" property of the "judgements" notification should match the largest "run_time".max_run_time" property seen on the event feed.max_run_time" next time.curlto kill it.