|
@@ -27,16 +27,16 @@ int compareIssuesCostOrder(CInterface * const * _l, CInterface * const * _r)
|
|
|
|
|
|
int PerformanceIssue::compareCost(const PerformanceIssue & other) const
|
|
|
{
|
|
|
- if (cost == other.cost)
|
|
|
+ if (timePenalty == other.timePenalty)
|
|
|
return 0;
|
|
|
else
|
|
|
- return cost > other.cost ? -1 : +1;
|
|
|
+ return timePenalty > other.timePenalty ? -1 : +1;
|
|
|
}
|
|
|
|
|
|
void PerformanceIssue::print() const
|
|
|
{
|
|
|
StringBuffer out;
|
|
|
- formatStatistic(out, cost, SMeasureTimeNs);
|
|
|
+ formatStatistic(out, timePenalty, SMeasureTimeNs);
|
|
|
printf("[%s] E%d \"%s\" %s ", out.str(), errorCode, comment.str(), scope.str());
|
|
|
if (filename.length()>0)
|
|
|
printf("%s", filename.str());
|
|
@@ -45,7 +45,7 @@ void PerformanceIssue::print() const
|
|
|
printf("\n");
|
|
|
}
|
|
|
|
|
|
-void PerformanceIssue::createException(IWorkUnit * wu)
|
|
|
+void PerformanceIssue::createException(IWorkUnit * wu, double costRate)
|
|
|
{
|
|
|
ErrorSeverity mappedSeverity = wu->getWarningSeverity(errorCode, (ErrorSeverity)SeverityWarning);
|
|
|
if (mappedSeverity == SeverityIgnore)
|
|
@@ -55,7 +55,7 @@ void PerformanceIssue::createException(IWorkUnit * wu)
|
|
|
we->setExceptionCode(errorCode);
|
|
|
we->setSeverity(mappedSeverity);
|
|
|
we->setScope(scope.str());
|
|
|
- we->setPriority((unsigned) statUnits2msecs(cost));
|
|
|
+ we->setPriority((unsigned) statUnits2msecs(timePenalty));
|
|
|
if (line>0 && column>0)
|
|
|
{
|
|
|
we->setExceptionLineNo(line);
|
|
@@ -65,13 +65,18 @@ void PerformanceIssue::createException(IWorkUnit * wu)
|
|
|
we->setExceptionFileName(filename);
|
|
|
StringBuffer s(comment); // Append scope to comment as scope column is not visible in ECLWatch
|
|
|
s.appendf(" (%s)", scope.str());
|
|
|
+ if (costRate!=0.0)
|
|
|
+ {
|
|
|
+ double timePenaltyPerHour = (double)statUnits2seconds(timePenalty) / 3600;
|
|
|
+ s.appendf(" cost %.2f", timePenaltyPerHour*costRate);
|
|
|
+ }
|
|
|
we->setExceptionMessage(s.str());
|
|
|
we->setExceptionSource("Workunit Analyzer");
|
|
|
}
|
|
|
|
|
|
-void PerformanceIssue::set(AnalyzerErrorCode _errorCode, stat_type _cost, const char * msg, ...)
|
|
|
+void PerformanceIssue::set(AnalyzerErrorCode _errorCode, stat_type _timePenalty, const char * msg, ...)
|
|
|
{
|
|
|
- cost = _cost;
|
|
|
+ timePenalty = _timePenalty;
|
|
|
errorCode = _errorCode;
|
|
|
va_list args;
|
|
|
va_start(args, msg);
|