getColor(span) { let c = kleur.bold; if (span.tags.fromCache) c = c().yellow; if (span.tags.remoteCall) c = c().cyan; if (span.duration == null) c = c().grey; if (span.error) c = c().red; return c; }
/** * @param {Mocha.Test} test */ failed(test) { print(` ${colors.red.bold(figures.cross)} ${test.title} ${colors.grey(`in ${test.duration}ms`)}`); }
constructor(settings = {}) { this.duration = settings.duration || 60000; this.transactionsPerRun = settings.transactionsPerRun || 1; this.algorithms = []; }
db.task(t => { const d: Date = t.ctx.start; const duration: number = t.ctx.duration; const parentTag = t.ctx.parent.tag; const connected: boolean = t.ctx.connected; return t.batch([]); });
// Handles a click or drag to scrub (jump to another position in the video) function handleScrub (e) { if (!e.clientX) return dispatch('mediaMouseMoved') const windowWidth = document.querySelector('body').clientWidth const fraction = e.clientX / windowWidth const position = fraction * state.playing.duration /* seconds */ dispatch('skipTo', position) }
setTimeout(() => { animation.stop(); }, cli.flags.duration);
runner.on( 'end', function () { var stats = reporter.stats; if ( stats.failures ) { var msg = stats.failures + ' of ' + runner.total + ' tests failed'; notify( msg, { name: 'mocha', title: 'Failed', image: image( 'error' ) } ); } else { notify( stats.passes + ' tests passed in ' + stats.duration + 'ms', { name: 'mocha', title: 'Passed', image: image( 'ok' ), } ); } } );
add(alert) { alert.duration = alert.duration || DEFAULT_DURATION; alert.id = alert.id || Date.now(); if (alert.accumulation) { this.accumulate(alert); } this.scheduleCleanse(alert); this.alerts[alert.id] = alert; this.emit(EventTypes.ALERTS_CHANGE); }
function runBenchmark(name, start, done, array) { start(new Timer(function () { var total = 0; array.push(this.events[this.events.length - 1].duration); if (array.length === cycles) { array.forEach(function (duration) { total += duration; }); console.log("Timing (" + name + "): " + (total / array.length) + 'ms'); done(); } else { runBenchmark(name, start, done, array); } }), server.url); }
/** * @param {Mocha.Test} test */ passed(test) { print(` ${colors.green.bold(`${figures.tick} OK`)} ${colors.grey(`in ${test.duration}ms`)}`); print(); }
static validateAccountLockoutPolicy(accountLockout) { if (accountLockout) { if (typeof accountLockout.duration !== 'number' || accountLockout.duration <= 0 || accountLockout.duration > 99999) { throw 'Account lockout duration should be greater than 0 and less than 100000'; } if (!Number.isInteger(accountLockout.threshold) || accountLockout.threshold < 1 || accountLockout.threshold > 999) { throw 'Account lockout threshold should be an integer greater than 0 and less than 1000'; } } }
scheduleCleanse(alert) { setTimeout(this.removeExpired.bind(this, alert), alert.duration); }
/** * @param {Mocha.Test} test */ passed(test) { print(` ${colors.green.bold(figures.tick)} ${test.title} ${colors.grey(`in ${test.duration}ms`)}`); }
/** * @param {Mocha.Test} test */ failed(test) { print(` ${colors.red.bold(`${figures.cross} FAILED`)} ${colors.grey(`in ${test.duration}ms`)}`); print(); }