Index: DLog.cc =================================================================== RCS file: /surf1/CVS/polygraph/src/DLog.cc,v retrieving revision 1.4 retrieving revision 1.4.2.1 diff -u -r1.4 -r1.4.2.1 --- DLog.cc 1999/05/24 17:41:39 1.4 +++ DLog.cc 1999/07/29 19:04:39 1.4.2.1 @@ -1,6 +1,6 @@ /* - * $Id: DLog.cc,v 1.4 1999/05/24 17:41:39 rousskov Exp $ + * $Id: DLog.cc,v 1.4.2.1 1999/07/29 19:04:39 rousskov Exp $ * * * Web Polygraph http://www.ircache.net/Polygraph/ @@ -31,8 +31,7 @@ #include "LogMeta.h" #include "DLog.h" -//#include "logTags.h" -//#include "gadgets.h" + /* DLog */ @@ -99,16 +98,32 @@ void DLog::noteRec(const StatPingRec &rec) { if (thePingFilter) { - thePingRec = &rec; - (*thePingFilter)(*this); - thePingRec = 0; + thePingRecAcc += rec; + if (theCutter.update(theProgress.theDuration)) + pushAccStats(); } } void DLog::noteRec(const StatSoftRec &rec) { if (theSoftFilter) { - theSoftRec = &rec; + theSoftRecAcc += rec; + if (theCutter.update(theProgress.theDuration)) + pushAccStats(); + } +} + +void DLog::pushAccStats() { + if (thePingFilter) { + thePingRec = &thePingRecAcc; + (*thePingFilter)(*this); + thePingRec = 0; + thePingRecAcc.restart(); + } + + if (theSoftFilter) { + theSoftRec = &theSoftRecAcc; (*theSoftFilter)(*this); theSoftRec = 0; + theSoftRecAcc.restart(); } } Index: Histogram.cc =================================================================== RCS file: /surf1/CVS/polygraph/src/Histogram.cc,v retrieving revision 1.4 retrieving revision 1.4.2.1 diff -u -r1.4 -r1.4.2.1 --- Histogram.cc 1999/05/21 16:55:38 1.4 +++ Histogram.cc 1999/07/29 19:01:40 1.4.2.1 @@ -1,6 +1,6 @@ /* - * $Id: Histogram.cc,v 1.4 1999/05/21 16:55:38 rousskov Exp $ + * $Id: Histogram.cc,v 1.4.2.1 1999/07/29 19:01:40 rousskov Exp $ * * * Web Polygraph http://www.ircache.net/Polygraph/ @@ -53,7 +53,7 @@ void Histogram::reset() { theStats.reset(); theBins.memset(0); - theValMin = theValMax = -1; + // do not reset 'limits' } void Histogram::record(Val v) { @@ -64,9 +64,13 @@ } void Histogram::add(const Histogram &h) { + // XXX: workaround the old logging bug where we reset + // theValMin and theValMax to -1 on restart + // remove "-1" clauses when log format is fixed + // histograms must have identical structure - Assert(theValMin == h.theValMin); - Assert(theValMax == h.theValMax); + Assert(theValMin == h.theValMin || h.theValMin == -1); + Assert(theValMax == h.theValMax || h.theValMax == -1); Assert(theBinMax == h.theBinMax); Assert(theBins.count() == h.theBins.count()); Index: IntvlCut.cc =================================================================== RCS file: IntvlCut.cc diff -N IntvlCut.cc --- /dev/null Wed Aug 11 16:04:32 1999 +++ /var/tmp/aaaa006o0 Wed Aug 11 16:20:31 1999 @@ -0,0 +1,66 @@ + +/* + * $Id: IntvlCut.cc,v 1.1.2.1 1999/07/29 19:04:40 rousskov Exp $ + * + * + * Web Polygraph http://www.ircache.net/Polygraph/ + * ---------------------------------------------------------- + * + * Web Polygraph is copyrighted(C) 1998 by Alex Rousskov and + * the University of California, San Diego (UCSD), with all + * rights reserved. Development is funded by the National Science + * Foundation (NLANR Cache grants NCR 9616602 and NCR 9521745). + * Please see the COPYRIGHT file for full details. + * + * Web Polygraph is free software. You may copy and distribute + * VERBATIM copies of this product. You may modify your copy + * for your own use. You must NOT distribute modified copies. + * + * If you publish any materials derived from or related to + * Web Polygraph, you must give a credit reference to the + * National Science Foundation and the National Laboratory + * for Applied Network Research. + * + * This program is distributed WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. + * + */ + +#include "polygraph.h" + +#include "IntvlCut.h" + + +IntervalCutter::IntervalCutter() { +} + +void IntervalCutter::configure(Time anIntvl) { + Assert(anIntvl != 0); + theIntvl = anIntvl; +} + +bool IntervalCutter::update(Time curTime) { + Assert(curTime >= 0); + + // if the cutter is disabled, always return true + if (theIntvl < 0) { + theEoi = curTime; + return true; + } + + if (theEoi < 0) + theEoi = curTime; + else + if (curTime > theEoi + theIntvl) { + // note: we use (a,b] interval to ensure that + // if two events happen at the same time, they + // always end up in the same interval! + do { + theEoi += theIntvl; + } while (curTime >= theEoi + theIntvl); + return true; + } + + return false; +} Index: Makefile =================================================================== RCS file: /surf1/CVS/polygraph/src/Attic/Makefile,v retrieving revision 1.60.2.9 retrieving revision 1.60.2.11 diff -u -r1.60.2.9 -r1.60.2.11 --- Makefile 1999/06/16 05:45:02 1.60.2.9 +++ Makefile 1999/07/29 19:05:23 1.60.2.11 @@ -1,5 +1,5 @@ -# $Id: Makefile,v 1.60.2.9 1999/06/16 05:45:02 rousskov Exp $ +# $Id: Makefile,v 1.60.2.11 1999/07/29 19:05:23 rousskov Exp $ # correctly installed g++ is able to guess all header locations, but # set STD_INCLUDE if your compiler cannot find standard include files @@ -95,6 +95,7 @@ LX_OBJO = \ $(COMMON_OBJO) \ DLog.o \ + IntvlCut.o \ ilog2dlog.o \ lx.o @@ -1227,6 +1228,9 @@ DLog.o: include/Histogram.h xstd/include/Array.h include/AggrStat.h DLog.o: include/OLog.h xstd/include/NetDouble.h include/ILog.h DLog.o: include/Progress.h xstd/include/Clock.h xstd/include/gadgets.h +DLog.o: include/IntvlCut.h +IntvlCut.o: include/polygraph.h include/config.h xstd/include/Time.h +IntvlCut.o: xstd/include/Size.h xstd/include/Assert.h include/IntvlCut.h ilog2dlog.o: include/polygraph.h include/config.h xstd/include/Time.h ilog2dlog.o: xstd/include/Size.h xstd/include/Assert.h include/ILog.h ilog2dlog.o: xstd/include/NetDouble.h xstd/include/String.h @@ -1235,7 +1239,7 @@ ilog2dlog.o: include/StatPing.h xstd/include/BigSize.h include/LevelStat.h ilog2dlog.o: include/StatInt.h include/StatSoft.h include/histograms.h ilog2dlog.o: include/Histogram.h include/AggrStat.h include/OLog.h -ilog2dlog.o: xstd/include/gadgets.h +ilog2dlog.o: xstd/include/gadgets.h include/IntvlCut.h lx.o: include/polygraph.h include/config.h xstd/include/Time.h lx.o: xstd/include/Size.h xstd/include/Assert.h include/Opt.h lx.o: xstd/include/String.h xstd/include/Array.h include/opts.h @@ -1245,8 +1249,9 @@ lx.o: include/histograms.h include/Histogram.h include/AggrStat.h lx.o: include/OLog.h xstd/include/NetDouble.h include/ILog.h lx.o: include/LogMeta.h xstd/include/gadgets.h include/StatPhase.h -lx.o: include/DLog.h include/polyErrors.h include/ErrorMgr.h -lx.o: include/ilog2dlog.h include/globals.h xstd/include/LibInit.h +lx.o: include/DLog.h include/IntvlCut.h include/polyErrors.h +lx.o: include/ErrorMgr.h include/ilog2dlog.h include/globals.h +lx.o: xstd/include/LibInit.h AggrStat.o: include/polygraph.h include/config.h xstd/include/Time.h AggrStat.o: xstd/include/Size.h xstd/include/Assert.h include/ILog.h AggrStat.o: xstd/include/NetDouble.h xstd/include/String.h Index: ilog2dlog.cc =================================================================== RCS file: /surf1/CVS/polygraph/src/ilog2dlog.cc,v retrieving revision 1.5 retrieving revision 1.5.2.1 diff -u -r1.5 -r1.5.2.1 --- ilog2dlog.cc 1999/05/27 04:38:49 1.5 +++ ilog2dlog.cc 1999/08/11 22:04:32 1.5.2.1 @@ -1,6 +1,6 @@ /* - * $Id: ilog2dlog.cc,v 1.5 1999/05/27 04:38:49 rousskov Exp $ + * $Id: ilog2dlog.cc,v 1.5.2.1 1999/08/11 22:04:32 rousskov Exp $ * * * Web Polygraph http://www.ircache.net/Polygraph/ @@ -81,8 +81,10 @@ } // XXX: kludge, should maintain these in PhaseRec - dl.theErrCnt = il.progress().theErrs.theCnt; - dl.theNonErrCnt = il.progress().theXactComplCnt; + if (dl.theErrCnt < 0) + dl.theErrCnt = dl.theNonErrCnt = 0; + dl.theErrCnt += il.progress().theErrs.theCnt; + dl.theNonErrCnt += il.progress().theXactComplCnt; } else if (prefix.theTag == cmntTag) { String s; Index: lx.cc =================================================================== RCS file: /surf1/CVS/polygraph/src/lx.cc,v retrieving revision 1.7.2.2 retrieving revision 1.7.2.3 diff -u -r1.7.2.2 -r1.7.2.3 --- lx.cc 1999/06/15 23:19:27 1.7.2.2 +++ lx.cc 1999/07/29 19:04:42 1.7.2.3 @@ -1,6 +1,6 @@ /* - * $Id: lx.cc,v 1.7.2.2 1999/06/15 23:19:27 rousskov Exp $ + * $Id: lx.cc,v 1.7.2.3 1999/07/29 19:04:42 rousskov Exp $ * * * Web Polygraph http://www.ircache.net/Polygraph/ @@ -59,7 +59,7 @@ theOutFileName(this, "out ", "redirect console output", "-"), thePhaseName(this, "phase ", "phase name: warm|meas|cold", "meas"), theObjects(this, "objects ","names of objects to extract"), - printTrace(this, "prn_trace ", "print run-time stats (rather than totals)", false), + printTrace(this, "trace