Add source variable

Former-commit-id: 5d9bb2f71e [formerly ae09ebb11f] [formerly 8800080d2a] [formerly 5d9bb2f71e [formerly ae09ebb11f] [formerly 8800080d2a] [formerly d0d889f11d [formerly 8800080d2a [formerly fbd7e7f86b3568a0b04f2b34a072b45a301d8d2d]]]]
Former-commit-id: d0d889f11d
Former-commit-id: 8d335839e6 [formerly 44fcd1a8db] [formerly da1c2ea08a80b36673131e488158b2c4a2af18db [formerly 24fea6f45d]]
Former-commit-id: e10fee20c3429fa2de5343bfd74d936e7a2fc6d7 [formerly 344c5b41b3]
Former-commit-id: 0ab3b9d7f9
This commit is contained in:
Greg Armendariz 2013-03-28 08:56:50 -05:00
parent e487576093
commit 6a115c344f

View file

@ -58,7 +58,6 @@ import com.raytheon.uf.common.datastorage.StorageProperties;
import com.raytheon.uf.common.datastorage.StorageProperties.Compression;
import com.raytheon.uf.common.datastorage.records.ByteDataRecord;
import com.raytheon.uf.common.datastorage.records.IDataRecord;
import com.raytheon.uf.common.event.EventBus;
import com.raytheon.uf.common.localization.IPathManager;
import com.raytheon.uf.common.localization.LocalizationContext;
import com.raytheon.uf.common.localization.LocalizationContext.LocalizationLevel;
@ -83,7 +82,6 @@ import com.raytheon.uf.common.monitor.xml.SourceIngestConfigXML;
import com.raytheon.uf.common.monitor.xml.SourceXML;
import com.raytheon.uf.common.serialization.SerializationException;
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;
@ -121,7 +119,6 @@ import com.raytheon.uf.edex.plugin.ffmp.common.FFTIRatioDiff;
* 02/01/13 1569 D. Hladky Added constants, switched to using aggregate records written through pypies
* 02/20/13 1635 D. Hladky Added some finally methods to increase dead lock safety. Reduced wait times for threads.
* 02/25/13 1660 D. Hladky Redesigned data flow for FFTI in order to have only one mosaic piece in memory at a time.
* 03/22/13 1803 D. Hladky Fixed broken performance logging for ffmp.
* </pre>
*
* @author dhladky
@ -733,6 +730,10 @@ public class FFMPGenerator extends CompositeProductGenerator implements
}
}
}
}
SourceXML source = getSourceConfig().getSource(
ffmpRec.getSourceName());
if (!source.getSourceType().equals(
SOURCE_TYPE.GUIDANCE.getSourceType())) {
@ -740,14 +741,11 @@ public class FFMPGenerator extends CompositeProductGenerator implements
dataKey, ffmpRec);
ffmpData.remove(sourceSiteDataKey);
statusHandler.info("Removing from memory: "+sourceSiteDataKey);
}
} // ffmp.isFFTI
} // record not null
} // end sitekey for loop
} // end datakey loop
} // end process
}
}
}
}
}
/**
@ -2016,42 +2014,31 @@ public class FFMPGenerator extends CompositeProductGenerator implements
}
/**
* Log process statistics
* Find siteSourceDataKey
*
* @param message
* @param source
* @param dataKey
* @param ffmpRec
* @return
*/
@Override
public void log(URIGenerateMessage message) {
private String getSourceSiteDataKey(SourceXML source, String dataKey, FFMPRecord ffmpRec) {
long curTime = System.currentTimeMillis();
ProcessEvent processEvent = new ProcessEvent();
String sourceName = source.getSourceName();
String sourceSiteDataKey = null;
if (productType != null) {
processEvent.setDataType(productType);
if (source.getSourceType().equals(
SOURCE_TYPE.GUIDANCE.getSourceType())) {
sourceName = source.getDisplayName();
sourceSiteDataKey = sourceName;
} else {
sourceName = ffmpRec.getSourceName();
sourceSiteDataKey = sourceName + "-" + ffmpRec.getSiteKey()
+ "-" + dataKey;
}
Long dequeueTime = message.getDeQueuedTime();
if (dequeueTime != null) {
long elapsedMilliseconds = curTime - dequeueTime;
processEvent.setProcessingTime(elapsedMilliseconds);
return sourceSiteDataKey;
}
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);
}
}
}