Issue #2648 Add AlertMessage output.

Change-Id: I34818b15ce9a85c3b58b2475a0b1e94a596bf06e

Former-commit-id: ca109598ec [formerly f45ec64979] [formerly ca109598ec [formerly f45ec64979] [formerly c96be7613c [formerly 47826e8d3e4570c9f970fc30f5dac462611b91bf]]]
Former-commit-id: c96be7613c
Former-commit-id: 91eaba54df [formerly 4cffeac65f]
Former-commit-id: 27165c51b8
This commit is contained in:
Ben Steffensmeier 2014-02-12 17:07:16 -06:00
parent cf1d48f888
commit b59ea9ac5a
5 changed files with 93 additions and 2 deletions

View file

@ -32,7 +32,7 @@
</target>
<target name="compile" depends="init">
<javac srcdir="${src}" destdir="${bin}"/>
<javac target="1.6" srcdir="${src}" destdir="${bin}"/>
</target>
<target name="copyManifest" depends="init">

View file

@ -158,10 +158,18 @@ public class HeapDumpRecord extends AbstractHprofRecord {
System.out.println("Sorting all objects...");
long startTime = System.currentTimeMillis();
System.out.print("Instances...");
Collections.sort(instances, new DumpBufferIndexComparator());
System.out.println("Done");
System.out.print("Object Arrays...");
Collections.sort(objectArrays, new DumpBufferIndexComparator());
System.out.println("Done");
System.out.print("Primitive Arrays...");
Collections.sort(primitiveArrays, new DumpBufferIndexComparator());
System.out.println("Done");
System.out.print("Classes...");
Collections.sort(classes, new DumpBufferIndexComparator());
System.out.println("Done");
this.instancesById = new long[instances.size()];
for (int i = 0; i < instances.size(); i++) {
@ -183,8 +191,10 @@ public class HeapDumpRecord extends AbstractHprofRecord {
this.classesById[i] = classes.get(i);
}
System.out.print("Instances By Class...");
/* Add one id and one int before the class id */
Collections.sort(instances, new DumpBufferIndexComparator(idSize + 4));
System.out.println("Done");
this.instancesByClass = new long[instances.size()];
for (int i = 0; i < instances.size(); i++) {

View file

@ -0,0 +1,76 @@
/**
* This software was developed and / or modified by Raytheon Company,
* pursuant to Contract DG133W-05-CQ-1067 with the US Government.
*
* U.S. EXPORT CONTROLLED TECHNICAL DATA
* This software product contains export-restricted data whose
* export/transfer/disclosure is restricted by U.S. law. Dissemination
* to non-U.S. persons whether in the United States or abroad requires
* an export license or other authorization.
*
* Contractor Name: Raytheon Company
* Contractor Address: 6825 Pine Street, Suite 340
* Mail Stop B8
* Omaha, NE 68106
* 402.291.0100
*
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
* further licensing information.
**/
package com.raytheon.uf.viz.hprof;
import java.io.File;
import java.io.IOException;
import java.util.List;
import com.raytheon.hprof.HprofFile;
import com.raytheon.hprof.SmartInstance;
/**
*
* Export information about AlertMessages
*
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------- -------- ----------- --------------------------
* Feb 12, 2014 2648 bsteffen Initial creation
*
* </pre>
*
* @author bsteffen
* @version 1.0
*/
public class AlertMessageExporter extends AbstractExporter {
public AlertMessageExporter(HprofFile hprof, File outputDirectory) {
super(hprof, outputDirectory);
}
@Override
protected String getFileName() {
return "alertMessages.txt";
}
@Override
protected String getComment() {
return "# This file contains information about AlertMessages.";
}
@Override
protected String getInfo() {
return "Generating output for AlertMessages...";
}
@Override
protected void exportInternal() throws IOException {
List<SmartInstance> messages = getInstances("com.raytheon.uf.viz.core.alerts.AlertMessage");
for (SmartInstance message : messages) {
println(message + ": " + message.getString("dataURI"));
}
}
}

View file

@ -83,5 +83,6 @@ public class CaveExporter {
new GFEResourceExporter(hprof, outputDir).export();
new DisposingResourceExporter(hprof, outputDir).export();
new UIRunnablesExporter(hprof, outputDir).export();
new AlertMessageExporter(hprof, outputDir).export();
}
}

View file

@ -79,7 +79,11 @@ public class UIRunnablesExporter extends AbstractExporter {
.getObjectArray("messages");
println(messages.length + " message(s)");
for (SmartInstance message : messages) {
println(message.get("runnable").toString());
if (message != null) {
println(message.get("runnable").toString());
} else {
println("null");
}
}
}