diff --git a/edexOsgi/com.raytheon.uf.common.event/src/com/raytheon/uf/common/event/ProcessEvent.java b/edexOsgi/com.raytheon.uf.common.event/src/com/raytheon/uf/common/event/ProcessEvent.java index c31457c044..924d4fe31d 100644 --- a/edexOsgi/com.raytheon.uf.common.event/src/com/raytheon/uf/common/event/ProcessEvent.java +++ b/edexOsgi/com.raytheon.uf.common.event/src/com/raytheon/uf/common/event/ProcessEvent.java @@ -54,11 +54,17 @@ public class ProcessEvent extends Event { @DynamicSerializeElement private String fileName; + /* + * Processing time in milliseconds + */ @DynamicSerializeElement - private double processingTimeMilliseconds; + private long processingTime; + /* + * Processing latency in milliseconds + */ @DynamicSerializeElement - private double processingLatencyMilliseconds; + private long processingLatency; public ProcessEvent() { } @@ -114,34 +120,33 @@ public class ProcessEvent extends Event { } /** - * @return the processingTimeMilliseconds + * @return the processingTime in milliseconds */ - public double getProcessingTimeMilliseconds() { - return processingTimeMilliseconds; + public long getProcessingTime() { + return processingTime; } /** - * @param processingTimeMilliseconds - * the processingTimeMilliseconds to set + * @param processingTime + * the processingTime in milliseconds to set */ - public void setProcessingTimeMilliseconds(double processingTimeMilliseconds) { - this.processingTimeMilliseconds = processingTimeMilliseconds; + public void setProcessingTime(long processingTime) { + this.processingTime = processingTime; } /** - * @return the processingLatencyMilliseconds + * @return the processingLatency in milliseconds */ - public double getProcessingLatencyMilliseconds() { - return processingLatencyMilliseconds; + public long getProcessingLatency() { + return processingLatency; } /** - * @param processingLatencyMilliseconds - * the processingLatencyMilliseconds to set + * @param processingLatency + * the processingLatency in milliseconds to set */ - public void setProcessingLatencyMilliseconds( - double processingLatencyMilliseconds) { - this.processingLatencyMilliseconds = processingLatencyMilliseconds; + public void setProcessingLatency(long processingLatency) { + this.processingLatency = processingLatency; } } diff --git a/edexOsgi/com.raytheon.uf.edex.esb.camel/src/com/raytheon/uf/edex/esb/camel/ProcessUtil.java b/edexOsgi/com.raytheon.uf.edex.esb.camel/src/com/raytheon/uf/edex/esb/camel/ProcessUtil.java index 99cf8763f7..b3bc72f09c 100644 --- a/edexOsgi/com.raytheon.uf.edex.esb.camel/src/com/raytheon/uf/edex/esb/camel/ProcessUtil.java +++ b/edexOsgi/com.raytheon.uf.edex.esb.camel/src/com/raytheon/uf/edex/esb/camel/ProcessUtil.java @@ -107,22 +107,22 @@ public class ProcessUtil { Long dequeueTime = getHeaderProperty(headers, "dequeueTime"); DecimalFormat df = FORMAT.get(); if (dequeueTime != null) { - double elapsedMilliseconds = curTime - dequeueTime; + long elapsedMilliseconds = curTime - dequeueTime; double elapsed = (elapsedMilliseconds) / 1000.0; sb.append(" processed in: "); sb.append(df.format(elapsed)); sb.append(" (sec)"); - processEvent.setProcessingTimeMilliseconds(elapsedMilliseconds); + processEvent.setProcessingTime(elapsedMilliseconds); } Long enqueueTime = getHeaderProperty(headers, "enqueueTime"); if (enqueueTime != null) { - double latencyMilliseconds = curTime - enqueueTime; + long latencyMilliseconds = curTime - enqueueTime; double latency = (latencyMilliseconds) / 1000.0; sb.append(" Latency: "); sb.append(df.format(latency)); sb.append(" (sec)"); - processEvent.setProcessingLatencyMilliseconds(latencyMilliseconds); + processEvent.setProcessingLatency(latencyMilliseconds); } EventBus.getInstance().publish(processEvent); diff --git a/edexOsgi/com.raytheon.uf.edex.stats/META-INF/MANIFEST.MF b/edexOsgi/com.raytheon.uf.edex.stats/META-INF/MANIFEST.MF index 6c7aa8ff35..772983c168 100644 --- a/edexOsgi/com.raytheon.uf.edex.stats/META-INF/MANIFEST.MF +++ b/edexOsgi/com.raytheon.uf.edex.stats/META-INF/MANIFEST.MF @@ -19,4 +19,7 @@ Require-Bundle: com.raytheon.uf.common.serialization;bundle-version="1.12.1174", org.springframework;bundle-version="2.5.6", com.raytheon.uf.edex.core;bundle-version="1.12.1174", com.raytheon.uf.common.status;bundle-version="1.12.1174", - org.apache.commons.collections;bundle-version="3.2.0" + org.apache.commons.collections;bundle-version="3.2.0", + org.junit, + javax.measure +Import-Package: javax.measure.unit diff --git a/edexOsgi/com.raytheon.uf.edex.stats/src/com/raytheon/uf/edex/stats/xml/Aggregate.java b/edexOsgi/com.raytheon.uf.edex.stats/src/com/raytheon/uf/edex/stats/xml/Aggregate.java index af944d90cc..85b39e9712 100644 --- a/edexOsgi/com.raytheon.uf.edex.stats/src/com/raytheon/uf/edex/stats/xml/Aggregate.java +++ b/edexOsgi/com.raytheon.uf.edex.stats/src/com/raytheon/uf/edex/stats/xml/Aggregate.java @@ -19,11 +19,14 @@ **/ package com.raytheon.uf.edex.stats.xml; +import javax.measure.unit.Unit; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlAttribute; import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; +import com.raytheon.uf.common.serialization.adapters.UnitAdapter; import com.raytheon.uf.common.serialization.annotations.DynamicSerialize; import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; @@ -50,6 +53,11 @@ public class Aggregate { @DynamicSerializeElement private String field; + @XmlAttribute + @XmlJavaTypeAdapter(value = UnitAdapter.class) + @DynamicSerializeElement + private Unit unit = Unit.ONE; + /** the name of the statistic function */ @XmlElement(name = "function") @DynamicSerializeElement @@ -63,6 +71,21 @@ public class Aggregate { this.field = field; } + /** + * @return the unit + */ + public Unit getUnit() { + return unit; + } + + /** + * @param unit + * the unit to set + */ + public void setUnit(Unit unit) { + this.unit = unit; + } + public Item[] getFunctions() { return functions; } diff --git a/edexOsgi/com.raytheon.uf.edex.stats/utility/edex_static/base/stats/edexProcessStats.xml b/edexOsgi/com.raytheon.uf.edex.stats/utility/edex_static/base/stats/edexProcessStats.xml index ee9786cd3b..f3c3c41db7 100644 --- a/edexOsgi/com.raytheon.uf.edex.stats/utility/edex_static/base/stats/edexProcessStats.xml +++ b/edexOsgi/com.raytheon.uf.edex.stats/utility/edex_static/base/stats/edexProcessStats.xml @@ -4,6 +4,6 @@ - - + +