Merge "Issue #1584 - FFMP performance stats and performance logger Peer review comments Change-Id: I991b3fe21f1b458f45907bdc3b4716afc348992c" into development

Former-commit-id: 4fb1cb27dc [formerly a07a434ad71986aa4b474dd88e266035e347efa4]
Former-commit-id: 355e6d2c67
This commit is contained in:
Richard Peter 2013-02-18 09:35:53 -06:00 committed by Gerrit Code Review
commit 3c126b0ab1
28 changed files with 759 additions and 236 deletions

View file

@ -118,6 +118,7 @@ export pid=$$
curTime=`date +%Y%m%d_%H%M%S` curTime=`date +%Y%m%d_%H%M%S`
LOGFILE=${LOGDIR}/cave_${curTime}_pid_${pid}_console.log LOGFILE=${LOGDIR}/cave_${curTime}_pid_${pid}_console.log
export LOGFILE_CAVE=${LOGDIR}/cave_${curTime}_pid_${pid}_alertviz.log export LOGFILE_CAVE=${LOGDIR}/cave_${curTime}_pid_${pid}_alertviz.log
export LOGFILE_PERFORMANCE=${LOGDIR}/cave_${curTime}_pid_${pid}_perf.log
redirect="TRUE" redirect="TRUE"
for flag in $@; do for flag in $@; do

View file

@ -29,6 +29,16 @@
</layout> </layout>
</appender> </appender>
<appender name="PerformanceLogAppender" class="com.raytheon.uf.viz.alertviz.EnvConfigurableRollingFileAppender">
<param name="envLogVar" value="LOGFILE_PERFORMANCE" />
<param name="maxFileSize" value="2GB"/>
<param name="maxBackupIndex" value="5"/>
<param name="Append" value="true"/>
<layout class="org.apache.log4j.PatternLayout">
<param name="ConversionPattern" value="%-5p %d{dd MMM yyyy HH:mm:ss,SSS} %m%n"/>
</layout>
</appender>
<appender name="AsyncCaveLogAppender" class="org.apache.log4j.AsyncAppender"> <appender name="AsyncCaveLogAppender" class="org.apache.log4j.AsyncAppender">
<param name="BufferSize" value="500"/> <param name="BufferSize" value="500"/>
<appender-ref ref="CaveLogAppender"/> <appender-ref ref="CaveLogAppender"/>
@ -38,6 +48,15 @@
<appender-ref ref="AsyncCaveLogAppender"/> <appender-ref ref="AsyncCaveLogAppender"/>
</logger> </logger>
<appender name="AsyncPerfLogAppender" class="org.apache.log4j.AsyncAppender">
<param name="BufferSize" value="500"/>
<appender-ref ref="PerformanceLogAppender"/>
</appender>
<logger name="PerformanceLogger" additivity="false">
<level value="ALL"/>
<appender-ref ref="AsyncPerfLogAppender"/>
</logger>
<logger name="com.raytheon"> <logger name="com.raytheon">
<level value="INFO"/> <level value="INFO"/>
</logger> </logger>

View file

@ -9,7 +9,8 @@ Require-Bundle: org.eclipse.core.runtime,
com.raytheon.uf.common.event;bundle-version="1.0.0", com.raytheon.uf.common.event;bundle-version="1.0.0",
com.raytheon.uf.common.serialization.comm;bundle-version="1.12.1174", com.raytheon.uf.common.serialization.comm;bundle-version="1.12.1174",
com.raytheon.uf.common.status;bundle-version="1.12.1174", com.raytheon.uf.common.status;bundle-version="1.12.1174",
org.eclipse.ui;bundle-version="3.6.1" org.eclipse.ui;bundle-version="3.6.1",
org.apache.log4j;bundle-version="1.0.0"
Bundle-RequiredExecutionEnvironment: JavaSE-1.6 Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Bundle-ActivationPolicy: lazy Bundle-ActivationPolicy: lazy
Export-Package: com.raytheon.uf.viz.event Export-Package: com.raytheon.uf.viz.event

View file

@ -23,7 +23,8 @@ Require-Bundle: org.eclipse.ui,
com.raytheon.uf.common.cache;bundle-version="1.12.1174", com.raytheon.uf.common.cache;bundle-version="1.12.1174",
com.raytheon.uf.common.stats;bundle-version="1.0.0", com.raytheon.uf.common.stats;bundle-version="1.0.0",
com.raytheon.uf.viz.stats;bundle-version="1.0.0", com.raytheon.uf.viz.stats;bundle-version="1.0.0",
com.raytheon.uf.common.event;bundle-version="1.0.0" com.raytheon.uf.common.event;bundle-version="1.0.0",
org.apache.log4j;bundle-version="1.0.0"
Bundle-RequiredExecutionEnvironment: JavaSE-1.6 Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Bundle-ActivationPolicy: lazy Bundle-ActivationPolicy: lazy
Import-Package: com.raytheon.uf.common.colormap, Import-Package: com.raytheon.uf.common.colormap,

View file

@ -42,6 +42,10 @@ import org.eclipse.swt.widgets.Shell;
import com.raytheon.uf.common.monitor.xml.ProductRunXML; import com.raytheon.uf.common.monitor.xml.ProductRunXML;
import com.raytheon.uf.common.monitor.xml.ProductXML; import com.raytheon.uf.common.monitor.xml.ProductXML;
import com.raytheon.uf.common.status.IPerformanceStatusHandler;
import com.raytheon.uf.common.status.PerformanceStatus;
import com.raytheon.uf.common.time.util.ITimer;
import com.raytheon.uf.common.time.util.TimeUtil;
import com.raytheon.uf.viz.core.RGBColors; import com.raytheon.uf.viz.core.RGBColors;
import com.raytheon.uf.viz.monitor.ffmp.FFMPMonitor; import com.raytheon.uf.viz.monitor.ffmp.FFMPMonitor;
import com.raytheon.uf.viz.monitor.ffmp.ui.dialogs.BasinTrendCommon.PlotItems; import com.raytheon.uf.viz.monitor.ffmp.ui.dialogs.BasinTrendCommon.PlotItems;
@ -65,6 +69,7 @@ import com.raytheon.viz.ui.dialogs.CaveSWTDialog;
* ------------ ---------- ----------- -------------------------- * ------------ ---------- ----------- --------------------------
* Initial creation * Initial creation
* Dec 6, 2012 1353 rferrel Code clean up for non-blocking dialog. * Dec 6, 2012 1353 rferrel Code clean up for non-blocking dialog.
* Feb 10, 2013 1584 mpduff Add performance logging.
* *
* </pre> * </pre>
* *
@ -72,6 +77,13 @@ import com.raytheon.viz.ui.dialogs.CaveSWTDialog;
* @version 1.0 * @version 1.0
*/ */
public class BasinTrendDlg extends CaveSWTDialog { public class BasinTrendDlg extends CaveSWTDialog {
/** Performance log message prefix */
private final String prefix = "FFMP Basin Trend:";
/** Performance logger */
private final IPerformanceStatusHandler perfLog = PerformanceStatus
.getHandler(prefix);
/** /**
* Main composite. * Main composite.
*/ */
@ -141,12 +153,12 @@ public class BasinTrendDlg extends CaveSWTDialog {
/** /**
* QPFSCAN radio button. * QPFSCAN radio button.
*/ */
private List<Button> qpfRdos = new ArrayList<Button>(); private final List<Button> qpfRdos = new ArrayList<Button>();
/** /**
* RFCFFG radio button. * RFCFFG radio button.
*/ */
private List<Button> ffgRdos = new ArrayList<Button>(); private final List<Button> ffgRdos = new ArrayList<Button>();
/** /**
* Background color for controls and graph. * Background color for controls and graph.
@ -221,7 +233,8 @@ public class BasinTrendDlg extends CaveSWTDialog {
/** /**
* Date/Time format. * Date/Time format.
*/ */
private SimpleDateFormat sdf = new SimpleDateFormat("MMM dd yy HH:mm z"); private final SimpleDateFormat sdf = new SimpleDateFormat(
"MMM dd yy HH:mm z");
private boolean vgb = false; private boolean vgb = false;
@ -229,7 +242,8 @@ public class BasinTrendDlg extends CaveSWTDialog {
private Date currentDate; private Date currentDate;
private FFMPResource resource; /** The FFMP Resource */
private final FFMPResource resource;
private final List<ISourceUpdate> sourceListeners = new ArrayList<ISourceUpdate>(); private final List<ISourceUpdate> sourceListeners = new ArrayList<ISourceUpdate>();
@ -238,6 +252,14 @@ public class BasinTrendDlg extends CaveSWTDialog {
* *
* @param parent * @param parent
* Parent shell. * Parent shell.
* @param resource
* The Resource
* @param date
* The Date
* @param pfaf
* The pfaf
* @param vgb
* The VGB
* @param graphData * @param graphData
* Graph data. * Graph data.
*/ */
@ -1000,6 +1022,9 @@ public class BasinTrendDlg extends CaveSWTDialog {
*/ */
private void updatePlotSelection(Button plotBtn, private void updatePlotSelection(Button plotBtn,
boolean updateLegendAndGraph) { boolean updateLegendAndGraph) {
ITimer timer = TimeUtil.getTimer();
timer.start();
PlotItems plotItem = (PlotItems) plotBtn.getData(); PlotItems plotItem = (PlotItems) plotBtn.getData();
if (plotItem == PlotItems.RATE) { if (plotItem == PlotItems.RATE) {
@ -1056,6 +1081,9 @@ public class BasinTrendDlg extends CaveSWTDialog {
updateColorLegend(); updateColorLegend();
updateGraph(); updateGraph();
} }
timer.stop();
perfLog.logDuration("Graph update", timer.getElapsedTime());
} }
/** /**

View file

@ -57,9 +57,14 @@ import com.raytheon.uf.common.monitor.config.FFMPSourceConfigurationManager;
import com.raytheon.uf.common.monitor.config.FFMPTemplateConfigurationManager; import com.raytheon.uf.common.monitor.config.FFMPTemplateConfigurationManager;
import com.raytheon.uf.common.monitor.xml.DomainXML; import com.raytheon.uf.common.monitor.xml.DomainXML;
import com.raytheon.uf.common.monitor.xml.FFMPRunXML; import com.raytheon.uf.common.monitor.xml.FFMPRunXML;
import com.raytheon.uf.common.stats.LoadEvent;
import com.raytheon.uf.common.status.IPerformanceStatusHandler;
import com.raytheon.uf.common.status.IUFStatusHandler; import com.raytheon.uf.common.status.IUFStatusHandler;
import com.raytheon.uf.common.status.PerformanceStatus;
import com.raytheon.uf.common.status.UFStatus; import com.raytheon.uf.common.status.UFStatus;
import com.raytheon.uf.common.status.UFStatus.Priority; import com.raytheon.uf.common.status.UFStatus.Priority;
import com.raytheon.uf.common.time.util.ITimer;
import com.raytheon.uf.common.time.util.TimeUtil;
import com.raytheon.uf.viz.core.exception.VizException; import com.raytheon.uf.viz.core.exception.VizException;
import com.raytheon.uf.viz.core.localization.LocalizationManager; import com.raytheon.uf.viz.core.localization.LocalizationManager;
import com.raytheon.uf.viz.monitor.events.IMonitorConfigurationEvent; import com.raytheon.uf.viz.monitor.events.IMonitorConfigurationEvent;
@ -85,6 +90,7 @@ import com.raytheon.uf.viz.monitor.ffmp.ui.rsc.FFMPResource;
import com.raytheon.uf.viz.monitor.ffmp.ui.rsc.FFMPTableDataLoader; import com.raytheon.uf.viz.monitor.ffmp.ui.rsc.FFMPTableDataLoader;
import com.raytheon.uf.viz.monitor.ffmp.ui.rsc.FFMPTableDataUpdate; import com.raytheon.uf.viz.monitor.ffmp.ui.rsc.FFMPTableDataUpdate;
import com.raytheon.uf.viz.monitor.listeners.IMonitorListener; import com.raytheon.uf.viz.monitor.listeners.IMonitorListener;
import com.raytheon.uf.viz.stats.collector.StatsCollector;
import com.raytheon.viz.ui.dialogs.CaveSWTDialog; import com.raytheon.viz.ui.dialogs.CaveSWTDialog;
import com.raytheon.viz.ui.dialogs.ICloseCallback; import com.raytheon.viz.ui.dialogs.ICloseCallback;
@ -105,6 +111,7 @@ import com.raytheon.viz.ui.dialogs.ICloseCallback;
* Changes for non-blocking AttributesDlg. * Changes for non-blocking AttributesDlg.
* Changes for non-blocking AttributeThresholdDlg. * Changes for non-blocking AttributeThresholdDlg.
* Changes for non-blocking LoadSaveConfigDlg. * Changes for non-blocking LoadSaveConfigDlg.
* Feb 10, 2013 1584 mpduff Add performance logging.
* *
* </pre> * </pre>
* *
@ -118,11 +125,21 @@ public class FfmpBasinTableDlg extends CaveSWTDialog implements
private final IUFStatusHandler statusHandler = UFStatus private final IUFStatusHandler statusHandler = UFStatus
.getHandler(FfmpBasinTableDlg.class); .getHandler(FfmpBasinTableDlg.class);
/** Performance message prefix */
private final String prefix = "FFMP Basin Table:";
/** Performance logger */
private final IPerformanceStatusHandler perfLog = PerformanceStatus
.getHandler(prefix);
private final String initialLoadKey = "FFMP Basin Table Initial Load";
private LoadSaveConfigDlg loadDlg; private LoadSaveConfigDlg loadDlg;
private LoadSaveConfigDlg saveDlg; private LoadSaveConfigDlg saveDlg;
private List<FFMPTableDataLoader> retrievalQueue = new ArrayList<FFMPTableDataLoader>(); /** Retrieval queue */
private final List<FFMPTableDataLoader> retrievalQueue = new ArrayList<FFMPTableDataLoader>();
private MenuItem linkToFrameMI; private MenuItem linkToFrameMI;
@ -199,7 +216,8 @@ public class FfmpBasinTableDlg extends CaveSWTDialog implements
private final List<String> cwas = new ArrayList<String>(); private final List<String> cwas = new ArrayList<String>();
private List<MenuItem> sourceMenuItems = new ArrayList<MenuItem>(); /** Source menu item list */
private final List<MenuItem> sourceMenuItems = new ArrayList<MenuItem>();
private Date date = null; private Date date = null;
@ -236,6 +254,16 @@ public class FfmpBasinTableDlg extends CaveSWTDialog implements
private boolean groupLabelFlag = true; private boolean groupLabelFlag = true;
/**
* Statistics load event.
*/
private LoadEvent loadEvent;
/**
* Previously selected HUC level
*/
private String previousHuc;
public FfmpBasinTableDlg(Shell parent, FFMPTableData tData, public FfmpBasinTableDlg(Shell parent, FFMPTableData tData,
FFMPResource resource) { FFMPResource resource) {
super(parent, SWT.DIALOG_TRIM | SWT.RESIZE, CAVE.INDEPENDENT_SHELL super(parent, SWT.DIALOG_TRIM | SWT.RESIZE, CAVE.INDEPENDENT_SHELL
@ -298,6 +326,13 @@ public class FfmpBasinTableDlg extends CaveSWTDialog implements
@Override @Override
protected void initializeComponents(Shell shell) { protected void initializeComponents(Shell shell) {
// Load time stat
loadEvent = new LoadEvent();
loadEvent.setType("FFMP Initial Load");
loadEvent.setMessage("FFMP Basin Table Initial Load");
StatsCollector.start(initialLoadKey, loadEvent);
perfLog.log("Launched");
shell.addShellListener(new ShellAdapter() { shell.addShellListener(new ShellAdapter() {
@Override @Override
public void shellClosed(ShellEvent e) { public void shellClosed(ShellEvent e) {
@ -337,7 +372,10 @@ public class FfmpBasinTableDlg extends CaveSWTDialog implements
refreshDisplay(true); refreshDisplay(true);
} }
public void createMenus() { /**
* Create the menus.
*/
private void createMenus() {
Menu menuBar = new Menu(shell, SWT.BAR); Menu menuBar = new Menu(shell, SWT.BAR);
createFileMenu(menuBar); createFileMenu(menuBar);
@ -750,6 +788,9 @@ public class FfmpBasinTableDlg extends CaveSWTDialog implements
cwaMI.addSelectionListener(new SelectionAdapter() { cwaMI.addSelectionListener(new SelectionAdapter() {
@Override @Override
public void widgetSelected(SelectionEvent event) { public void widgetSelected(SelectionEvent event) {
MenuItem mi = (MenuItem) event.getSource();
perfLog.log("CWA " + mi.getText()
+ (mi.getSelection() ? " selected" : " unselected"));
updateD2DRefresh(); updateD2DRefresh();
updateCWA(event); updateCWA(event);
} }
@ -1278,6 +1319,9 @@ public class FfmpBasinTableDlg extends CaveSWTDialog implements
public void attributeDisplayAction(boolean updateData, public void attributeDisplayAction(boolean updateData,
AttributesDlgData attrData) { AttributesDlgData attrData) {
shell.setCursor(getDisplay().getSystemCursor(SWT.CURSOR_WAIT)); shell.setCursor(getDisplay().getSystemCursor(SWT.CURSOR_WAIT));
ITimer timer = TimeUtil.getTimer();
timer.start();
this.attrData = attrData; this.attrData = attrData;
// Update the data in the FFMPConfig with the selections // Update the data in the FFMPConfig with the selections
@ -1311,6 +1355,8 @@ public class FfmpBasinTableDlg extends CaveSWTDialog implements
shell.pack(); shell.pack();
shell.redraw(); shell.redraw();
resetCursor(); resetCursor();
timer.stop();
perfLog.logDuration("Column Add/Remove time", timer.getElapsedTime());
} }
@Override @Override
@ -1566,15 +1612,19 @@ public class FfmpBasinTableDlg extends CaveSWTDialog implements
fireCWAChangedEvent(mi.getText(), mi.getSelection()); fireCWAChangedEvent(mi.getText(), mi.getSelection());
} }
/**
* Update the layer.
*/
private void updateLayer(SelectionEvent event) { private void updateLayer(SelectionEvent event) {
shell.setCursor(getDisplay().getSystemCursor(SWT.CURSOR_WAIT)); shell.setCursor(getDisplay().getSystemCursor(SWT.CURSOR_WAIT));
updateD2DRefresh(); updateD2DRefresh();
MenuItem mi = (MenuItem) event.getSource(); MenuItem mi = (MenuItem) event.getSource();
String huc = (String) mi.getData(); String msg = previousHuc + " to " + mi.getText();
perfLog.log("Update Layer Called, " + msg);
String huc = (String) mi.getData();
previousHuc = mi.getText();
ffmpConfig.getFFMPConfigData().setLayer(huc); ffmpConfig.getFFMPConfigData().setLayer(huc);
fireHucChangedEvent(huc); fireHucChangedEvent(huc);
} }
@ -1611,6 +1661,7 @@ public class FfmpBasinTableDlg extends CaveSWTDialog implements
* Fire Table reload event * Fire Table reload event
*/ */
private void fireTableRestoreEvent() { private void fireTableRestoreEvent() {
perfLog.log("Table Restore Called");
shell.setCursor(getDisplay().getSystemCursor(SWT.CURSOR_WAIT)); shell.setCursor(getDisplay().getSystemCursor(SWT.CURSOR_WAIT));
groupLbl.setText(""); groupLbl.setText("");
@ -1635,6 +1686,7 @@ public class FfmpBasinTableDlg extends CaveSWTDialog implements
this); this);
shell.setCursor(getDisplay().getSystemCursor(SWT.CURSOR_WAIT)); shell.setCursor(getDisplay().getSystemCursor(SWT.CURSOR_WAIT));
Display.getDefault().asyncExec(new Runnable() { Display.getDefault().asyncExec(new Runnable() {
@Override
public void run() { public void run() {
FFMPMonitor.getInstance().configUpdate(me); FFMPMonitor.getInstance().configUpdate(me);
} }
@ -1661,6 +1713,7 @@ public class FfmpBasinTableDlg extends CaveSWTDialog implements
try { try {
setGraphData(resource.getGraphData(pfaf), pfaf, setGraphData(resource.getGraphData(pfaf), pfaf,
differentPfaf, ffmpDate); differentPfaf, ffmpDate);
perfLog.log("Graph Display Complete");
} catch (VizException e) { } catch (VizException e) {
shell.setCursor(null); shell.setCursor(null);
statusHandler.handle(Priority.PROBLEM, statusHandler.handle(Priority.PROBLEM,
@ -1680,27 +1733,32 @@ public class FfmpBasinTableDlg extends CaveSWTDialog implements
public void resetData(FFMPTableData tData) { public void resetData(FFMPTableData tData) {
if (!ffmpTable.isDisposed()) { if (!ffmpTable.isDisposed()) {
this.mainTableData = tData; this.mainTableData = tData;
// System.out.println("---" + tData.getTableRows().size());
ffmpTable.clearTableSelection(); ffmpTable.clearTableSelection();
// long time = System.currentTimeMillis();
ffmpTable ffmpTable
.setCenteredAggregationKey(resource.centeredAggregationKey); .setCenteredAggregationKey(resource.centeredAggregationKey);
ffmpTable.setTableData(mainTableData); ffmpTable.setTableData(mainTableData);
// long time1 = System.currentTimeMillis();
resetCursor(); resetCursor();
shell.pack(); shell.pack();
shell.redraw(); shell.redraw();
// System.out if (loadEvent != null) {
// .println("Time to load Data into table " + (time1 - time)); StatsCollector.stop(initialLoadKey);
loadEvent = null;
}
perfLog.log("Table update complete");
} }
} }
/**
* {@inheritDoc}
*/
@Override @Override
public void tableSelection(String pfaf, String name) { public void tableSelection(String pfaf, String name) {
if (groupLbl.getText().length() > 0) { if (groupLbl.getText().length() > 0) {
groupLabelFlag = false; groupLabelFlag = false;
} else {
perfLog.log("Table Selection");
} }
if ((groupLbl.getText().length() == 0) if ((groupLbl.getText().length() == 0)
@ -1712,10 +1770,14 @@ public class FfmpBasinTableDlg extends CaveSWTDialog implements
fireScreenRecenterEvent(pfaf, 1); fireScreenRecenterEvent(pfaf, 1);
} }
/**
* {@inheritDoc}
*/
@Override @Override
public void displayBasinTrend(String pfaf) { public void displayBasinTrend(String pfaf) {
if (pfaf != null) { if (pfaf != null) {
shell.setCursor(getDisplay().getSystemCursor(SWT.CURSOR_WAIT)); shell.setCursor(getDisplay().getSystemCursor(SWT.CURSOR_WAIT));
perfLog.log("Basin Trend Graph Launch");
fireGraphDataEvent(pfaf, true, this.date); fireGraphDataEvent(pfaf, true, this.date);
} }
} }
@ -1822,6 +1884,7 @@ public class FfmpBasinTableDlg extends CaveSWTDialog implements
if (menuDataType.compareTo(layer) == 0) { if (menuDataType.compareTo(layer) == 0) {
mi.setSelection(true); mi.setSelection(true);
this.previousHuc = mi.getText();
break; break;
} }
} }
@ -2059,9 +2122,11 @@ public class FfmpBasinTableDlg extends CaveSWTDialog implements
resource.manageLoaders(status); resource.manageLoaders(status);
} }
/**
* {@inheritDoc}
*/
@Override @Override
public void notify(IMonitorEvent me) { public void notify(IMonitorEvent me) {
if (!this.isDisposed()) { if (!this.isDisposed()) {
shell.setCursor(getDisplay().getSystemCursor(SWT.CURSOR_WAIT)); shell.setCursor(getDisplay().getSystemCursor(SWT.CURSOR_WAIT));
FFMPTableDataLoader tableLoader = new FFMPTableDataLoader(me, FFMPTableDataLoader tableLoader = new FFMPTableDataLoader(me,
@ -2160,11 +2225,10 @@ public class FfmpBasinTableDlg extends CaveSWTDialog implements
updateGapValueLabel(fupdateData.getGapValueLabel()); updateGapValueLabel(fupdateData.getGapValueLabel());
resetCursor(); resetCursor();
} }
/** /**
* used to blank the group label when channging HUC while in an aggregate. * used to blank the group label when changing HUC while in an aggregate.
*/ */
public void blankGroupLabel() { public void blankGroupLabel() {
if (groupLbl != null) { if (groupLbl != null) {

View file

@ -77,10 +77,13 @@ import com.raytheon.uf.common.monitor.config.FFMPSourceConfigurationManager;
import com.raytheon.uf.common.monitor.xml.DomainXML; import com.raytheon.uf.common.monitor.xml.DomainXML;
import com.raytheon.uf.common.monitor.xml.ProductXML; import com.raytheon.uf.common.monitor.xml.ProductXML;
import com.raytheon.uf.common.monitor.xml.SourceXML; import com.raytheon.uf.common.monitor.xml.SourceXML;
import com.raytheon.uf.common.status.IPerformanceStatusHandler;
import com.raytheon.uf.common.status.IUFStatusHandler; import com.raytheon.uf.common.status.IUFStatusHandler;
import com.raytheon.uf.common.status.PerformanceStatus;
import com.raytheon.uf.common.status.UFStatus; import com.raytheon.uf.common.status.UFStatus;
import com.raytheon.uf.common.status.UFStatus.Priority; import com.raytheon.uf.common.status.UFStatus.Priority;
import com.raytheon.uf.common.time.DataTime; import com.raytheon.uf.common.time.DataTime;
import com.raytheon.uf.common.time.util.ITimer;
import com.raytheon.uf.common.time.util.TimeUtil; import com.raytheon.uf.common.time.util.TimeUtil;
import com.raytheon.uf.viz.core.DrawableString; import com.raytheon.uf.viz.core.DrawableString;
import com.raytheon.uf.viz.core.IDisplayPaneContainer; import com.raytheon.uf.viz.core.IDisplayPaneContainer;
@ -156,6 +159,7 @@ import com.vividsolutions.jts.geom.Point;
* 10 Jan 2013 1475 dhladky Some cleanup * 10 Jan 2013 1475 dhladky Some cleanup
* 27 Jan 2013 1478 dhladky Changed gap collection to a generic list instead of Arraylist * 27 Jan 2013 1478 dhladky Changed gap collection to a generic list instead of Arraylist
* 02/01/13 1569 D. Hladky Added constants * 02/01/13 1569 D. Hladky Added constants
* 10 Feb 2013 1584 mpduff Add performance logging.
* </pre> * </pre>
* *
* @author dhladky * @author dhladky
@ -167,9 +171,17 @@ public class FFMPResource extends
IResourceDataChanged, IFFMPResourceListener, FFMPListener, IResourceDataChanged, IFFMPResourceListener, FFMPListener,
FFMPLoadListener { FFMPLoadListener {
private static final transient IUFStatusHandler statusHandler = UFStatus /** Status handler */
private static final IUFStatusHandler statusHandler = UFStatus
.getHandler(FFMPResource.class); .getHandler(FFMPResource.class);
/** Performance log statement prefix */
private final String prefix = "FFMP Resource:";
/** Performance logger */
private final IPerformanceStatusHandler perfLog = PerformanceStatus
.getHandler(prefix);
/** /**
* The zoom level for an aggregate view. * The zoom level for an aggregate view.
*/ */
@ -224,7 +236,7 @@ public class FFMPResource extends
private IShadedShape streamShadedShape = null; private IShadedShape streamShadedShape = null;
/** always the same vertexes, one for each CWA **/ /** always the same vertexes, one for each CWA **/
private FFMPShapeContainer shadedShapes = new FFMPShapeContainer(); private final FFMPShapeContainer shadedShapes = new FFMPShapeContainer();
/** Basin shaded shape **/ /** Basin shaded shape **/
protected ConcurrentHashMap<DataTime, FFMPDrawable> drawables = new ConcurrentHashMap<DataTime, FFMPDrawable>(); protected ConcurrentHashMap<DataTime, FFMPDrawable> drawables = new ConcurrentHashMap<DataTime, FFMPDrawable>();
@ -257,6 +269,7 @@ public class FFMPResource extends
public boolean handleMouseUp(int x, int y, int mouseButton) { public boolean handleMouseUp(int x, int y, int mouseButton) {
if (mouseButton == 3) { if (mouseButton == 3) {
if (isStreamFollow()) { if (isStreamFollow()) {
perfLog.log("Basin Trace Draw Init");
traceClick(getResourceContainer().translateClick(x, y)); traceClick(getResourceContainer().translateClick(x, y));
return true; return true;
} }
@ -414,9 +427,13 @@ public class FFMPResource extends
dataTimes = new ArrayList<DataTime>(); dataTimes = new ArrayList<DataTime>();
} }
/**
* {@inheritDoc}
*/
@Override @Override
public void resourceChanged(ChangeType type, Object object) { public void resourceChanged(ChangeType type, Object object) {
ITimer timer = TimeUtil.getTimer();
timer.start();
if (type.equals(ChangeType.DATA_UPDATE)) { if (type.equals(ChangeType.DATA_UPDATE)) {
FFFGDataMgr.getUpdatedInstance(); FFFGDataMgr.getUpdatedInstance();
PluginDataObject[] pdos = (PluginDataObject[]) object; PluginDataObject[] pdos = (PluginDataObject[]) object;
@ -494,6 +511,11 @@ public class FFMPResource extends
} }
refresh(); refresh();
if (type.equals(ChangeType.DATA_UPDATE)) {
timer.stop();
perfLog.logDuration("Load Time", timer.getElapsedTime());
}
} }
/** /**
@ -522,6 +544,9 @@ public class FFMPResource extends
issueRefresh(); issueRefresh();
} }
/**
* {@inheritDoc}
*/
@Override @Override
public void hucChanged() { public void hucChanged() {
@ -533,6 +558,7 @@ public class FFMPResource extends
dirty(); dirty();
issueRefresh(); issueRefresh();
} }
perfLog.log("HUC Change complete");
} }
@Override @Override
@ -1117,6 +1143,7 @@ public class FFMPResource extends
// DR 14522: use Display.getDefault().asyncExec() for GUI thread. // DR 14522: use Display.getDefault().asyncExec() for GUI thread.
org.eclipse.swt.widgets.Display.getDefault().asyncExec(new Runnable() { org.eclipse.swt.widgets.Display.getDefault().asyncExec(new Runnable() {
@Override
public void run() { public void run() {
if (/* this. */font == null) { if (/* this. */font == null) {
@ -1403,7 +1430,7 @@ public class FFMPResource extends
} }
// draw stream trace? // draw stream trace?
if (getShowStream() && isStreamFollow()) { if (isShowStream() && isStreamFollow()) {
paintUpAndDownStream(aTarget, paintProps, isShaded); paintUpAndDownStream(aTarget, paintProps, isShaded);
} }
@ -1465,11 +1492,11 @@ public class FFMPResource extends
.getColor(); .getColor();
} }
if (getShowStream() && (streamShadedShape != null) if (isShowStream() && (streamShadedShape != null)
&& streamShadedShape.isDrawable() && isShaded) { && streamShadedShape.isDrawable() && isShaded) {
target.drawShadedShape(streamShadedShape, paintProps.getAlpha()); target.drawShadedShape(streamShadedShape, paintProps.getAlpha());
} }
if (getShowStream() && (streamOutlineShape != null) if (isShowStream() && (streamOutlineShape != null)
&& streamOutlineShape.isDrawable() && streamOutlineShape.isDrawable()
&& getCapability(OutlineCapability.class).isOutlineOn()) { && getCapability(OutlineCapability.class).isOutlineOn()) {
target.drawWireframeShape(streamOutlineShape, basinTraceColor, target.drawWireframeShape(streamOutlineShape, basinTraceColor,
@ -1808,7 +1835,6 @@ public class FFMPResource extends
if (!stream.equals(FFMPRecord.CLICK_TYPE.TREND)) { if (!stream.equals(FFMPRecord.CLICK_TYPE.TREND)) {
nextStreamPfaf = newPfaf; nextStreamPfaf = newPfaf;
dirty(); dirty();
} }
} else { } else {
Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow() Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow()
@ -1976,6 +2002,7 @@ public class FFMPResource extends
/** /**
* close our dialog(s) * close our dialog(s)
*/ */
@Override
public void closeDialog() { public void closeDialog() {
monitor.closeDialog(this); monitor.closeDialog(this);
} }
@ -1989,6 +2016,7 @@ public class FFMPResource extends
/** /**
* set the query runner * set the query runner
*/ */
@Override
public void setQuery(boolean isQuery) { public void setQuery(boolean isQuery) {
this.isQuery = isQuery; this.isQuery = isQuery;
} }
@ -1996,6 +2024,7 @@ public class FFMPResource extends
/** /**
* clear them * clear them
*/ */
@Override
public void clear() { public void clear() {
if (drawables != null) { if (drawables != null) {
for (Entry<DataTime, FFMPDrawable> entry : drawables.entrySet()) { for (Entry<DataTime, FFMPDrawable> entry : drawables.entrySet()) {
@ -2009,6 +2038,7 @@ public class FFMPResource extends
/** /**
* Set them all for re-rendering * Set them all for re-rendering
*/ */
@Override
public void dirty() { public void dirty() {
if (drawables != null) { if (drawables != null) {
for (Entry<DataTime, FFMPDrawable> entry : drawables.entrySet()) { for (Entry<DataTime, FFMPDrawable> entry : drawables.entrySet()) {
@ -2055,6 +2085,7 @@ public class FFMPResource extends
* *
* @param paintTime * @param paintTime
*/ */
@Override
public void setPaintTime(DataTime paintTime) { public void setPaintTime(DataTime paintTime) {
this.paintTime = paintTime; this.paintTime = paintTime;
} }
@ -2283,6 +2314,7 @@ public class FFMPResource extends
/** /**
* Clear the worst case hash * Clear the worst case hash
*/ */
@Override
public void clearWorstCase() { public void clearWorstCase() {
for (Entry<DataTime, FFMPDrawable> entry : drawables.entrySet()) { for (Entry<DataTime, FFMPDrawable> entry : drawables.entrySet()) {
entry.getValue().worstCaseHash.clear(); entry.getValue().worstCaseHash.clear();
@ -2370,10 +2402,10 @@ public class FFMPResource extends
private class FFMPDataRetrievalJob extends Job { private class FFMPDataRetrievalJob extends Job {
private static final int QUEUE_LIMIT = 1; private static final int QUEUE_LIMIT = 1;
private HucLevelGeometriesFactory hucGeomFactory = HucLevelGeometriesFactory private final HucLevelGeometriesFactory hucGeomFactory = HucLevelGeometriesFactory
.getInstance(); .getInstance();
private ArrayBlockingQueue<Request> requestQueue = new ArrayBlockingQueue<Request>( private final ArrayBlockingQueue<Request> requestQueue = new ArrayBlockingQueue<Request>(
QUEUE_LIMIT); QUEUE_LIMIT);
public FFMPDataRetrievalJob() { public FFMPDataRetrievalJob() {
@ -2955,7 +2987,7 @@ public class FFMPResource extends
streamOutlineShape = localWireframeShape; streamOutlineShape = localWireframeShape;
streamShadedShape = localShadedShape; streamShadedShape = localShadedShape;
perfLog.log("Basin Trace Shapes Complete");
} }
} }
@ -3034,7 +3066,8 @@ public class FFMPResource extends
@Override @Override
public void hucChanged(FFMPHUCChangeEvent fhce) { public void hucChanged(FFMPHUCChangeEvent fhce) {
ITimer timer = TimeUtil.getTimer();
timer.start();
setHuc((String) fhce.getSource()); setHuc((String) fhce.getSource());
centeredAggregationKey = null; centeredAggregationKey = null;
centeredAggregatePfafList = null; centeredAggregatePfafList = null;
@ -3050,6 +3083,8 @@ public class FFMPResource extends
} }
updateDialog(); updateDialog();
timer.stop();
perfLog.logDuration("HUC Update complete", timer.getElapsedTime());
} }
@Override @Override
@ -3201,8 +3236,13 @@ public class FFMPResource extends
this.isLinkToFrame = isLinkToFrame; this.isLinkToFrame = isLinkToFrame;
} }
/**
* {@inheritDoc}
*/
@Override @Override
public FFMPGraphData getGraphData(String pfafString) throws VizException { public FFMPGraphData getGraphData(String pfafString) throws VizException {
ITimer timer = TimeUtil.getTimer();
timer.start();
FfmpTableConfig tableConfig = FfmpTableConfig.getInstance(); FfmpTableConfig tableConfig = FfmpTableConfig.getInstance();
String ffgGraphType = tableConfig.getTableConfigData(getSiteKey()) String ffgGraphType = tableConfig.getTableConfigData(getSiteKey())
.getFfgGraphType(); .getFfgGraphType();
@ -3468,14 +3508,23 @@ public class FFMPResource extends
} }
} }
} }
timer.stop();
perfLog.logDuration("Graph Data processing", timer.getElapsedTime());
return fgd; return fgd;
} }
public boolean getShowStream() { /**
* @return showStream
*/
public boolean isShowStream() {
return showStream; return showStream;
} }
/**
* {@inheritDoc}
*/
@Override
public void setBasinToggle(boolean val) { public void setBasinToggle(boolean val) {
showBasin = val; showBasin = val;
refresh(); refresh();
@ -3501,6 +3550,10 @@ public class FFMPResource extends
refresh(); refresh();
} }
/**
* {@inheritDoc}
*/
@Override
public void setStreamToggle(boolean val) { public void setStreamToggle(boolean val) {
showStream = val; showStream = val;
refresh(); refresh();
@ -3547,8 +3600,8 @@ public class FFMPResource extends
synchronized (tableTime) { synchronized (tableTime) {
Date recentTime = getMostRecentTime(); Date recentTime = getMostRecentTime();
long time = new Double(recentTime.getTime() - (TimeUtil.MILLIS_PER_HOUR) long time = new Double(recentTime.getTime()
* getTime()).longValue(); - (TimeUtil.MILLIS_PER_HOUR) * getTime()).longValue();
Date date = new Date(); Date date = new Date();
date.setTime(time); date.setTime(time);
this.tableTime = date; this.tableTime = date;
@ -3779,6 +3832,7 @@ public class FFMPResource extends
/** /**
* update the data in the dialog * update the data in the dialog
*/ */
@Override
public void updateDialog() { public void updateDialog() {
if (basinTableDlg != null) { if (basinTableDlg != null) {
monitor.fireMonitorEvent(basinTableDlg.getClass().getName()); monitor.fireMonitorEvent(basinTableDlg.getClass().getName());
@ -3879,6 +3933,10 @@ public class FFMPResource extends
return isWorstCase; return isWorstCase;
} }
/**
* {@inheritDoc}
*/
@Override
public boolean isAutoRefresh() { public boolean isAutoRefresh() {
return isAutoRefresh; return isAutoRefresh;
} }
@ -4007,7 +4065,8 @@ public class FFMPResource extends
this.qpeSourceExpiration = monitor.getSourceConfig() this.qpeSourceExpiration = monitor.getSourceConfig()
.getSource(resourceData.getPrimarySource()) .getSource(resourceData.getPrimarySource())
.getExpirationMinutes(getSiteKey()) * TimeUtil.MILLIS_PER_MINUTE; .getExpirationMinutes(getSiteKey())
* TimeUtil.MILLIS_PER_MINUTE;
} }
return qpeSourceExpiration; return qpeSourceExpiration;
} }
@ -4030,7 +4089,8 @@ public class FFMPResource extends
source = FFMPSourceConfigurationManager.getInstance() source = FFMPSourceConfigurationManager.getInstance()
.getSource(getResourceData().sourceName); .getSource(getResourceData().sourceName);
} }
qpfSourceExpiration = source.getExpirationMinutes(getSiteKey()) * TimeUtil.MILLIS_PER_MINUTE; qpfSourceExpiration = source.getExpirationMinutes(getSiteKey())
* TimeUtil.MILLIS_PER_MINUTE;
} }
return qpfSourceExpiration; return qpfSourceExpiration;
} }
@ -4053,12 +4113,14 @@ public class FFMPResource extends
SourceXML source = getProduct().getGuidanceSourcesByType( SourceXML source = getProduct().getGuidanceSourcesByType(
guidSrc).get(0); guidSrc).get(0);
guidSourceExpiration = source guidSourceExpiration = source
.getExpirationMinutes(getSiteKey()) * TimeUtil.MILLIS_PER_MINUTE; .getExpirationMinutes(getSiteKey())
* TimeUtil.MILLIS_PER_MINUTE;
} else { } else {
guidSourceExpiration = monitor.getSourceConfig() guidSourceExpiration = monitor.getSourceConfig()
.getSource(resourceData.getPrimarySource()) .getSource(resourceData.getPrimarySource())
.getExpirationMinutes(getSiteKey()) * TimeUtil.MILLIS_PER_MINUTE; .getExpirationMinutes(getSiteKey())
* TimeUtil.MILLIS_PER_MINUTE;
} }
} }

View file

@ -46,7 +46,9 @@ import com.raytheon.uf.common.monitor.xml.DomainXML;
import com.raytheon.uf.common.monitor.xml.ProductRunXML; import com.raytheon.uf.common.monitor.xml.ProductRunXML;
import com.raytheon.uf.common.monitor.xml.ProductXML; import com.raytheon.uf.common.monitor.xml.ProductXML;
import com.raytheon.uf.common.monitor.xml.SourceXML; import com.raytheon.uf.common.monitor.xml.SourceXML;
import com.raytheon.uf.common.status.IPerformanceStatusHandler;
import com.raytheon.uf.common.status.IUFStatusHandler; import com.raytheon.uf.common.status.IUFStatusHandler;
import com.raytheon.uf.common.status.PerformanceStatus;
import com.raytheon.uf.common.status.UFStatus; import com.raytheon.uf.common.status.UFStatus;
import com.raytheon.uf.common.status.UFStatus.Priority; import com.raytheon.uf.common.status.UFStatus.Priority;
import com.raytheon.uf.common.time.DataTime; import com.raytheon.uf.common.time.DataTime;
@ -73,6 +75,7 @@ import com.raytheon.uf.viz.monitor.ffmp.xml.FFMPConfigBasinXML;
* ------------ ---------- ----------- -------------------------- * ------------ ---------- ----------- --------------------------
* 29 June, 2009 2521 dhladky Initial creation * 29 June, 2009 2521 dhladky Initial creation
* 02/01/13 1569 D. Hladky Added constants * 02/01/13 1569 D. Hladky Added constants
* Feb 10, 2013 1584 mpduff Add performance logging.
* *
* </pre> * </pre>
* *
@ -85,6 +88,13 @@ public class FFMPResourceData extends AbstractRequestableResourceData {
private static final transient IUFStatusHandler statusHandler = UFStatus private static final transient IUFStatusHandler statusHandler = UFStatus
.getHandler(FFMPResourceData.class); .getHandler(FFMPResourceData.class);
/** Performance log entry prefix */
private final String prefix = "FFMP ResourceData:";
/** Performance logger */
private final IPerformanceStatusHandler perfLog = PerformanceStatus
.getHandler(prefix);
public boolean tableLoad = false; public boolean tableLoad = false;
@XmlAttribute @XmlAttribute
@ -158,11 +168,13 @@ public class FFMPResourceData extends AbstractRequestableResourceData {
} }
/**
* {@inheritDoc}
*/
@Override @Override
protected AbstractVizResource<?, ?> constructResource( protected AbstractVizResource<?, ?> constructResource(
LoadProperties loadProperties, PluginDataObject[] objects) LoadProperties loadProperties, PluginDataObject[] objects)
throws VizException { throws VizException {
IPathManager pm = PathManagerFactory.getPathManager(); IPathManager pm = PathManagerFactory.getPathManager();
LocalizationContext context = pm.getContext( LocalizationContext context = pm.getContext(
LocalizationType.COMMON_STATIC, LocalizationLevel.SITE); LocalizationType.COMMON_STATIC, LocalizationLevel.SITE);
@ -171,8 +183,8 @@ public class FFMPResourceData extends AbstractRequestableResourceData {
monitor.setWfo(wfo); monitor.setWfo(wfo);
this.field = monitor.getField(sourceName); this.field = monitor.getField(sourceName);
System.out.println("Loading FFMP: source: " + sourceName + " site: " perfLog.log("Loading FFMP: source: " + sourceName + ", site: "
+ siteKey + " data: " + dataKey + " WFO: " + wfo + " HUC: " + siteKey + ", data: " + dataKey + ", WFO: " + wfo + ", HUC: "
+ huc); + huc);
DataTime[] availableTimes = this.getAvailableTimes(); DataTime[] availableTimes = this.getAvailableTimes();
@ -233,7 +245,8 @@ public class FFMPResourceData extends AbstractRequestableResourceData {
this.timeBack = new Date( this.timeBack = new Date(
(long) (mostRecentTime.getRefTime().getTime() - (cfgBasinXML (long) (mostRecentTime.getRefTime().getTime() - (cfgBasinXML
.getTimeFrame() * TimeUtil.MILLIS_PER_HOUR))); .getTimeFrame() * TimeUtil.MILLIS_PER_HOUR)));
ArrayList<String> hucsToLoad = monitor.getTemplates(siteKey).getTemplateMgr().getHucLevels(); ArrayList<String> hucsToLoad = monitor.getTemplates(siteKey)
.getTemplateMgr().getHucLevels();
// goes back X hours and pre populates the Data Hashes // goes back X hours and pre populates the Data Hashes
FFMPDataLoader loader = new FFMPDataLoader(this, timeBack, FFMPDataLoader loader = new FFMPDataLoader(this, timeBack,
mostRecentTime.getRefTime(), LOADER_TYPE.INITIAL, mostRecentTime.getRefTime(), LOADER_TYPE.INITIAL,
@ -277,14 +290,16 @@ public class FFMPResourceData extends AbstractRequestableResourceData {
Date standAloneTime = null; Date standAloneTime = null;
if (source != null) { if (source != null) {
// Special Loading for guidance sources, as mentioned in the comment // Special Loading for guidance sources, as mentioned in the
if (source.getDataType().equals(SOURCE_TYPE.GUIDANCE.getSourceType())) { // comment
if (source.getDataType().equals(
SOURCE_TYPE.GUIDANCE.getSourceType())) {
long oldestTime = availableTimes[0].getRefTime() long oldestTime = availableTimes[0].getRefTime()
.getTime(); .getTime();
long expirationTime = source long expirationTime = source
.getExpirationMinutes(siteKey) * TimeUtil.MILLIS_PER_MINUTE; .getExpirationMinutes(siteKey)
standAloneTime = new Date(oldestTime * TimeUtil.MILLIS_PER_MINUTE;
- expirationTime); standAloneTime = new Date(oldestTime - expirationTime);
} else { } else {
// Only load current frames time // Only load current frames time
standAloneTime = availableTimes[availableTimes.length - 1] standAloneTime = availableTimes[availableTimes.length - 1]

View file

@ -13,9 +13,12 @@ Require-Bundle: org.eclipse.ui,
com.raytheon.uf.common.time;bundle-version="1.12.1174", com.raytheon.uf.common.time;bundle-version="1.12.1174",
com.raytheon.uf.common.util;bundle-version="1.12.1174", com.raytheon.uf.common.util;bundle-version="1.12.1174",
com.google.guava;bundle-version="1.0.0", com.google.guava;bundle-version="1.0.0",
com.raytheon.uf.common.units;bundle-version="1.0.0" com.raytheon.uf.common.units;bundle-version="1.0.0",
com.raytheon.uf.common.event;bundle-version="1.0.0",
org.apache.commons.lang;bundle-version="2.3.0"
Bundle-RequiredExecutionEnvironment: JavaSE-1.6 Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Bundle-ActivationPolicy: lazy Bundle-ActivationPolicy: lazy
Export-Package: com.raytheon.uf.viz.stats, Export-Package: com.raytheon.uf.viz.stats,
com.raytheon.uf.viz.stats.collector,
com.raytheon.uf.viz.stats.ui, com.raytheon.uf.viz.stats.ui,
com.raytheon.uf.viz.stats.utils com.raytheon.uf.viz.stats.utils

View file

@ -0,0 +1,113 @@
/**
* 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.stats.collector;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;
import com.raytheon.uf.common.event.EventBus;
import com.raytheon.uf.common.stats.StatisticsEvent;
/**
* Statistics Collector used to collect stats from different locations.
*
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Feb 8, 2013 mpduff Initial creation
*
* </pre>
*
* @author mpduff
* @version 1.0
*/
public class StatsCollector {
private static final StatsCollector instance = new StatsCollector();
/**
* Concurrent map of events -> start time in ms.
*/
private final ConcurrentMap<String, StatisticsEvent> statsDataMap = new ConcurrentHashMap<String, StatisticsEvent>();
private StatsCollector() {
}
/**
* Get the instance.
*
* @return The instance
*/
public static final StatsCollector getInstance() {
return instance;
}
/**
* Mark a start point for this event.
*
* @param key
* The Statistics key
*
* @param event
* The event to track
*/
public static void start(String key, StatisticsEvent event) {
getInstance().setStart(key, event);
}
/**
* Mark a stop point for this event.
*
* @param key
* StatisticsEvent
*/
public static void stop(String key) {
getInstance().setStop(key);
}
/**
* Mark a start point for this event.
*
* @param key
* The Statistics key
* @param event
* The event to track
*/
public void setStart(String key, StatisticsEvent event) {
statsDataMap.put(key, event);
}
/**
* Mark a stop point for this id.
*
* @param key
* The Statistics key
*/
public void setStop(String key) {
StatisticsEvent event = statsDataMap.remove(key);
event.finalizeEvent();
EventBus.publish(event);
}
}

View file

@ -26,7 +26,7 @@ import java.net.InetAddress;
import java.net.UnknownHostException; import java.net.UnknownHostException;
/** /**
* TODO Add Description * Constants for CAVE statistics.
* *
* <pre> * <pre>
* *
@ -54,12 +54,10 @@ public class StatsConstants {
private static final String release = defineRelease(); private static final String release = defineRelease();
/** /**
* @return Hostname of the workstation running CAVE * Return the host name.
*
* @return the host name
*/ */
public static String getHostname() {
return hostname;
}
private static String defineHostName() { private static String defineHostName() {
String hn = null; String hn = null;
InetAddress addr; InetAddress addr;
@ -73,6 +71,11 @@ public class StatsConstants {
return hn; return hn;
} }
/**
* Define the release that is currently running.
*
* @return The release
*/
private static String defineRelease() { private static String defineRelease() {
String release = null; String release = null;
BufferedReader in = null; BufferedReader in = null;
@ -107,4 +110,11 @@ public class StatsConstants {
public static String getRelease() { public static String getRelease() {
return release; return release;
} }
/**
* @return Hostname of the workstation running CAVE
*/
public static String getHostname() {
return hostname;
}
} }

View file

@ -41,21 +41,20 @@ import org.apache.commons.logging.LogFactory;
import com.raytheon.uf.common.dataplugin.PluginDataObject; import com.raytheon.uf.common.dataplugin.PluginDataObject;
import com.raytheon.uf.common.localization.IPathManager; import com.raytheon.uf.common.localization.IPathManager;
import com.raytheon.uf.common.localization.LocalizationContext; import com.raytheon.uf.common.localization.LocalizationContext;
import com.raytheon.uf.common.localization.PathManagerFactory;
import com.raytheon.uf.common.localization.LocalizationContext.LocalizationLevel; import com.raytheon.uf.common.localization.LocalizationContext.LocalizationLevel;
import com.raytheon.uf.common.localization.PathManagerFactory;
import com.raytheon.uf.common.ohd.AppsDefaults;
import com.raytheon.uf.common.serialization.SerializationUtil; import com.raytheon.uf.common.serialization.SerializationUtil;
import com.raytheon.uf.common.serialization.annotations.DynamicSerialize; import com.raytheon.uf.common.serialization.annotations.DynamicSerialize;
import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement;
import com.raytheon.uf.common.ohd.AppsDefaults;
//import com.raytheon.edex.transform.shef.MetarToShefTransformer;
import com.raytheon.uf.edex.decodertools.core.filterimpl.AbstractFilterElement; import com.raytheon.uf.edex.decodertools.core.filterimpl.AbstractFilterElement;
import com.raytheon.uf.edex.decodertools.core.filterimpl.AbstractObsFilter; import com.raytheon.uf.edex.decodertools.core.filterimpl.AbstractObsFilter;
import com.raytheon.uf.edex.decodertools.core.filterimpl.PluginDataObjectFilter; import com.raytheon.uf.edex.decodertools.core.filterimpl.PluginDataObjectFilter;
/** /**
* Use information in metarToShefFilter.xml, MetarToShefFilter filters out * Use information in metarToShefFilter.xml, MetarToShefFilter filters out the
* the metar messages before send the message to MetarToShefTransformer to * metar messages before send the message to MetarToShefTransformer to encode to
* encode to a SHEF message. * a SHEF message.
* *
* <pre> * <pre>
* *
@ -63,6 +62,7 @@ import com.raytheon.uf.edex.decodertools.core.filterimpl.PluginDataObjectFilter;
* Date Ticket# Engineer Description * Date Ticket# Engineer Description
* ---------- ------- -------- -------------------------- * ---------- ------- -------- --------------------------
* 1/10/2013 15497 wkwock Initial creation * 1/10/2013 15497 wkwock Initial creation
* 2/13/2013 1584 mpduff Fix creation of "dummy" config.
* *
* </pre> * </pre>
* *
@ -85,9 +85,10 @@ public class MetarToShefFilter {
public static final String FILTERS_DIR = "plugin-filters"; public static final String FILTERS_DIR = "plugin-filters";
private String metarToShefOptions = AppsDefaults.getInstance().getToken("metar2shef_options"); private final String metarToShefOptions = AppsDefaults.getInstance()
.getToken("metar2shef_options");
private Log logger = LogFactory.getLog(getClass()); private final Log logger = LogFactory.getLog(getClass());
private String filterConfigFile = null; private String filterConfigFile = null;
@ -100,7 +101,8 @@ public class MetarToShefFilter {
File filterDir = null; File filterDir = null;
IPathManager manager = PathManagerFactory.getPathManager(); IPathManager manager = PathManagerFactory.getPathManager();
if (manager != null) { if (manager != null) {
LocalizationContext context = manager.getContext(EDEX_STATIC, LocalizationLevel.valueOf(localContext)); LocalizationContext context = manager.getContext(EDEX_STATIC,
LocalizationLevel.valueOf(localContext));
if (context != null) { if (context != null) {
filterDir = manager.getFile(context, FILTERS_DIR); filterDir = manager.getFile(context, FILTERS_DIR);
if (filterDir.exists()) { if (filterDir.exists()) {
@ -115,7 +117,8 @@ public class MetarToShefFilter {
Object obj = SerializationUtil Object obj = SerializationUtil
.unmarshalFromXml(new String(data)); .unmarshalFromXml(new String(data));
if (obj instanceof PluginDataObjectFilter) { if (obj instanceof PluginDataObjectFilter) {
logger.info("Found "+filterConfigFile+" is PluginDataObjectFilter"); logger.info("Found " + filterConfigFile
+ " is PluginDataObjectFilter");
PluginDataObjectFilter pdof = (PluginDataObjectFilter) obj; PluginDataObjectFilter pdof = (PluginDataObjectFilter) obj;
MetarToShefRun mtsr = new MetarToShefRun(); MetarToShefRun mtsr = new MetarToShefRun();
mtsr.setConfigFileName(METAR_CFG); mtsr.setConfigFileName(METAR_CFG);
@ -126,60 +129,70 @@ public class MetarToShefFilter {
} else if (obj instanceof MetarToShefFilter) { } else if (obj instanceof MetarToShefFilter) {
MetarToShefFilter filter = (MetarToShefFilter) obj; MetarToShefFilter filter = (MetarToShefFilter) obj;
this.metarToShefRun = filter.metarToShefRun; this.metarToShefRun = filter.metarToShefRun;
logger.info("Found "+filterConfigFile+" is MetarToShefFilter"); logger.info("Found " + filterConfigFile
+ " is MetarToShefFilter");
} else { } else {
logger.error("Found "+filterConfigFile+" is "+obj.getClass().getCanonicalName()); logger.error("Found " + filterConfigFile
+ " is "
+ obj.getClass().getCanonicalName());
createDummyFilter(); createDummyFilter();
} }
} catch (IOException e) { } catch (IOException e) {
logger.error("Unable to read filter config", e); logger.error("Unable to read filter config", e);
} catch (JAXBException e) { } catch (JAXBException e) {
logger.error("Unable to unmarshall filter config", e); logger.error("Unable to unmarshall filter config",
e);
} }
} else { } else {
logger.error(String.format(ERROR_2_FMT,filterDir.getPath())); logger.error(String.format(ERROR_2_FMT,
filterDir.getPath()));
createDummyFilter(); createDummyFilter();
} }
} else { } else {
logger.error(String.format(ERROR_1_FMT, localContext,configFile)); logger.error(String.format(ERROR_1_FMT, localContext,
configFile));
createDummyFilter(); createDummyFilter();
} }
} else { } else {
// Could not create PathManager // Could not create PathManager
} }
} catch (Exception e) { } catch (Exception e) {
logger.error( logger.error("Error creating filter.", e);
"Error creating filter.", e);
createDummyFilter(); createDummyFilter();
} }
for (MetarToShefRun mtsr : metarToShefRun) { for (MetarToShefRun mtsr : metarToShefRun) {
logger.info("Filter name = " + mtsr.getFilterName()+" with config file: "+mtsr.getConfigFileName()); logger.info("Filter name = " + mtsr.getFilterName()
+ " with config file: " + mtsr.getConfigFileName());
} }
} }
private PluginDataObject[] filterARun(PluginDataObject[] reports, List<AbstractFilterElement> filterElements) { private PluginDataObject[] filterARun(PluginDataObject[] reports,
List<AbstractFilterElement> filterElements) {
int reportCount = 0; int reportCount = 0;
if (reports != null) { if (reports != null) {
for (int i = 0; i < reports.length; i++) { for (int i = 0; i < reports.length; i++) {
PluginDataObject r = null; PluginDataObject r = null;
boolean keep = true; boolean keep = true;
for (AbstractFilterElement element : filterElements) { for (AbstractFilterElement element : filterElements) {
r = element.filter(reports[i]); r = element.filter(reports[i]);
// Only allow keep to be set to true. Once true it stays that way. // Only allow keep to be set to true. Once true it stays
if(AbstractObsFilter.INCLUDE_TYPE.equals(element.getFilterType())) { // that way.
if (AbstractObsFilter.INCLUDE_TYPE.equals(element
.getFilterType())) {
// Did the filter pass? // Did the filter pass?
if (r == null) { if (r == null) {
// If we fail an element, exit now. // If we fail an element, exit now.
keep = false; keep = false;
break; break;
} }
} else if(AbstractObsFilter.EXCLUDE_TYPE.equals(element.getFilterType())) { } else if (AbstractObsFilter.EXCLUDE_TYPE.equals(element
.getFilterType())) {
if (r != null) { if (r != null) {
// There was a match, so we want to remove this item. // There was a match, so we want to remove this
// item.
keep = false; keep = false;
// And there's no reason for further checks. // And there's no reason for further checks.
break; break;
@ -221,7 +234,8 @@ public class MetarToShefFilter {
resultRpt = filterARun(tmpRprts, mtsr.getFilterElements()); resultRpt = filterARun(tmpRprts, mtsr.getFilterElements());
if (resultRpt != null && resultRpt.length >= 1) { if (resultRpt != null && resultRpt.length >= 1) {
logger.info("Report matchs in filter " + mtsr.getFilterName()); logger.info("Report matchs in filter " + mtsr.getFilterName());
MetarToShefTransformer.setCfgNOption(mtsr.getConfigFileName(),mtsr.getMetarToShefOptions()); MetarToShefTransformer.setCfgNOption(mtsr.getConfigFileName(),
mtsr.getMetarToShefOptions());
break; break;
} }
} }
@ -242,7 +256,7 @@ public class MetarToShefFilter {
} }
}; };
dummy.setFilterType(AbstractObsFilter.INCLUDE_TYPE); dummy.setFilterType(AbstractObsFilter.INCLUDE_TYPE);
mtsr.getFilterElements().set(0, dummy); mtsr.getFilterElements().add(dummy);
mtsr.setFilterName("Created Pass-All filter"); mtsr.setFilterName("Created Pass-All filter");
this.metarToShefRun.add(mtsr); this.metarToShefRun.add(mtsr);
} }

View file

@ -142,4 +142,10 @@ public class DataRetrievalEvent extends RetrievalEvent {
return "DataRetrievalEvent " + super.toString() + " provider: " return "DataRetrievalEvent " + super.toString() + " provider: "
+ provider + " numRecord: " + numRecords + " bytes: " + bytes; + provider + " numRecord: " + numRecords + " bytes: " + bytes;
} }
@Override
public void finalizeEvent() {
// Not implemented
}
} }

View file

@ -177,4 +177,9 @@ public class SubscriptionRetrievalEvent extends RetrievalEvent implements
} }
return rval.toString(); return rval.toString();
} }
@Override
public void finalizeEvent() {
// Not implemented
}
} }

View file

@ -0,0 +1,11 @@
<statisticsConfig>
<!-- Event Type should be fully qualified name of stat event -->
<statisticsEvent type="com.raytheon.uf.common.stats.LoadEvent"
displayName="Load Time" category="FFMP Load Times">
<statisticsGroup name="type" displayName="Type" />
<!-- Processing time available display units:
ms, Seconds, Minutes, Hours -->
<statisticsAggregate field="loadTime"
displayName="Loading Time" displayUnit="ms" />
</statisticsEvent>
</statisticsConfig>

View file

@ -136,4 +136,8 @@ public class RegistryStatisticsEvent extends StatisticsEvent {
return registryObject; return registryObject;
} }
@Override
public void finalizeEvent() {
// not implemented
}
} }

View file

@ -19,4 +19,5 @@ Require-Bundle: com.raytheon.uf.common.time;bundle-version="1.12.1174",
com.raytheon.uf.common.util;bundle-version="1.12.1174", com.raytheon.uf.common.util;bundle-version="1.12.1174",
com.raytheon.uf.common.status;bundle-version="1.12.1174", com.raytheon.uf.common.status;bundle-version="1.12.1174",
javax.measure;bundle-version="1.0.0", javax.measure;bundle-version="1.0.0",
com.raytheon.uf.common.units;bundle-version="1.0.0" com.raytheon.uf.common.units;bundle-version="1.0.0",
org.apache.commons.lang;bundle-version="2.3.0"

View file

@ -23,8 +23,12 @@ import java.util.Collections;
import java.util.HashMap; import java.util.HashMap;
import java.util.Map; import java.util.Map;
import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;
import com.raytheon.uf.common.serialization.annotations.DynamicSerialize; import com.raytheon.uf.common.serialization.annotations.DynamicSerialize;
import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement;
import com.raytheon.uf.common.time.util.TimeUtil;
/** /**
* Load event to track dialog/table/data load times. * Load event to track dialog/table/data load times.
@ -53,30 +57,12 @@ public class LoadEvent extends StatisticsEvent {
FIELD_UNIT_MAP = Collections.unmodifiableMap(m); FIELD_UNIT_MAP = Collections.unmodifiableMap(m);
} }
/**
* The plugin name
*/
@DynamicSerializeElement
private String pluginName;
/**
* The workstation id
*/
@DynamicSerializeElement
private String workstation;
/** /**
* The type of object that is having its load time tracked * The type of object that is having its load time tracked
*/ */
@DynamicSerializeElement @DynamicSerializeElement
private String type; private String type;
/**
* The version of CAVE
*/
@DynamicSerializeElement
private String caveVersion;
/** /**
* The load time in ms * The load time in ms
*/ */
@ -89,41 +75,23 @@ public class LoadEvent extends StatisticsEvent {
@DynamicSerializeElement @DynamicSerializeElement
private String message; private String message;
/**
* Start time in ms.
*/
private long start;
/**
* Constructor. Sets the start time to current time.
*/
public LoadEvent() {
start = TimeUtil.currentTimeMillis();
}
@Override @Override
protected Map<String, String> getFieldUnitMap() { protected Map<String, String> getFieldUnitMap() {
return FIELD_UNIT_MAP; return FIELD_UNIT_MAP;
} }
/**
* @return the pluginName
*/
public String getPluginName() {
return pluginName;
}
/**
* @param pluginName
* the pluginName to set
*/
public void setPluginName(String pluginName) {
this.pluginName = pluginName;
}
/**
* @return the workstation
*/
public String getWorkstation() {
return workstation;
}
/**
* @param workstation
* the workstation to set
*/
public void setWorkstation(String workstation) {
this.workstation = workstation;
}
/** /**
* @return the type * @return the type
*/ */
@ -170,18 +138,18 @@ public class LoadEvent extends StatisticsEvent {
} }
/** /**
* @return the caveVersion * @return the start
*/ */
public String getCaveVersion() { public long getStart() {
return caveVersion; return start;
} }
/** /**
* @param caveVersion * @param start
* the caveVersion to set * the start to set
*/ */
public void setCaveVersion(String caveVersion) { public void setStart(long start) {
this.caveVersion = caveVersion; this.start = start;
} }
/** /**
@ -191,4 +159,45 @@ public class LoadEvent extends StatisticsEvent {
public String toString() { public String toString() {
return super.toString() + " : " + getMessage(); return super.toString() + " : " + getMessage();
} }
/*
* (non-Javadoc)
*
* @see java.lang.Object#hashCode()
*/
@Override
public int hashCode() {
return new HashCodeBuilder(17, 37).appendSuper(super.hashCode())
.append(date).append(message).append(type).toHashCode();
}
/*
* (non-Javadoc)
*
* @see java.lang.Object#equals(java.lang.Object)
*/
@Override
public boolean equals(Object obj) {
if (obj == null) {
return false;
}
if (obj == this) {
return true;
}
if (obj.getClass() != getClass()) {
return false;
}
LoadEvent other = (LoadEvent) obj;
return new EqualsBuilder().appendSuper(super.equals(obj))
.append(this.date, other.date).append(this.id, other.id)
.append(this.message, other.message)
.append(this.type, other.type).isEquals();
}
@Override
public void finalizeEvent() {
long now = TimeUtil.currentTimeMillis();
this.loadTime = now - start;
}
} }

View file

@ -165,4 +165,9 @@ public class ProcessEvent extends StatisticsEvent {
return super.toString() + " : " + getMessage(); return super.toString() + " : " + getMessage();
} }
@Override
public void finalizeEvent() {
// not implemented
}
} }

View file

@ -23,6 +23,9 @@ package com.raytheon.uf.common.stats;
import java.util.Map; import java.util.Map;
import java.util.Set; import java.util.Set;
import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;
import com.raytheon.uf.common.event.Event; import com.raytheon.uf.common.event.Event;
/** /**
@ -35,6 +38,7 @@ import com.raytheon.uf.common.event.Event;
* Date Ticket# Engineer Description * Date Ticket# Engineer Description
* ------------ ---------- ----------- -------------------------- * ------------ ---------- ----------- --------------------------
* Oct 25, 2012 #1340 dhladky Initial creation * Oct 25, 2012 #1340 dhladky Initial creation
* Feb 10, 2013 #1584 mpduff Add equals and hashCode.
* *
* </pre> * </pre>
* *
@ -52,7 +56,43 @@ public abstract class StatisticsEvent extends Event {
protected abstract Map<String, String> getFieldUnitMap(); protected abstract Map<String, String> getFieldUnitMap();
public abstract void finalizeEvent();
public String getStorageUnit(String field) { public String getStorageUnit(String field) {
return getFieldUnitMap().get(field); return getFieldUnitMap().get(field);
} }
/*
* (non-Javadoc)
*
* @see java.lang.Object#hashCode()
*/
@Override
public int hashCode() {
HashCodeBuilder hcBuilder = new HashCodeBuilder();
hcBuilder.append(this.date);
hcBuilder.append(this.id);
return hcBuilder.toHashCode();
}
/*
* (non-Javadoc)
*
* @see java.lang.Object#equals(java.lang.Object)
*/
@Override
public boolean equals(Object obj) {
if (obj instanceof StatisticsEvent) {
StatisticsEvent other = (StatisticsEvent) obj;
EqualsBuilder builder = new EqualsBuilder();
builder.append(this.date, other.date);
builder.append(this.id, this.id);
return builder.isEquals();
}
return super.equals(obj);
}
} }

View file

@ -7,3 +7,4 @@ Bundle-Vendor: RAYTHEON
Eclipse-BuddyPolicy: ext, registered, global Eclipse-BuddyPolicy: ext, registered, global
Export-Package: com.raytheon.uf.common.status Export-Package: com.raytheon.uf.common.status
Bundle-RequiredExecutionEnvironment: JavaSE-1.6 Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Require-Bundle: org.apache.log4j;bundle-version="1.0.0"

View file

@ -0,0 +1,56 @@
/**
* 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.common.status;
/**
* Performance status handler interface.
*
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Feb 14, 2013 1584 mpduff Initial creation
*
* </pre>
*
* @author mpduff
* @version 1.0
*/
public interface IPerformanceStatusHandler {
/**
* Performance message. Use {@link #logDuration(String, long)} if the
* duration is known.
*
* @param message
*/
void log(String message);
/**
* Performance message with time duration.
*
* @param message
* @param timeMs
*/
void logDuration(String message, long timeMs);
}

View file

@ -0,0 +1,54 @@
package com.raytheon.uf.common.status;
import org.apache.log4j.Logger;
/**
* Log4j Performance status handler.
*
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Feb 14, 2013 1584 mpduff Initial creation
*
* </pre>
*
* @author mpduff
* @version 1.0
*/
public class Log4JPerformanceStatusHandler implements IPerformanceStatusHandler {
/** Logger */
private final Logger perfLog = Logger.getLogger("PerformanceLogger");
/** Prefix to append to all log messages */
private final String prefix;
/**
* Constructor.
*
* @param prefix
* Message prefix
*/
public Log4JPerformanceStatusHandler(String prefix) {
this.prefix = prefix;
}
/**
* {@inheritDoc}
*/
@Override
public void log(String message) {
perfLog.info(prefix + " " + message);
}
/**
* {@inheritDoc}
*/
@Override
public void logDuration(String message, long timeMs) {
perfLog.info(prefix + " " + message + " took " + timeMs + " ms");
}
}

View file

@ -0,0 +1,51 @@
/**
* 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.common.status;
/**
* Performance Status class to handle logging of performance stats.
*
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Feb 13, 2013 1584 mpduff Initial creation
*
* </pre>
*
* @author mpduff
* @version 1.0
*/
public class PerformanceStatus {
/**
* Get a handler for performance logging.
*
* @param prefix
* A prefix to each log statement
* @return The handler
*/
public static IPerformanceStatusHandler getHandler(String prefix) {
return new Log4JPerformanceStatusHandler(prefix);
}
}

View file

@ -1,29 +0,0 @@
<statisticsConfig>
<!-- Event Type should be fully qualified name of stat event -->
<statisticsEvent type="com.raytheon.uf.common.datadelivery.event.retrieval.SubscriptionRetrievalEvent"
displayName="Subscription Retrieval" category="Data Delivery">
<statisticsGroup name="plugin" displayName="Data Type" />
<statisticsGroup name="provider" displayName="Data Provider" />
<statisticsGroup name="owner" displayName="Owner" />
<statisticsGroup name="network" displayName="Network Route" />
<statisticsGroup name="subscriptionType" displayName="Subscription Type" />
<statisticsAggregate field="numFailed"
displayName="Number of Failed Subscriptions" displayUnit="Count" />
<statisticsAggregate field="numComplete"
displayName="Number of Completed Subscriptions" displayUnit="Count" />
</statisticsEvent>
<statisticsEvent type="com.raytheon.uf.common.datadelivery.event.retrieval.DataRetrievalEvent"
displayName="Data Retrieval" category="Data Delivery">
<statisticsGroup name="plugin" displayName="Data Type" />
<statisticsGroup name="provider" displayName="Data Provider" />
<statisticsGroup name="owner" displayName="Owner" />
<statisticsGroup name="network" displayName="Network Route" />
<!--
Display unit options are bytes, KB, MB, GB
-->
<statisticsAggregate field="bytes"
displayName="Amount of Data Downloaded" displayUnit="MB" />
<statisticsAggregate field="numRecords"
displayName="Number of Records Downloaded" displayUnit="Count" />
</statisticsEvent>
</statisticsConfig>

View file

@ -1,14 +0,0 @@
<statisticsConfig>
<!-- Event Type should be fully qualified name of stat event -->
<statisticsEvent type="com.raytheon.uf.common.registry.event.RegistryStatisticsEvent"
displayName="Registry Statistics" category="Registry">
<statisticsGroup name="owner" displayName="Transaction Owner" />
<statisticsGroup name="status" displayName="Transaction Status" />
<statisticsGroup name="type" displayName="Transaction Type" />
<!--
Display unit options are ms, Seconds, Minutes, Hours
-->
<statisticsAggregate field="duration"
displayName="Total Registry Duration" displayUnit="Minutes" />
</statisticsEvent>
</statisticsConfig>

View file

@ -1,13 +0,0 @@
<statisticsConfig>
<!-- Event Type should be fully qualified name of stat event -->
<statisticsEvent type="com.raytheon.uf.common.stats.ProcessEvent"
displayName="Processing Events" category="Data Ingest Events">
<statisticsGroup name="dataType" displayName="Data Type" />
<!-- Processing time available display units:
ms, Seconds, Minutes, Hours -->
<statisticsAggregate field="processingTime"
displayName="Processing Time" displayUnit="ms" />
<statisticsAggregate field="processingLatency"
displayName="Processing Latency" displayUnit="ms" />
</statisticsEvent>
</statisticsConfig>

View file

@ -166,4 +166,9 @@ public class MockEvent extends StatisticsEvent {
return super.toString() + " : " + getMessage(); return super.toString() + " : " + getMessage();
} }
@Override
public void finalizeEvent() {
// not implemented
}
} }