1 
2 /* Web Polygraph       http://www.web-polygraph.org/
3  * Copyright 2003-2011 The Measurement Factory
4  * Licensed under the Apache License, Version 2.0 */
5 
6 #include "base/polygraph.h"
7 
8 #include "xml/XmlText.h"
9 #include "xml/XmlParagraph.h"
10 #include "loganalyzers/ReportBlob.h"
11 #include "loganalyzers/PhaseInfo.h"
12 #include "loganalyzers/Stex.h"
13 
14 
Stex(const String & aKey,const String & aName)15 Stex::Stex(const String &aKey, const String &aName):
16 	theKey(aKey), theName(aName),
17 	theParent(0), doIgnoreUnseen(false) {
18 }
19 
~Stex()20 Stex::~Stex() {
21 }
22 
parent(const Stex * aParent)23 void Stex::parent(const Stex *aParent) {
24 	Assert(!theParent || !aParent);
25 	theParent = aParent;
26 }
27 
totalCount(const PhaseInfo & phase) const28 double Stex::totalCount(const PhaseInfo &phase) const {
29 	if (const TmSzStat *const recStats = aggr(phase))
30 		return recStats->size().count();
31 
32 	return 0;
33 }
34 
meanPartsCount(const PhaseInfo & phase) const35 double Stex::meanPartsCount(const PhaseInfo &phase) const {
36 	const AggrStat *const stats = partsStat(phase);
37 	return stats && stats->known() ? stats->mean() : 1;
38 }
39 
40 // compare using "contribution by count" and other factors
cmpByCountContrib(const PhaseInfo & phase,const Stex & stex) const41 int Stex::cmpByCountContrib(const PhaseInfo &phase, const Stex &stex) const {
42 	static const double epsilon = 1e-3;
43 
44 	const double x = totalCount(phase) * meanPartsCount(phase);
45 	const double y = stex.totalCount(phase) * stex.meanPartsCount(phase);
46 	const double diff = x - y;
47 
48 	if (diff < -epsilon)
49 		return -1;
50 	if (diff > epsilon)
51 		return 1;
52 
53 	// check if one stex is parent of another
54 	// parent stex contribute more than child
55 	if (parent() == &stex)
56 		return -1;
57 	if (stex.parent() == this)
58 		return 1;
59 
60 	// compare names if nothing else
61 	return name().cmp(stex.name());
62 }
63 
aggr(const PhaseInfo & phase) const64 const TmSzStat *Stex::aggr(const PhaseInfo &phase) const {
65 	return trace(phase.availStats());
66 }
67 
partsStat(const PhaseInfo & phase) const68 const AggrStat *Stex::partsStat(const PhaseInfo &phase) const {
69 	const Histogram *const h = partsHist(phase);
70 	return h ? &h->stats() : 0;
71 }
72 
describe(XmlNodes & nodes) const73 void Stex::describe(XmlNodes &nodes) const {
74 	nodes << XmlTextTag<XmlParagraph>("No description is available for "
75 		"this object class.");
76 	describeParent(nodes);
77 }
78 
describeParent(XmlNodes & nodes) const79 void Stex::describeParent(XmlNodes &nodes) const {
80 	if (parent()) {
81 		XmlTextTag<XmlParagraph> text;
82 		text.buf() << "This object class belongs to the '"
83 			<< parent()->name() << "' class.";
84 		nodes << text;
85 	}
86 }
87 
88 
89 /* HitsStex */
90 
HitsStex(const String & aKey,const String & aName)91 HitsStex::HitsStex(const String &aKey, const String &aName):
92 	Stex(aKey, aName) {
93 }
94 
hist(const PhaseInfo & phase) const95 const TmSzHistStat *HitsStex::hist(const PhaseInfo &phase) const {
96 	return phase.hasStats() ? &phase.stats().theBasicXacts.hits() : 0;
97 }
98 
trace(const StatIntvlRec & rec) const99 const TmSzStat *HitsStex::trace(const StatIntvlRec &rec) const {
100 	return &rec.theRealHR.hits();
101 }
102 
describe(XmlNodes & nodes) const103 void HitsStex::describe(XmlNodes &nodes) const {
104 	Stex::describe(nodes);
105 }
106 
107 
108 /* MissesStex */
109 
MissesStex(const String & aKey,const String & aName)110 MissesStex::MissesStex(const String &aKey, const String &aName):
111 	Stex(aKey, aName) {
112 }
113 
hist(const PhaseInfo & phase) const114 const TmSzHistStat *MissesStex::hist(const PhaseInfo &phase) const {
115 	return phase.hasStats() ? &phase.stats().theBasicXacts.misses() : 0;
116 }
117 
trace(const StatIntvlRec & rec) const118 const TmSzStat *MissesStex::trace(const StatIntvlRec &rec) const {
119 	return &rec.theRealHR.misses();
120 }
121 
describe(XmlNodes & nodes) const122 void MissesStex::describe(XmlNodes &nodes) const {
123 	Stex::describe(nodes);
124 }
125 
126 
127 /* HitMissesStex */
128 
HitMissesStex(const String & aKey,const String & aName)129 HitMissesStex::HitMissesStex(const String &aKey, const String &aName):
130 	Stex(aKey, aName) {
131 }
132 
hist(const PhaseInfo & phase) const133 const TmSzHistStat *HitMissesStex::hist(const PhaseInfo &phase) const {
134 	if (phase.hasStats()) {
135 		theXactHist.reset();
136 		theXactHist = phase.stats().theBasicXacts.hits();
137 		theXactHist += phase.stats().theBasicXacts.misses();
138 		return &theXactHist;
139 	} else {
140 		return 0;
141 	}
142 }
143 
trace(const StatIntvlRec & rec) const144 const TmSzStat *HitMissesStex::trace(const StatIntvlRec &rec) const {
145 	theXactAggr = rec.theRealHR.xacts();
146 	return &theXactAggr;
147 }
148 
describe(XmlNodes & nodes) const149 void HitMissesStex::describe(XmlNodes &nodes) const {
150 	Stex::describe(nodes);
151 }
152 
153 
154 /* ValidationHitStex */
155 
ValidationHitStex(const String & aKey,const String & aName,const HRHistPtr aHRHist)156 ValidationHitStex::ValidationHitStex(const String &aKey, const String &aName, const HRHistPtr aHRHist):
157 	Stex(aKey, aName), theHRHist(aHRHist) {
158 }
159 
aggr(const PhaseInfo & phase) const160 const TmSzStat *ValidationHitStex::aggr(const PhaseInfo &phase) const {
161 	if (phase.hasStats()) {
162 		theXactAggr = (phase.stats().*theHRHist).hits().aggr();
163 		return &theXactAggr;
164 	} else {
165 		return 0;
166 	}
167 }
168 
hist(const PhaseInfo & phase) const169 const TmSzHistStat *ValidationHitStex::hist(const PhaseInfo &phase) const {
170 	return phase.hasStats() ? &(phase.stats().*theHRHist).hits() : 0;
171 }
172 
describe(XmlNodes & nodes) const173 void ValidationHitStex::describe(XmlNodes &nodes) const {
174 	Stex::describe(nodes);
175 }
176 
177 
178 /* ValidationMissStex */
179 
ValidationMissStex(const String & aKey,const String & aName,const HRHistPtr aHRHist)180 ValidationMissStex::ValidationMissStex(const String &aKey, const String &aName, const HRHistPtr aHRHist):
181 	Stex(aKey, aName), theHRHist(aHRHist) {
182 }
183 
aggr(const PhaseInfo & phase) const184 const TmSzStat *ValidationMissStex::aggr(const PhaseInfo &phase) const {
185 	if (phase.hasStats()) {
186 		theXactAggr = (phase.stats().*theHRHist).misses().aggr();
187 		return &theXactAggr;
188 	} else {
189 		return 0;
190 	}
191 }
192 
hist(const PhaseInfo & phase) const193 const TmSzHistStat *ValidationMissStex::hist(const PhaseInfo &phase) const {
194 	return phase.hasStats() ? &(phase.stats().*theHRHist).misses() : 0;
195 }
196 
describe(XmlNodes & nodes) const197 void ValidationMissStex::describe(XmlNodes &nodes) const {
198 	Stex::describe(nodes);
199 }
200 
201 
202 /* ImsStex */
203 
ValidationHitMissStex(const String & aKey,const String & aName,const HRHistPtr aHRHist,const TracePtr aTrace)204 ValidationHitMissStex::ValidationHitMissStex(const String &aKey, const String &aName, const HRHistPtr aHRHist, const TracePtr aTrace):
205 	Stex(aKey, aName), theHRHist(aHRHist), theTrace(aTrace) {
206 }
207 
aggr(const PhaseInfo & phase) const208 const TmSzStat *ValidationHitMissStex::aggr(const PhaseInfo &phase) const {
209 	const TmSzStat *stat;
210 	if (theTrace)
211 		stat = Stex::aggr(phase);
212 	else
213 	if (phase.hasStats()) {
214 		theXactAggr.reset();
215 		theXactAggr += (phase.stats().*theHRHist).hits().aggr();
216 		theXactAggr += (phase.stats().*theHRHist).misses().aggr();
217 		stat = &theXactAggr;
218 	} else
219 		stat = 0;
220 	return stat;
221 }
222 
hist(const PhaseInfo & phase) const223 const TmSzHistStat *ValidationHitMissStex::hist(const PhaseInfo &phase) const {
224 	if (phase.hasStats()) {
225 		theXactHist.reset();
226 		theXactHist = (phase.stats().*theHRHist).hits();
227 		theXactHist += (phase.stats().*theHRHist).misses();
228 		return &theXactHist;
229 	} else {
230 		return 0;
231 	}
232 }
233 
trace(const StatIntvlRec & rec) const234 const TmSzStat *ValidationHitMissStex::trace(const StatIntvlRec &rec) const {
235 	return theTrace ? &(rec.*theTrace) : 0;
236 }
237 
describe(XmlNodes & nodes) const238 void ValidationHitMissStex::describe(XmlNodes &nodes) const {
239 	Stex::describe(nodes);
240 }
241 
242 
243 /* CachableStex */
244 
CachableStex(const String & aKey,const String & aName)245 CachableStex::CachableStex(const String &aKey, const String &aName):
246 	Stex(aKey, aName) {
247 }
248 
trace(const StatIntvlRec & rec) const249 const TmSzStat *CachableStex::trace(const StatIntvlRec &rec) const {
250 	return &rec.theChbR.hits();
251 }
252 
describe(XmlNodes & nodes) const253 void CachableStex::describe(XmlNodes &nodes) const {
254 	Stex::describe(nodes);
255 }
256 
257 
258 /* UnCachableStex */
259 
UnCachableStex(const String & aKey,const String & aName)260 UnCachableStex::UnCachableStex(const String &aKey, const String &aName):
261 	Stex(aKey, aName) {
262 }
263 
trace(const StatIntvlRec & rec) const264 const TmSzStat *UnCachableStex::trace(const StatIntvlRec &rec) const {
265 	return &rec.theChbR.misses();
266 }
267 
describe(XmlNodes & nodes) const268 void UnCachableStex::describe(XmlNodes &nodes) const {
269 	Stex::describe(nodes);
270 }
271 
272 
273 /* AllCachableStex */
274 
AllCachableStex(const String & aKey,const String & aName)275 AllCachableStex::AllCachableStex(const String &aKey, const String &aName):
276 	Stex(aKey, aName) {
277 }
278 
trace(const StatIntvlRec & rec) const279 const TmSzStat *AllCachableStex::trace(const StatIntvlRec &rec) const {
280 	theXactAggr = rec.theChbR.xacts();
281 	return &theXactAggr;
282 }
283 
describe(XmlNodes & nodes) const284 void AllCachableStex::describe(XmlNodes &nodes) const {
285 	Stex::describe(nodes);
286 }
287 
288 
289 /* FillStex */
290 
FillStex(const String & aKey,const String & aName)291 FillStex::FillStex(const String &aKey, const String &aName):
292 	Stex(aKey, aName) {
293 }
294 
trace(const StatIntvlRec & rec) const295 const TmSzStat *FillStex::trace(const StatIntvlRec &rec) const {
296 	return &rec.theFill;
297 }
298 
describe(XmlNodes & nodes) const299 void FillStex::describe(XmlNodes &nodes) const {
300 	Stex::describe(nodes);
301 }
302 
303 
304 /* SimpleStex */
305 
SimpleStex(const String & aKey,const String & aName,HistPtr aHist,TracePtr aTrace)306 SimpleStex::SimpleStex(const String &aKey, const String &aName, HistPtr aHist, TracePtr aTrace):
307 	Stex(aKey, aName), theHist(aHist), theTrace(aTrace) {
308 }
309 
hist(const PhaseInfo & phase) const310 const TmSzHistStat *SimpleStex::hist(const PhaseInfo &phase) const {
311 	return theHist && phase.hasStats() ? &(phase.stats().*theHist) : 0;
312 }
313 
trace(const StatIntvlRec & rec) const314 const TmSzStat *SimpleStex::trace(const StatIntvlRec &rec) const {
315 	return theTrace ? &(rec.*theTrace) : 0;
316 }
317 
describe(XmlNodes & nodes) const318 void SimpleStex::describe(XmlNodes &nodes) const {
319 	Stex::describe(nodes);
320 }
321 
322 
323 /* AllMethodsStex */
324 
AllMethodsStex(const String & aKey,const String & aName)325 AllMethodsStex::AllMethodsStex(const String &aKey, const String &aName):
326 	Stex(aKey, aName) {
327 }
328 
hist(const PhaseInfo & phase) const329 const TmSzHistStat *AllMethodsStex::hist(const PhaseInfo &phase) const {
330 	if (phase.hasStats()) {
331 		theXactHist.reset();
332 		theXactHist += phase.stats().theHeadXacts;
333 		theXactHist += phase.stats().thePostXacts;
334 		theXactHist += phase.stats().thePutXacts;
335 		theXactHist += phase.stats().thePatchXacts;
336 		theXactHist += phase.stats().theConnectXacts;
337 		return &theXactHist;
338 	} else {
339 		return 0;
340 	}
341 }
342 
trace(const StatIntvlRec & rec) const343 const TmSzStat *AllMethodsStex::trace(const StatIntvlRec &rec) const {
344 	theXactAggr = rec.theHead + rec.thePost + rec.thePut + rec.thePatch + rec.theConnectStat.doneXacts().misses();
345 	return &theXactAggr;
346 }
347 
describe(XmlNodes & nodes) const348 void AllMethodsStex::describe(XmlNodes &nodes) const {
349 	Stex::describe(nodes);
350 }
351 
352 
353 /* AllRepsStex */
354 
AllRepsStex(const String & aKey,const String & aName)355 AllRepsStex::AllRepsStex(const String &aKey, const String &aName):
356 	Stex(aKey, aName) {
357 }
358 
hist(const PhaseInfo & phase) const359 const TmSzHistStat *AllRepsStex::hist(const PhaseInfo &phase) const {
360 	if (phase.hasStats()) {
361 		theXactHist.reset();
362 		phase.stats().repAll(theXactHist);
363 		return &theXactHist;
364 	} else {
365 		return 0;
366 	}
367 }
368 
trace(const StatIntvlRec & rec) const369 const TmSzStat *AllRepsStex::trace(const StatIntvlRec &rec) const {
370 	theXactAggr = rec.reps();
371 	return &theXactAggr;
372 }
373 
describe(XmlNodes & nodes) const374 void AllRepsStex::describe(XmlNodes &nodes) const {
375 	Stex::describe(nodes);
376 }
377 
378 
379 /* ContTypeStex */
380 
ContTypeStex(const String & aKey,const String & aName,const int anIdx,const ContTypeAggrPtr aContTypeAggr,const ContTypeHistPtr aContTypeHist)381 ContTypeStex::ContTypeStex(const String &aKey, const String &aName, const int anIdx, const ContTypeAggrPtr aContTypeAggr, const ContTypeHistPtr aContTypeHist):
382 	Stex(aKey, aName), theIdx(anIdx), theContTypeAggr(aContTypeAggr),
383 	theContTypeHist(aContTypeHist) {
384 	Must(theContTypeAggr);
385 	Must(theContTypeHist);
386 }
387 
hist(const PhaseInfo & phase) const388 const TmSzHistStat *ContTypeStex::hist(const PhaseInfo &phase) const {
389 	return phase.hasStats() ?
390 		(phase.stats().*theContTypeHist).hasStats(theIdx) : 0;
391 }
392 
trace(const StatIntvlRec & rec) const393 const TmSzStat *ContTypeStex::trace(const StatIntvlRec &rec) const {
394 	static const TmSzStat emptyStats;
395 	const TmSzStat *const stats = (rec.*theContTypeAggr).hasStats(theIdx);
396 	return stats ? stats : &emptyStats;
397 }
398 
describe(XmlNodes & nodes) const399 void ContTypeStex::describe(XmlNodes &nodes) const {
400 	XmlText text;
401 	if (theIdx < ContType::NormalContentStart()) {
402 		text.buf() << "The " << name() << " object represents one of "
403 			"the built-in content kinds used by Polygraph for "
404 			"messages that do not match any of the PGL-configured "
405 			"Content kinds.";
406 		// TODO: Also document this specific built-in kind?
407 	} else {
408 		text.buf() << "This object class represents the " << name() <<
409 			" Content object in the PGL workload.";
410 	}
411 	nodes << text;
412 }
413 
414 
415 /* RepContTypeStex */
416 
RepContTypeStex(const String & aKey,const String & aName,const int idx)417 RepContTypeStex::RepContTypeStex(const String &aKey, const String &aName, const int idx):
418 	ContTypeStex(aKey, aName, idx, &StatIntvlRec::theRepContType, &StatPhaseRec::theRepContTypeHist) {
419 }
420 
421 
422 /* ReqContTypeStex */
423 
ReqContTypeStex(const String & aKey,const String & aName,const int idx)424 ReqContTypeStex::ReqContTypeStex(const String &aKey, const String &aName, const int idx):
425 	ContTypeStex(aKey, aName, idx, &StatIntvlRec::theReqContType, &StatPhaseRec::theReqContTypeHist) {
426 }
427 
428 
429 /* AllContTypesStex */
430 
AllContTypesStex(const String & aKey,const String & aName,const ContTypeAggrPtr aContTypeAggr,const ContTypeHistPtr aContTypeHist)431 AllContTypesStex::AllContTypesStex(const String &aKey, const String &aName, const ContTypeAggrPtr aContTypeAggr, const ContTypeHistPtr aContTypeHist):
432 	Stex(aKey, aName), theContTypeAggr(aContTypeAggr),
433 	theContTypeHist(aContTypeHist) {
434 	Must(theContTypeAggr);
435 	Must(theContTypeHist);
436 }
437 
hist(const PhaseInfo & phase) const438 const TmSzHistStat *AllContTypesStex::hist(const PhaseInfo &phase) const {
439 	const StatPhaseRec *const rec = phase.hasStats();
440 	if (rec) {
441 		theHistStat.reset();
442 		for (int i = 0; i < ContType::Count(); ++i) {
443 			if ((rec->*theContTypeHist).hasStats(i))
444 				theHistStat += (rec->*theContTypeHist).stats(i);
445 		}
446 		return &theHistStat;
447 	} else
448 		return 0;
449 }
450 
trace(const StatIntvlRec & rec) const451 const TmSzStat *AllContTypesStex::trace(const StatIntvlRec &rec) const {
452 	theAggrStat.reset();
453 	for (int i = 0; i < ContType::Count(); ++i) {
454 		if ((rec.*theContTypeAggr).hasStats(i))
455 			theAggrStat += (rec.*theContTypeAggr).stats(i);
456 	}
457 	return &theAggrStat;
458 }
459 
describe(XmlNodes & nodes) const460 void AllContTypesStex::describe(XmlNodes &nodes) const {
461 	Stex::describe(nodes);
462 }
463 
464 
465 /* AllRepContTypeStex */
466 
AllRepContTypesStex(const String & aKey,const String & aName)467 AllRepContTypesStex::AllRepContTypesStex(const String &aKey, const String &aName):
468 	AllContTypesStex(aKey, aName, &StatIntvlRec::theRepContType, &StatPhaseRec::theRepContTypeHist) {
469 }
470 
471 
472 /* AllReqContTypeStex */
473 
AllReqContTypesStex(const String & aKey,const String & aName)474 AllReqContTypesStex::AllReqContTypesStex(const String &aKey, const String &aName):
475 	AllContTypesStex(aKey, aName, &StatIntvlRec::theReqContType, &StatPhaseRec::theReqContTypeHist) {
476 }
477 
478 
479 /* CompoundReplyStex */
480 
CompoundReplyStex(const String & aKey,const String & aName,const CompoundPtr aCompoundPtr)481 CompoundReplyStex::CompoundReplyStex(const String &aKey, const String &aName, const CompoundPtr aCompoundPtr):
482 	Stex(aKey, aName), theCompoundPtr(aCompoundPtr) {
483 }
484 
aggr(const PhaseInfo & phase) const485 const TmSzStat *CompoundReplyStex::aggr(const PhaseInfo &phase) const {
486 	const CompoundXactStat &compound = phase.stats().*theCompoundPtr;
487 	theStat = TmSzStat(compound.duration.stats(), compound.repSize.stats());
488 	return &theStat;
489 }
490 
partsHist(const PhaseInfo & phase) const491 const Histogram *CompoundReplyStex::partsHist(const PhaseInfo &phase) const {
492 	const CompoundXactStat &compound = phase.stats().*theCompoundPtr;
493 	return &compound.exchanges;
494 }
495 
describe(XmlNodes & nodes) const496 void CompoundReplyStex::describe(XmlNodes &nodes) const {
497 	Stex::describe(nodes);
498 }
499 
500 
501 /* CompoundRequestStex */
502 
CompoundRequestStex(const String & aKey,const String & aName,const CompoundPtr aCompoundPtr)503 CompoundRequestStex::CompoundRequestStex(const String &aKey, const String &aName, const CompoundPtr aCompoundPtr):
504 	Stex(aKey, aName), theCompoundPtr(aCompoundPtr) {
505 }
506 
aggr(const PhaseInfo & phase) const507 const TmSzStat *CompoundRequestStex::aggr(const PhaseInfo &phase) const {
508 	const CompoundXactStat &compound = phase.stats().*theCompoundPtr;
509 	theStat = TmSzStat(compound.duration.stats(), compound.reqSize.stats());
510 	return &theStat;
511 }
512 
partsHist(const PhaseInfo & phase) const513 const Histogram *CompoundRequestStex::partsHist(const PhaseInfo &phase) const {
514 	const CompoundXactStat &compound = phase.stats().*theCompoundPtr;
515 	return &compound.exchanges;
516 }
517 
describe(XmlNodes & nodes) const518 void CompoundRequestStex::describe(XmlNodes &nodes) const {
519 	Stex::describe(nodes);
520 }
521 
522 /* AllCompoundRepsStex */
523 
AllCompoundRepsStex(const String & aKey,const String & aName)524 AllCompoundRepsStex::AllCompoundRepsStex(const String &aKey, const String &aName):
525 	Stex(aKey, aName) {
526 }
527 
aggr(const PhaseInfo & phase) const528 const TmSzStat *AllCompoundRepsStex::aggr(const PhaseInfo &phase) const {
529 	theCompound.reset();
530 	phase.stats().compoundAll(theCompound);
531 	theStat = TmSzStat(theCompound.duration.stats(), theCompound.repSize.stats());
532 	return &theStat;
533 }
534 
partsHist(const PhaseInfo & phase) const535 const Histogram *AllCompoundRepsStex::partsHist(const PhaseInfo &phase) const {
536 	theCompound.reset();
537 	phase.stats().compoundAll(theCompound);
538 	return &theCompound.exchanges;
539 }
540 
describe(XmlNodes & nodes) const541 void AllCompoundRepsStex::describe(XmlNodes &nodes) const {
542 	Stex::describe(nodes);
543 }
544 
545 /* AllCompoundReqsStex */
546 
AllCompoundReqsStex(const String & aKey,const String & aName)547 AllCompoundReqsStex::AllCompoundReqsStex(const String &aKey, const String &aName):
548 	Stex(aKey, aName) {
549 }
550 
aggr(const PhaseInfo & phase) const551 const TmSzStat *AllCompoundReqsStex::aggr(const PhaseInfo &phase) const {
552 	theCompound.reset();
553 	phase.stats().compoundAll(theCompound);
554 	theStat = TmSzStat(theCompound.duration.stats(), theCompound.reqSize.stats());
555 	return &theStat;
556 }
557 
partsHist(const PhaseInfo & phase) const558 const Histogram *AllCompoundReqsStex::partsHist(const PhaseInfo &phase) const {
559 	theCompound.reset();
560 	phase.stats().compoundAll(theCompound);
561 	return &theCompound.exchanges;
562 }
563 
describe(XmlNodes & nodes) const564 void AllCompoundReqsStex::describe(XmlNodes &nodes) const {
565 	Stex::describe(nodes);
566 }
567 
568 
569 /* AuthIngStex */
570 
AuthIngStex(const String & aKey,const String & aName,const AuthPhaseStat::Scheme aScheme)571 AuthIngStex::AuthIngStex(const String &aKey, const String &aName, const AuthPhaseStat::Scheme aScheme):
572 	Stex(aKey, aName), theScheme(aScheme) {
573 }
574 
trace(const StatIntvlRec & rec) const575 const TmSzStat *AuthIngStex::trace(const StatIntvlRec &rec) const {
576 	return &rec.theAuth.getAuthIng(theScheme);
577 }
578 
describe(XmlNodes & nodes) const579 void AuthIngStex::describe(XmlNodes &nodes) const {
580 	Stex::describe(nodes);
581 }
582 
583 
584 /* AuthEdStex */
585 
AuthEdStex(const String & aKey,const String & aName,const AuthPhaseStat::Scheme aScheme)586 AuthEdStex::AuthEdStex(const String &aKey, const String &aName, const AuthPhaseStat::Scheme aScheme):
587 	Stex(aKey, aName), theScheme(aScheme) {
588 }
589 
trace(const StatIntvlRec & rec) const590 const TmSzStat *AuthEdStex::trace(const StatIntvlRec &rec) const {
591 	return &rec.theAuth.getAuthEd(theScheme);
592 }
593 
describe(XmlNodes & nodes) const594 void AuthEdStex::describe(XmlNodes &nodes) const {
595 	Stex::describe(nodes);
596 }
597 
598 
599 /* AllAuthIngStex */
600 
AllAuthIngStex(const String & aKey,const String & aName)601 AllAuthIngStex::AllAuthIngStex(const String &aKey, const String &aName):
602 	Stex(aKey, aName) {
603 }
604 
trace(const StatIntvlRec & rec) const605 const TmSzStat *AllAuthIngStex::trace(const StatIntvlRec &rec) const {
606 	theStat.reset();
607 	rec.theAuth.authIngAll(theStat);
608 	return &theStat;
609 }
610 
describe(XmlNodes & nodes) const611 void AllAuthIngStex::describe(XmlNodes &nodes) const {
612 	Stex::describe(nodes);
613 }
614 
615 
616 /* AllAuthEdStex */
617 
AllAuthEdStex(const String & aKey,const String & aName)618 AllAuthEdStex::AllAuthEdStex(const String &aKey, const String &aName):
619 	Stex(aKey, aName) {
620 }
621 
trace(const StatIntvlRec & rec) const622 const TmSzStat *AllAuthEdStex::trace(const StatIntvlRec &rec) const {
623 	theStat.reset();
624 	rec.theAuth.authEdAll(theStat);
625 	return &theStat;
626 }
627 
describe(XmlNodes & nodes) const628 void AllAuthEdStex::describe(XmlNodes &nodes) const {
629 	Stex::describe(nodes);
630 }
631 
632 
633 /* AllAuthStex */
634 
AllAuthStex(const String & aKey,const String & aName)635 AllAuthStex::AllAuthStex(const String &aKey, const String &aName):
636 	Stex(aKey, aName) {
637 }
638 
trace(const StatIntvlRec & rec) const639 const TmSzStat *AllAuthStex::trace(const StatIntvlRec &rec) const {
640 	theStat.reset();
641 	rec.theAuth.authIngAll(theStat);
642 	rec.theAuth.authEdAll(theStat);
643 	return &theStat;
644 }
645 
describe(XmlNodes & nodes) const646 void AllAuthStex::describe(XmlNodes &nodes) const {
647 	Stex::describe(nodes);
648 }
649 
650 
651 /* ProtoIntvlStex */
652 
ProtoIntvlStex(ProtoPtr aProto,const String & aKey,const String & aName)653 ProtoIntvlStex::ProtoIntvlStex(ProtoPtr aProto, const String &aKey,
654 	const String &aName): Stex(aKey, aName), theProto(aProto) {
655 }
656 
657 /* ProtoHitsStex */
658 
ProtoHitsStex(ProtoPtr aProto,const String & aKey,const String & aName)659 ProtoHitsStex::ProtoHitsStex(ProtoPtr aProto, const String &aKey, const String &aName):
660 	ProtoIntvlStex(aProto, aKey, aName) {
661 }
662 
trace(const StatIntvlRec & rec) const663 const TmSzStat *ProtoHitsStex::trace(const StatIntvlRec &rec) const {
664 	return &(rec.*theProto).doneXacts().hits();
665 }
666 
describe(XmlNodes & nodes) const667 void ProtoHitsStex::describe(XmlNodes &nodes) const {
668 	Stex::describe(nodes);
669 }
670 
671 
672 /* ProtoMissesStex */
673 
ProtoMissesStex(ProtoPtr aProto,const String & aKey,const String & aName)674 ProtoMissesStex::ProtoMissesStex(ProtoPtr aProto, const String &aKey, const String &aName):
675 	ProtoIntvlStex(aProto, aKey, aName) {
676 }
677 
trace(const StatIntvlRec & rec) const678 const TmSzStat *ProtoMissesStex::trace(const StatIntvlRec &rec) const {
679 	return &(rec.*theProto).doneXacts().misses();
680 }
681 
describe(XmlNodes & nodes) const682 void ProtoMissesStex::describe(XmlNodes &nodes) const {
683 	Stex::describe(nodes);
684 }
685 
686 
687 /* ProtoHitMissesStex */
688 
ProtoHitMissesStex(ProtoPtr aProto,const String & aKey,const String & aName)689 ProtoHitMissesStex::ProtoHitMissesStex(ProtoPtr aProto, const String &aKey, const String &aName):
690 	ProtoIntvlStex(aProto, aKey, aName) {
691 }
692 
trace(const StatIntvlRec & rec) const693 const TmSzStat *ProtoHitMissesStex::trace(const StatIntvlRec &rec) const {
694 	theAggr = (rec.*theProto).doneXacts().xacts();
695 	return &theAggr;
696 }
697 
describe(XmlNodes & nodes) const698 void ProtoHitMissesStex::describe(XmlNodes &nodes) const {
699 	Stex::describe(nodes);
700 }
701 
702 
703 /* CookiesStex */
704 
CookiesStex(const String & aKey,const String & aName,const AggrPtr anAggrPtr)705 CookiesStex::CookiesStex(const String &aKey, const String &aName, const AggrPtr anAggrPtr):
706 	Stex(aKey, aName), theAggrPtr(anAggrPtr) {
707 }
708 
partsStat(const PhaseInfo & phase) const709 const AggrStat *CookiesStex::partsStat(const PhaseInfo &phase) const {
710 	return &(phase.stats().*theAggrPtr);
711 }
712 
describe(XmlNodes & nodes) const713 void CookiesStex::describe(XmlNodes &nodes) const {
714 	Stex::describe(nodes);
715 }
716 
717 
718 /* AllStatusCodeStex */
719 
AllStatusCodeStex(const String & aKey,const String & aName,const StatusCodePtr aPtr)720 AllStatusCodeStex::AllStatusCodeStex(const String &aKey, const String &aName, const StatusCodePtr aPtr):
721 	Stex(aKey, aName), thePtr(aPtr) {
722 	Assert(thePtr);
723 	doIgnoreUnseen = true;
724 }
725 
aggr(const PhaseInfo & phase) const726 const TmSzStat *AllStatusCodeStex::aggr(const PhaseInfo &phase) const {
727 	theAggr = (phase.stats().*thePtr).allStats();
728 	return &theAggr;
729 }
730 
describe(XmlNodes & nodes) const731 void AllStatusCodeStex::describe(XmlNodes &nodes) const {
732 	Stex::describe(nodes);
733 }
734 
735 
736 /* StatusCodeStex */
737 
StatusCodeStex(const String & aKey,const String & aName,const StatusCodePtr aPtr,const int aStatus)738 StatusCodeStex::StatusCodeStex(const String &aKey, const String &aName, const StatusCodePtr aPtr, const int aStatus):
739 	Stex(aKey, aName), thePtr(aPtr), theStatus(aStatus) {
740 	Assert(thePtr);
741 	doIgnoreUnseen = true;
742 }
743 
aggr(const PhaseInfo & phase) const744 const TmSzStat *StatusCodeStex::aggr(const PhaseInfo &phase) const {
745 	return (phase.stats().*thePtr).stats(theStatus);
746 }
747 
describe(XmlNodes & nodes) const748 void StatusCodeStex::describe(XmlNodes &nodes) const {
749 	Stex::describe(nodes);
750 }
751