Handle case where and id in the timeline is not found in the S-job_execution file.

This commit is contained in:
John M. Penn 2025-01-30 15:25:08 -06:00
parent 65d1355c26
commit 87dc1925ee
6 changed files with 68 additions and 19 deletions

View File

@ -68,8 +68,9 @@ public class FrameViewCanvas extends JPanel {
JobSpecification jobSpec = tvc.jobSpecificationMap.getJobSpecification(jobExec.id);
if ( jobSpec == null) {
g2d.drawString("???", 180, jobY);
g2d.drawString("???", 740, jobY);
g2d.setPaint( Color.RED );
g2d.drawString("UNKNOWN", 180, jobY);
g2d.drawString("UNKNOWN", 740, jobY);
} else {
g2d.drawString(jobSpec.jobClass, 180, jobY);
g2d.drawString(jobSpec.name, 740, jobY);

View File

@ -158,20 +158,24 @@ public class JobPerf {
try {
BufferedReader in = new BufferedReader( new FileReader(fileName) );
// Strip the header off the CSV file.
// Strip the header line off the CSV file.
line = in.readLine();
// Iterate through and process each of the data lines.
while( (line = in.readLine()) !=null) {
boolean isTOF = false;
boolean isEOF = false;
field = line.split(",");
String id = field[0].trim();
JobSpecification jobSpec = jobSpecificationMap.getJobSpecification(id);
boolean isTOF = false;
boolean isEOF = false;
if (jobSpec.jobClass.equals("top_of_frame")) {
isTOF = true;
} else if (jobSpec.jobClass.equals("end_of_frame")) {
isEOF = true;
}
if (jobSpec != null) {
if (jobSpec.jobClass.equals("top_of_frame")) {
isTOF = true;
} else if (jobSpec.jobClass.equals("end_of_frame")) {
isEOF = true;
}
}
double start = Double.parseDouble( field[1]);
double stop = Double.parseDouble( field[2]);
if (start < stop) {

View File

@ -178,14 +178,19 @@ public class JobStats {
for (StatisticsRecord jobStatisticsRecord : jobStatisticsList ) {
JobSpecification jobSpec = jobSpecificationMap.getJobSpecification( jobStatisticsRecord.id);
String jobName = null;
if (jobSpec != null) {
jobName = jobSpec.name;
} else {
jobName = "UNKNOWN";
}
System.out.println( String.format("%10s %14.6f %14.6f %14.6f %14.6f %s",
jobStatisticsRecord.id,
jobStatisticsRecord.meanValue,
jobStatisticsRecord.stddev,
jobStatisticsRecord.minValue,
jobStatisticsRecord.maxValue,
jobSpec.name
jobName
)
);
}

View File

@ -24,6 +24,7 @@ public class JobStatsViewCanvas extends JPanel {
}
private void doDrawing(Graphics g) {
Graphics2D g2d = (Graphics2D) g;
RenderingHints rh = new RenderingHints(
@ -57,16 +58,23 @@ public class JobStatsViewCanvas extends JPanel {
int jobY = 100;
for (StatisticsRecord jobStatisticsRecord : jobStats.jobStatisticsList ) {
JobSpecification jobSpec = jobSpecificationMap.getJobSpecification( jobStatisticsRecord.id);
g2d.setFont(dataFont);
g2d.setPaint( Color.BLACK );
g2d.drawString(jobStatisticsRecord.id, 100, jobY);
g2d.drawString( String.format("%14.6f", jobStatisticsRecord.meanValue), 180, jobY);
g2d.drawString( String.format("%14.6f", jobStatisticsRecord.stddev), 280, jobY);
g2d.drawString( String.format("%14.6f", jobStatisticsRecord.minValue), 380, jobY);
g2d.drawString( String.format("%14.6f", jobStatisticsRecord.maxValue), 480, jobY);
g2d.drawString(jobSpec.name, 600, jobY);
JobSpecification jobSpec = jobSpecificationMap.getJobSpecification( jobStatisticsRecord.id);
if (jobSpec != null) {
g2d.drawString(jobSpec.name, 600, jobY);
} else {
g2d.setPaint( Color.RED );
g2d.drawString("UNKNOWN", 600, jobY);
}
jobY += 20;
}
}

View File

@ -94,6 +94,7 @@ public class TraceViewCanvas extends JPanel {
for (JobExecutionEvent jobExec : jobExecEvtList ) {
if ((!wasTOF && jobExec.isTOF) || ( wasEOF && !jobExec.isEOF )) {
// Wrap up the previous frame record.
frameRecord.stop = jobExec.start;
frameRecord.CalculateJobContainment();
@ -152,6 +153,20 @@ public class TraceViewCanvas extends JPanel {
return frameRenderRange.first;
}
public int getLastRenderFrame() {
return frameRenderRange.last;
}
// public void moveRenderFrameRangeBy(int advance) {
//
// if ( ((frameRenderRange.first + advance) > 0) &&
// ((frameRenderRange.first + advance) < frameArray.length ))
//
//
//
// }
// }
public void setFirstRenderFrame(int first) throws InvalidFrameBoundsExpection {
if ((first >= 0) && (first <= frameRenderRange.last)) {
frameRenderRange = new FrameRange(first, frameRenderRange.last);
@ -162,10 +177,6 @@ public class TraceViewCanvas extends JPanel {
}
}
public int getLastRenderFrame() {
return frameRenderRange.last;
}
public void setLastRenderFrame(int last) throws InvalidFrameBoundsExpection {
if ((last >= frameRenderRange.first) && (last < frameArray.length)) {
frameRenderRange = new FrameRange(frameRenderRange.first, last);

View File

@ -27,6 +27,8 @@ public class TraceViewInputToolBar extends JToolBar implements ActionListener {
private TraceViewCanvas traceView;
private JTextField frameSizeField;
private JButton frameDetailsButton;
private JButton advanceRangeButton;
private JButton retreatRangeButton;
private JTextField firstRenderFrameField;
private JTextField lastRenderFrameField;
/**
@ -84,6 +86,18 @@ public class TraceViewInputToolBar extends JToolBar implements ActionListener {
}
});
advanceRangeButton = new JButton("Advance");
advanceRangeButton.addActionListener(this);
advanceRangeButton.setActionCommand("advance-frame-range");
advanceRangeButton.setToolTipText("Advance the selected range of frames to be displayed.");
add(advanceRangeButton);
advanceRangeButton = new JButton("Retreat");
advanceRangeButton.addActionListener(this);
advanceRangeButton.setActionCommand("retreat-frame-range");
advanceRangeButton.setToolTipText("Retreat the selected range of frames to be displayed.");
add(advanceRangeButton);
add( new JLabel(" "));
// Add Trick LOGO here.
@ -96,6 +110,12 @@ public class TraceViewInputToolBar extends JToolBar implements ActionListener {
case "display-frame-details":
traceView.displaySelectedFrame();
break;
case "advance-frame-range":
// DO ACTION
break;
case "retreat-frame-range":
// DO ACTION
break;
default:
System.out.println("Unknown Action Command:" + s);
break;