study-node/boomerang/plugins/continuity.js
/**
		 * Each reporting interval, log page busy
		 */
Each reporting interval, log page busy
Each reporting interval log page busy
function onReport() {
			var reportTime = t.getTimeBucket();
			var curTime = reportTime;
			var missedReports = 0;
			if (total === 0) {
				return;
			}
			while (total > (POLLS_PER_REPORT + 1) &&
			       missedReports <= MAX_MISSED_REPORTS) {
				t.set("busy", 100, --curTime);
				total -= POLLS_PER_REPORT;
				late   = Math.max(late - POLLS_PER_REPORT, 0);
				overallTotal += POLLS_PER_REPORT;
				overallLate += POLLS_PER_REPORT;
				missedReports++;
			}
			overallTotal += total;
			overallLate += late;
			t.set("busy", Math.ceil(late / total * 100), reportTime);
			total = 0;
			late = 0;
		}
function onReport ( ) { var reportTime = t . getTimeBucket ( ) ; var curTime = reportTime ; var missedReports = 0 ; if ( total === 0 ) { return ; } while ( total > ( POLLS_PER_REPORT + 1 ) && missedReports <= MAX_MISSED_REPORTS ) { t . set ( "busy" , 100 , -- curTime ) ; total -= POLLS_PER_REPORT ; late = Math . max ( late - POLLS_PER_REPORT , 0 ) ; overallTotal += POLLS_PER_REPORT ; overallLate += POLLS_PER_REPORT ; missedReports ++ ; } overallTotal += total ; overallLate += late ; t . set ( "busy" , Math . ceil ( late / total * 100 ) , reportTime ) ; total = 0 ; late = 0 ; }
Each reporting interval, log page busy
Each reporting interval log page busy
// if we had more polls than we expect in each // collection period (we allow one extra for wiggle room), we // must not have been able to report, so assume those periods were 100% // reset the period by one // this was a busy period // update the total stats // reset stats