Issue #1309 added units to Aggregate.java and AggregateRecord.java
Amend: Changed ProcessEvent.processingTime and ProcessEvent.processingLatency to longs. Removed Unit from AggregateRecord.java. Change-Id: If4f6fccb65c584055d68129874a398d6391155e7 Former-commit-id:577df6943e
[formerly577df6943e
[formerly 3afbeecdaecfb9ab7cea7e59db688639dbdad972]] Former-commit-id:4c49c9116d
Former-commit-id:b17893d7e0
This commit is contained in:
parent
c6f4c2e53b
commit
c25fc27e89
5 changed files with 55 additions and 24 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -4,6 +4,6 @@
|
|||
<groupBy>
|
||||
<attribute name="pluginName"/>
|
||||
</groupBy>
|
||||
<aggregate field="processingTimeMilliseconds"/>
|
||||
<aggregate field="processingLatencyMilliseconds"/>
|
||||
<aggregate field="processingTime" unit="ms"/>
|
||||
<aggregate field="processingLatency" unit="ms"/>
|
||||
</statsConfig>
|
||||
|
|
Loading…
Add table
Reference in a new issue