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: 3afbeecdaecfb9ab7cea7e59db688639dbdad972
This commit is contained in:
parent
297d2bbc9c
commit
4c49c9116d
5 changed files with 55 additions and 24 deletions
|
@ -54,11 +54,17 @@ public class ProcessEvent extends Event {
|
||||||
@DynamicSerializeElement
|
@DynamicSerializeElement
|
||||||
private String fileName;
|
private String fileName;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Processing time in milliseconds
|
||||||
|
*/
|
||||||
@DynamicSerializeElement
|
@DynamicSerializeElement
|
||||||
private double processingTimeMilliseconds;
|
private long processingTime;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Processing latency in milliseconds
|
||||||
|
*/
|
||||||
@DynamicSerializeElement
|
@DynamicSerializeElement
|
||||||
private double processingLatencyMilliseconds;
|
private long processingLatency;
|
||||||
|
|
||||||
public ProcessEvent() {
|
public ProcessEvent() {
|
||||||
}
|
}
|
||||||
|
@ -114,34 +120,33 @@ public class ProcessEvent extends Event {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return the processingTimeMilliseconds
|
* @return the processingTime in milliseconds
|
||||||
*/
|
*/
|
||||||
public double getProcessingTimeMilliseconds() {
|
public long getProcessingTime() {
|
||||||
return processingTimeMilliseconds;
|
return processingTime;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param processingTimeMilliseconds
|
* @param processingTime
|
||||||
* the processingTimeMilliseconds to set
|
* the processingTime in milliseconds to set
|
||||||
*/
|
*/
|
||||||
public void setProcessingTimeMilliseconds(double processingTimeMilliseconds) {
|
public void setProcessingTime(long processingTime) {
|
||||||
this.processingTimeMilliseconds = processingTimeMilliseconds;
|
this.processingTime = processingTime;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return the processingLatencyMilliseconds
|
* @return the processingLatency in milliseconds
|
||||||
*/
|
*/
|
||||||
public double getProcessingLatencyMilliseconds() {
|
public long getProcessingLatency() {
|
||||||
return processingLatencyMilliseconds;
|
return processingLatency;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param processingLatencyMilliseconds
|
* @param processingLatency
|
||||||
* the processingLatencyMilliseconds to set
|
* the processingLatency in milliseconds to set
|
||||||
*/
|
*/
|
||||||
public void setProcessingLatencyMilliseconds(
|
public void setProcessingLatency(long processingLatency) {
|
||||||
double processingLatencyMilliseconds) {
|
this.processingLatency = processingLatency;
|
||||||
this.processingLatencyMilliseconds = processingLatencyMilliseconds;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -107,22 +107,22 @@ public class ProcessUtil {
|
||||||
Long dequeueTime = getHeaderProperty(headers, "dequeueTime");
|
Long dequeueTime = getHeaderProperty(headers, "dequeueTime");
|
||||||
DecimalFormat df = FORMAT.get();
|
DecimalFormat df = FORMAT.get();
|
||||||
if (dequeueTime != null) {
|
if (dequeueTime != null) {
|
||||||
double elapsedMilliseconds = curTime - dequeueTime;
|
long elapsedMilliseconds = curTime - dequeueTime;
|
||||||
double elapsed = (elapsedMilliseconds) / 1000.0;
|
double elapsed = (elapsedMilliseconds) / 1000.0;
|
||||||
sb.append(" processed in: ");
|
sb.append(" processed in: ");
|
||||||
sb.append(df.format(elapsed));
|
sb.append(df.format(elapsed));
|
||||||
sb.append(" (sec)");
|
sb.append(" (sec)");
|
||||||
processEvent.setProcessingTimeMilliseconds(elapsedMilliseconds);
|
processEvent.setProcessingTime(elapsedMilliseconds);
|
||||||
}
|
}
|
||||||
|
|
||||||
Long enqueueTime = getHeaderProperty(headers, "enqueueTime");
|
Long enqueueTime = getHeaderProperty(headers, "enqueueTime");
|
||||||
if (enqueueTime != null) {
|
if (enqueueTime != null) {
|
||||||
double latencyMilliseconds = curTime - enqueueTime;
|
long latencyMilliseconds = curTime - enqueueTime;
|
||||||
double latency = (latencyMilliseconds) / 1000.0;
|
double latency = (latencyMilliseconds) / 1000.0;
|
||||||
sb.append(" Latency: ");
|
sb.append(" Latency: ");
|
||||||
sb.append(df.format(latency));
|
sb.append(df.format(latency));
|
||||||
sb.append(" (sec)");
|
sb.append(" (sec)");
|
||||||
processEvent.setProcessingLatencyMilliseconds(latencyMilliseconds);
|
processEvent.setProcessingLatency(latencyMilliseconds);
|
||||||
}
|
}
|
||||||
|
|
||||||
EventBus.getInstance().publish(processEvent);
|
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",
|
org.springframework;bundle-version="2.5.6",
|
||||||
com.raytheon.uf.edex.core;bundle-version="1.12.1174",
|
com.raytheon.uf.edex.core;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.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;
|
package com.raytheon.uf.edex.stats.xml;
|
||||||
|
|
||||||
|
import javax.measure.unit.Unit;
|
||||||
import javax.xml.bind.annotation.XmlAccessType;
|
import javax.xml.bind.annotation.XmlAccessType;
|
||||||
import javax.xml.bind.annotation.XmlAccessorType;
|
import javax.xml.bind.annotation.XmlAccessorType;
|
||||||
import javax.xml.bind.annotation.XmlAttribute;
|
import javax.xml.bind.annotation.XmlAttribute;
|
||||||
import javax.xml.bind.annotation.XmlElement;
|
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.DynamicSerialize;
|
||||||
import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement;
|
import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement;
|
||||||
|
|
||||||
|
@ -50,6 +53,11 @@ public class Aggregate {
|
||||||
@DynamicSerializeElement
|
@DynamicSerializeElement
|
||||||
private String field;
|
private String field;
|
||||||
|
|
||||||
|
@XmlAttribute
|
||||||
|
@XmlJavaTypeAdapter(value = UnitAdapter.class)
|
||||||
|
@DynamicSerializeElement
|
||||||
|
private Unit<?> unit = Unit.ONE;
|
||||||
|
|
||||||
/** the name of the statistic function */
|
/** the name of the statistic function */
|
||||||
@XmlElement(name = "function")
|
@XmlElement(name = "function")
|
||||||
@DynamicSerializeElement
|
@DynamicSerializeElement
|
||||||
|
@ -63,6 +71,21 @@ public class Aggregate {
|
||||||
this.field = field;
|
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() {
|
public Item[] getFunctions() {
|
||||||
return functions;
|
return functions;
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,6 +4,6 @@
|
||||||
<groupBy>
|
<groupBy>
|
||||||
<attribute name="pluginName"/>
|
<attribute name="pluginName"/>
|
||||||
</groupBy>
|
</groupBy>
|
||||||
<aggregate field="processingTimeMilliseconds"/>
|
<aggregate field="processingTime" unit="ms"/>
|
||||||
<aggregate field="processingLatencyMilliseconds"/>
|
<aggregate field="processingLatency" unit="ms"/>
|
||||||
</statsConfig>
|
</statsConfig>
|
||||||
|
|
Loading…
Add table
Reference in a new issue