diff --git a/common/workunit/workunit.cpp b/common/workunit/workunit.cpp index ec3b3590e70..05171de77f0 100644 --- a/common/workunit/workunit.cpp +++ b/common/workunit/workunit.cpp @@ -2681,19 +2681,22 @@ void StatisticsAggregator::loadExistingAggregates(const IConstWorkUnit &workunit }; WuScopeFilter filter; - filter.addScopeType(SSTglobal).addScopeType(SSTworkflow).addScopeType(SSTgraph); + filter.addScopeType(SSTglobal).addScopeType(SSTworkflow).addScopeType(SSTgraph).addScopeType(SSToperation); const unsigned numStats = mapping.numStatistics(); for (unsigned i=0; idfu) filter.setSources(SSFsearchGlobalStats); - filter.setIncludeNesting(0); filter.finishedFilter(); StatsCollectionAggregatesLoader aggregatesLoader(statsCollection); Owned iter = &workunit.getScopeIterator(filter); ForEach(*iter) + { iter->playProperties(aggregatesLoader); + if (iter->getScopeType()==SSToperation && !iter->nextSibling()) // don't descend operation. only top operation scope needed + break; + } } // Replace the stats at the specified scope level @@ -8927,7 +8930,7 @@ void CLocalWorkUnit::setStatistic(StatisticCreatorType creatorType, const char * if (mergeAction != StatsMergeAppend) { StringBuffer xpath; - xpath.append("Statistic[@creator='").append(creator).append("'][@scope='").append(scope).append("'][@kind='").append(kindName).append("']"); + xpath.append("Statistic[@scope='").append(scope).append("'][@kind='").append(kindName).append("']"); statTree = stats->queryPropTree(xpath.str()); } @@ -9002,6 +9005,22 @@ void CLocalWorkUnit::setStatistic(StatisticCreatorType creatorType, const char * } if (kind == StCostCompile) p->setPropInt64("@costCompile", value); + + // Special case - update aggregates for dfu FileAccessCost. This is needed because although + // fileservices can update dfu cost in the workunit, it does not have a mechanism to update + // the aggregates for this stat. + if (scopeType == SSTdfuworkunit && kind == StCostFileAccess && value) + { + StringBuffer currentScope(scope), parent; + while (getParentScope(parent.clear(), currentScope.str())) + { + currentScope.set(parent); + StatisticScopeType sst = getScopeType(queryScopeTail(currentScope.str())); + if (sst!=SSTnone) + setStatistic(creatorType, creator, sst, currentScope.str(), StCostFileAccess, "", value, 1, 0, StatsMergeSum); + } + setStatistic(creatorType, creator, SSTglobal, "", StCostFileAccess, "", value, 1, 0, StatsMergeSum); + } } void CLocalWorkUnit::_loadStatistics() const diff --git a/esp/scm/ws_fs.ecm b/esp/scm/ws_fs.ecm index 01a57f89f58..4a518e32707 100644 --- a/esp/scm/ws_fs.ecm +++ b/esp/scm/ws_fs.ecm @@ -734,7 +734,7 @@ ESPservice [ ESPmethod [resp_xsl_default("/esp/xslt/showresult.xslt")] ShowResult(ShowResultRequest, ShowResultResponse); ESPmethod [resp_xsl_default("/esp/xslt/dfuwu_search.xslt")] DFUWUSearch(DFUWUSearchRequest, DFUWUSearchResponse); ESPmethod [resp_xsl_default("/esp/xslt/dfu_workunits.xslt")] GetDFUWorkunits(GetDFUWorkunits, GetDFUWorkunitsResponse); - ESPmethod [resp_xsl_default("/esp/xslt/dfu_wuid.xslt")] GetDFUWorkunit(GetDFUWorkunit, GetDFUWorkunitResponse); + ESPmethod [min_ver("1.26"), resp_xsl_default("/esp/xslt/dfu_wuid.xslt")] GetDFUWorkunit(GetDFUWorkunit, GetDFUWorkunitResponse); ESPmethod [resp_xsl_default("/esp/xslt/dfu_progress.xslt")] GetDFUProgress(ProgressRequest, ProgressResponse); ESPmethod [resp_xsl_default("/esp/xslt/dfu_wuid.xslt")] CreateDFUWorkunit(CreateDFUWorkunit, CreateDFUWorkunitResponse);