* default compression level for ROOT objects
*/
#define ALIHLTCOMPONENT_DEFAULT_OBJECT_COMPRESSION 5
+#define ALIHLTCOMPONENT_STATTIME_SCALER 1000000
/** ROOT macro for the implementation of ROOT specific class methods */
ClassImp(AliHLTComponent);
#if defined(__DEBUG) || defined(HLT_COMPONENT_STATISTICS)
// benchmarking stopwatch for the component statistics
fpBenchmark=new TStopwatch;
- if (fpBenchmark) {
- fpBenchmark->Start();
- }
#endif
return iResult;
#if defined(__DEBUG) || defined(HLT_COMPONENT_STATISTICS)
AliHLTComponentStatistics outputStat;
memset(&outputStat, 0, sizeof(AliHLTComponentStatistics));
+ outputStat.fStructSize=sizeof(AliHLTComponentStatistics);
outputStat.fId=fChainIdCrc;
- compStats.push_back(outputStat);
if (fpBenchmark) {
+ fpBenchmark->Stop();
+ outputStat.fComponentCycleTime=(AliHLTUInt32_t)(fpBenchmark->RealTime()*ALIHLTCOMPONENT_STATTIME_SCALER);
fpBenchmark->Reset();
fpBenchmark->Start();
}
+ compStats.push_back(outputStat);
#endif
// data processing is skipped
stats[0].fTotalOutputSize=offset;
stats[0].fOutputBlockCount=blocks.size();
if (fpBenchmark) {
- stats[0].fTime=(AliHLTUInt32_t)(fpBenchmark->RealTime()*1000000);
- stats[0].fCTime=(AliHLTUInt32_t)(fpBenchmark->CpuTime()*1000000);
+ fpBenchmark->Stop();
+ stats[0].fTime=(AliHLTUInt32_t)(fpBenchmark->RealTime()*ALIHLTCOMPONENT_STATTIME_SCALER);
+ stats[0].fCTime=(AliHLTUInt32_t)(fpBenchmark->CpuTime()*ALIHLTCOMPONENT_STATTIME_SCALER);
+ fpBenchmark->Continue();
}
if (offset+stats.size()*sizeof(AliHLTComponentStatistics)<=bufferSize) {
AliHLTComponentBlockData bd;
* kAliHLTMCObjectDataType added
* kAliHLTDataOriginOffline added
* kAliHLTDataOriginHLT added
+ * 11 extended AliHLTComponentStatistics: one more member to store the
+ * cycle time between events per component.
*/
-#define ALIHLT_DATA_TYPES_VERSION 10
+#define ALIHLT_DATA_TYPES_VERSION 11
//////////////////////////////////////////////////////////////////////////
//
* fLevel is retrieved from incoming block statistics and incremented.
* Incoming block statistics are appended to the newly added one if
* --enable-compstat=full has been chosen.
+ *
+ * ChangeLog:
+ * 2009-01-14 fComponentCycleTime added
*/
struct AliHLTComponentStatistics
{
AliHLTUInt32_t fTotalInputSize;
AliHLTUInt32_t fOutputBlockCount;
AliHLTUInt32_t fTotalOutputSize;
+ AliHLTUInt32_t fComponentCycleTime;
};
/**
fpTotalInputSizeArray(NULL),
fpOutputBlockCountArray(NULL),
fpTotalOutputSizeArray(NULL)
+ , fpComponentCycleTimeArray(NULL)
+ , fpEventTypeArray(NULL)
+ , fpEventCountArray(NULL)
, fSizeEstimator(1000)
, fMode(kPublishObjects)
, fFileName()
fpTotalInputSizeArray=new UInt_t[fArraySize];
fpOutputBlockCountArray=new UInt_t[fArraySize];
fpTotalOutputSizeArray=new UInt_t[fArraySize];
+ fpComponentCycleTimeArray=new UInt_t[fArraySize];
+ fpEventTypeArray=new UInt_t[fArraySize];
+ fpEventCountArray=new UInt_t[fArraySize];
fpStatTree=new TTree("CompStat", "HLT component statistics");
if (fpStatTree) {
fpStatTree->Branch("TotalInputSize", fpTotalInputSizeArray, "TotalInputSize[nofSets]/i");
fpStatTree->Branch("OutputBlockCount", fpOutputBlockCountArray, "OutputBlockCount[nofSets]/i");
fpStatTree->Branch("TotalOutputSize", fpTotalOutputSizeArray, "TotalOutputSize[nofSets]/i");
+ fpStatTree->Branch("ComponentCycleTime",fpComponentCycleTimeArray, "ComponentCycleTime[nofSets]/i");
+ fpStatTree->Branch("EventType",fpEventTypeArray, "EventType[nofSets]/i");
+ fpStatTree->Branch("EventCount",fpEventCountArray, "EventCount[nofSets]/i");
}
}
pBlock && iResult>=0;
pBlock=GetNextInputBlock(), blockNo++) {
unsigned int current=fPosition;
- iResult=FillVariablesSorted(pBlock->fPtr, pBlock->fSize);
+ iResult=FillVariablesSorted(pBlock->fPtr, pBlock->fSize, eventType);
for (; current<fPosition; current++) {
fpSpecArray[current]=pBlock->fSpecification;
fpBlockNoArray[current]=blockNo;
}
int totalOutputSize=0;
- if (iResult>0) {
+ if (iResult>0 && eventType) {
fNofSets=fPosition;
fpStatTree->Fill();
memset(fpTotalInputSizeArray, 0, sizeof(UInt_t)*fArraySize);
memset(fpOutputBlockCountArray, 0, sizeof(UInt_t)*fArraySize);
memset(fpTotalOutputSizeArray, 0, sizeof(UInt_t)*fArraySize);
+ memset(fpComponentCycleTimeArray, 0, sizeof(UInt_t)*fArraySize);
+ memset(fpEventTypeArray, 0, sizeof(UInt_t)*fArraySize);
+ memset(fpEventCountArray, 0, sizeof(UInt_t)*fArraySize);
}
-int AliHLTCompStatCollector::FillVariablesSorted(void* ptr, int size)
+int AliHLTCompStatCollector::FillVariablesSorted(void* ptr, int size, AliHLTUInt32_t eventType)
{
// see header file for class documentation
int iResult=0;
if (size%sizeof(AliHLTComponentStatistics)) {
+ // older or invalid structure
HLTError("data block is not aligned to the size of the AliHLTComponentStatistics struct");
return -EINVAL;
}
+
AliHLTComponentStatistics* pStat=reinterpret_cast<AliHLTComponentStatistics*>(ptr);
UInt_t nofStats=size/sizeof(AliHLTComponentStatistics);
vector<int> indexList;
fpTotalInputSizeArray[i]=pStat[*element].fTotalInputSize;
fpOutputBlockCountArray[i]=pStat[*element].fOutputBlockCount;
fpTotalOutputSizeArray[i]=pStat[*element].fTotalOutputSize;
+ fpComponentCycleTimeArray[i]=pStat[*element].fComponentCycleTime;
+ fpEventTypeArray[i]=eventType;
+ fpEventCountArray[i]=GetEventCount();
} else {
// TODO: dynamically grow arrays with placement new
}
if (fpTotalInputSizeArray) delete fpTotalInputSizeArray; fpTotalInputSizeArray=NULL;
if (fpOutputBlockCountArray) delete fpOutputBlockCountArray; fpOutputBlockCountArray=NULL;
if (fpTotalOutputSizeArray) delete fpTotalOutputSizeArray; fpTotalOutputSizeArray=NULL;
+ if (fpComponentCycleTimeArray) delete fpComponentCycleTimeArray; fpComponentCycleTimeArray=NULL;
+ if (fpEventTypeArray) delete fpEventTypeArray; fpEventTypeArray=NULL;
+ if (fpEventCountArray) delete fpEventCountArray; fpEventCountArray=NULL;
}
int AliHLTCompStatCollector::RemoveRecurrence(TFolder* pRoot) const
/**
* Fill the lists from the component statistics block.
*/
- int FillVariablesSorted(void* ptr, int size);
+ int FillVariablesSorted(void* ptr, int size, AliHLTUInt32_t eventType);
/** delete all internal objects */
void ClearAll();
UInt_t* fpOutputBlockCountArray; //!transient
/** branch filling variable */
UInt_t* fpTotalOutputSizeArray; //!transient
+ /** branch filling variable */
+ UInt_t* fpComponentCycleTimeArray; //!transient
+ /** branch filling variable */
+ UInt_t* fpEventTypeArray; //!transient
+ /** branch filling variable */
+ UInt_t* fpEventCountArray; //!transient
/** const base of GetOutputSize, updated on error in DoEvent */
int fSizeEstimator; //! transient
/** event modulo to save/publish onjects */
unsigned int fEventModulo; //! transient
- ClassDef(AliHLTCompStatCollector, 3)
+ ClassDef(AliHLTCompStatCollector, 4)
};
#endif