Issue #1372 Make Ingest DAT log stats.
Change-Id: Icf9914a53ea384fe51c28c995b8834dfa9071612 Former-commit-id:8e0a264ba6
[formerlyb24402b21d
] [formerly0b250b2483
] [formerly8e0a264ba6
[formerlyb24402b21d
] [formerly0b250b2483
] [formerly502d3d7b47
[formerly0b250b2483
[formerly 38cd4be2fa86df03580dc87824e7270066de298a]]]] Former-commit-id:502d3d7b47
Former-commit-id:2ebba1150a
[formerlyd7c963dd60
] [formerly 01abd26b542359d825affc4e92d00e0640115acd [formerly1658a589e9
]] Former-commit-id: 4a56a969ee50e0bafdc02adbb3cf6c2b254aace1 [formerlydf88de9f75
] Former-commit-id:9a6d4d4f01
This commit is contained in:
parent
36b53c1a37
commit
5c3d5fd743
4 changed files with 86 additions and 5 deletions
|
@ -35,6 +35,7 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement;
|
|||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Nov 11, 2010 rjpeter Initial creation
|
||||
* Nov 30, 2012 dhladky Added queue and dequeue times for stats
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -58,6 +59,30 @@ public class URIGenerateMessage implements ISerializableObject {
|
|||
@DynamicSerializeElement
|
||||
protected Date currentTime = null;
|
||||
|
||||
/** logged time */
|
||||
@DynamicSerializeElement
|
||||
protected Long enQueuedTime = null;
|
||||
|
||||
/** time used for matching comparisons */
|
||||
@DynamicSerializeElement
|
||||
protected Long deQueuedTime = null;
|
||||
|
||||
public Long getEnQueuedTime() {
|
||||
return enQueuedTime;
|
||||
}
|
||||
|
||||
public void setEnQueuedTime(Long enQueuedTime) {
|
||||
this.enQueuedTime = enQueuedTime;
|
||||
}
|
||||
|
||||
public Long getDeQueuedTime() {
|
||||
return deQueuedTime;
|
||||
}
|
||||
|
||||
public void setDeQueuedTime(Long deQueuedTime) {
|
||||
this.deQueuedTime = deQueuedTime;
|
||||
}
|
||||
|
||||
public URIGenerateMessage() {
|
||||
}
|
||||
|
||||
|
@ -66,6 +91,7 @@ public class URIGenerateMessage implements ISerializableObject {
|
|||
setCurrentTime(filter.getCurrentTime());
|
||||
setUris(filter.getURIs());
|
||||
setValidTime(filter.getValidTime());
|
||||
setEnQueuedTime(System.currentTimeMillis());
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -10,7 +10,10 @@ Require-Bundle: org.eclipse.ui,
|
|||
com.raytheon.edex.common,
|
||||
com.raytheon.uf.common.status;bundle-version="1.10.13",
|
||||
com.raytheon.uf.common.monitor.cpg;bundle-version="1.0.0",
|
||||
com.raytheon.edex.ingestsrv
|
||||
com.raytheon.edex.ingestsrv,
|
||||
com.raytheon.uf.common.stats;bundle-version="1.0.0",
|
||||
com.raytheon.uf.edex.event;bundle-version="1.0.0",
|
||||
com.raytheon.uf.common.event;bundle-version="1.0.0"
|
||||
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
|
||||
Bundle-ActivationPolicy: lazy
|
||||
Export-Package: com.raytheon.uf.edex.cpgsrv
|
||||
|
|
|
@ -32,6 +32,7 @@ import com.raytheon.uf.common.dataplugin.PluginDataObject;
|
|||
import com.raytheon.uf.common.dataplugin.PluginException;
|
||||
import com.raytheon.uf.common.monitor.cpg.MonitorStateConfigurationManager;
|
||||
import com.raytheon.uf.common.serialization.SerializationUtil;
|
||||
import com.raytheon.uf.common.stats.ProcessEvent;
|
||||
import com.raytheon.uf.common.status.IUFStatusHandler;
|
||||
import com.raytheon.uf.common.status.UFStatus;
|
||||
import com.raytheon.uf.common.status.UFStatus.Priority;
|
||||
|
@ -41,6 +42,7 @@ import com.raytheon.uf.edex.core.EdexException;
|
|||
import com.raytheon.uf.edex.database.dao.CoreDao;
|
||||
import com.raytheon.uf.edex.database.dao.DaoConfig;
|
||||
import com.raytheon.uf.edex.database.plugin.PluginDao;
|
||||
import com.raytheon.uf.edex.event.EventBus;
|
||||
|
||||
/**
|
||||
* CompositeProductGenerator
|
||||
|
@ -55,6 +57,7 @@ import com.raytheon.uf.edex.database.plugin.PluginDao;
|
|||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* 02/07/2009 1981 dhladky Initial Creation.
|
||||
* 30NOV2012 1372 dhladky Added statistics
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -104,6 +107,8 @@ public abstract class CompositeProductGenerator implements
|
|||
|
||||
protected String routeId = null;
|
||||
|
||||
protected static final EventBus eventBus = EventBus.getInstance();
|
||||
|
||||
public CompositeProductGenerator(String name, String compositeProductType) {
|
||||
this(name, compositeProductType, null);
|
||||
}
|
||||
|
@ -176,23 +181,24 @@ public abstract class CompositeProductGenerator implements
|
|||
*/
|
||||
public void generate(URIGenerateMessage genMessage) {
|
||||
try {
|
||||
genMessage.setDeQueuedTime(System.currentTimeMillis());
|
||||
setProductTime(genMessage);
|
||||
generateProduct(genMessage);
|
||||
persistRecords();
|
||||
fireTopicUpdate();
|
||||
clear();
|
||||
log(genMessage);
|
||||
|
||||
} catch (Throwable t) {
|
||||
statusHandler.handle(Priority.ERROR, "CPG encountered an error", t);
|
||||
t.printStackTrace();
|
||||
|
||||
} finally {
|
||||
pdos = null;
|
||||
clear();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* plugin name for composite product
|
||||
*/
|
||||
@Override
|
||||
public String getCompositeProductType() {
|
||||
return compositeProductType;
|
||||
}
|
||||
|
@ -200,6 +206,7 @@ public abstract class CompositeProductGenerator implements
|
|||
/**
|
||||
* plugin name for composite product
|
||||
*/
|
||||
@Override
|
||||
public void setCompositeProductType(String compositeProductType) {
|
||||
this.compositeProductType = compositeProductType;
|
||||
}
|
||||
|
@ -208,6 +215,7 @@ public abstract class CompositeProductGenerator implements
|
|||
* Handled in the subclass, creates the return data object. Up to the
|
||||
* extending class what this is.
|
||||
*/
|
||||
@Override
|
||||
public abstract void generateProduct(URIGenerateMessage genMessage);
|
||||
|
||||
/**
|
||||
|
@ -236,6 +244,7 @@ public abstract class CompositeProductGenerator implements
|
|||
*
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public DataTime getProductTime() {
|
||||
return productTime;
|
||||
}
|
||||
|
@ -419,4 +428,43 @@ public abstract class CompositeProductGenerator implements
|
|||
this.executor = executor;
|
||||
}
|
||||
|
||||
/**
|
||||
* Log process statistics
|
||||
*
|
||||
* @param message
|
||||
*/
|
||||
@Override
|
||||
public void log(URIGenerateMessage message) {
|
||||
|
||||
if (getPluginDataObjects() != null && getPluginDataObjects().length > 0) {
|
||||
|
||||
long curTime = System.currentTimeMillis();
|
||||
ProcessEvent processEvent = new ProcessEvent();
|
||||
String pluginName = getPluginDataObjects()[0].getPluginName();
|
||||
|
||||
if (pluginName != null) {
|
||||
processEvent.setPluginName(pluginName);
|
||||
}
|
||||
|
||||
Long dequeueTime = message.getDeQueuedTime();
|
||||
if (dequeueTime != null) {
|
||||
long elapsedMilliseconds = curTime - dequeueTime;
|
||||
processEvent.setProcessingTime(elapsedMilliseconds);
|
||||
}
|
||||
|
||||
Long enqueueTime = message.getEnQueuedTime();
|
||||
if (enqueueTime != null) {
|
||||
long latencyMilliseconds = curTime - enqueueTime;
|
||||
processEvent.setProcessingLatency(latencyMilliseconds);
|
||||
}
|
||||
|
||||
// processing in less than 0 millis isn't trackable, usually due to
|
||||
// an
|
||||
// error occurred and statement logged incorrectly
|
||||
if ((processEvent.getProcessingLatency() > 0)
|
||||
&& (processEvent.getProcessingTime() > 0)) {
|
||||
eventBus.publish(processEvent);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -37,6 +37,7 @@ package com.raytheon.uf.edex.cpgsrv;
|
|||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* 06Feb2009 1981 dhladky Creation.
|
||||
* 30Nov2012 1372 dhladky Added latency timing stats
|
||||
*
|
||||
* @author dhladky
|
||||
* @version 1.0
|
||||
|
@ -56,4 +57,7 @@ public interface ICompositeProductGenerator {
|
|||
public void setProductTime(URIGenerateMessage genMessage);
|
||||
|
||||
public DataTime getProductTime();
|
||||
|
||||
public void log(URIGenerateMessage message);
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue