|
@@ -2395,16 +2395,12 @@ static const char * checkDash(const char * s)
|
|
|
return "*";
|
|
|
return s;
|
|
|
}
|
|
|
-static void dumpStats(const char *wuid, const char * creatorTypeText, const char * creator, const char * scopeTypeText, const char * scope, const char * kindText)
|
|
|
-{
|
|
|
- Owned<IWorkUnitFactory> factory = getWorkUnitFactory();
|
|
|
- Owned<IConstWorkUnit> workunit = factory->openWorkUnit(wuid);
|
|
|
- if (!workunit)
|
|
|
- return;
|
|
|
|
|
|
+static void dumpStats(IConstWorkUnit * workunit, const char * creatorTypeText, const char * creator, const char * scopeTypeText, const char * scope, const char * kindText)
|
|
|
+{
|
|
|
StatisticsFilter filter(checkDash(creatorTypeText), checkDash(creator), checkDash(scopeTypeText), checkDash(scope), NULL, checkDash(kindText));
|
|
|
Owned<IConstWUStatisticIterator> stats = &workunit->getStatistics(&filter);
|
|
|
- printf("<Statistics>\n");
|
|
|
+ printf("<Statistics wuid=\"%s\">\n", workunit->queryWuid());
|
|
|
ForEach(*stats)
|
|
|
{
|
|
|
IConstWUStatistic & cur = stats->query();
|
|
@@ -2458,6 +2454,35 @@ static void dumpStats(const char *wuid, const char * creatorTypeText, const char
|
|
|
printf("</Statistics>\n");
|
|
|
}
|
|
|
|
|
|
+static void dumpStats(const char *wuid, const char * creatorTypeText, const char * creator, const char * scopeTypeText, const char * scope, const char * kindText)
|
|
|
+{
|
|
|
+ Owned<IWorkUnitFactory> factory = getWorkUnitFactory();
|
|
|
+ const char * star = strchr(wuid, '*');
|
|
|
+ if (star)
|
|
|
+ {
|
|
|
+ WUSortField filters[2];
|
|
|
+ MemoryBuffer filterbuf;
|
|
|
+ filters[0] = WUSFwildwuid;
|
|
|
+ filterbuf.append(wuid);
|
|
|
+ filters[1] = WUSFterm;
|
|
|
+ Owned<IConstWorkUnitIterator> iter = factory->getWorkUnitsSorted((WUSortField) (WUSFwuid), filters, filterbuf.bufferBase(), 0, INT_MAX, NULL, NULL);
|
|
|
+
|
|
|
+ ForEach(*iter)
|
|
|
+ {
|
|
|
+ Owned<IConstWorkUnit> workunit = factory->openWorkUnit(iter->query().queryWuid());
|
|
|
+ if (workunit)
|
|
|
+ dumpStats(workunit, creatorTypeText, creator, scopeTypeText, scope, kindText);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ Owned<IConstWorkUnit> workunit = factory->openWorkUnit(wuid);
|
|
|
+ if (!workunit)
|
|
|
+ return;
|
|
|
+ dumpStats(workunit, creatorTypeText, creator, scopeTypeText, scope, kindText);
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
static void wuidCompress(const char *match, const char *type, bool compress)
|
|
|
{
|
|
|
if (0 != stricmp("graph", type))
|