finished thresholds

This commit is contained in:
Igor Klopov 2016-08-18 20:20:18 +03:00
parent 565fab253a
commit ef69cb2760
2 changed files with 32 additions and 6 deletions

View File

@ -4,7 +4,7 @@ import fs from 'fs';
import log from './log.js';
const MAX_LINES = 20;
const DEBUG = false;
const DEBUG_THRESHOLDS = true;
function errorLines (lines) {
return lines.slice(-MAX_LINES)
@ -26,7 +26,7 @@ export function spawn (cmd, args, opts) {
if (data.indexOf(key) >= 0) {
const p = thresholds[key];
log.showProgress(p + '%', p / 100);
if (DEBUG) {
if (DEBUG_THRESHOLDS) {
lines.push([ time, '************' ]);
lines.push([ time, p + ': ' + key ]);
lines.push([ time, '************' ]);
@ -66,7 +66,7 @@ export function progress (promise, thresholds) {
const start = (new Date()).getTime();
const { child, lines } = promise;
child.on('close', () => {
if (DEBUG) {
if (DEBUG_THRESHOLDS) {
const finish = (new Date()).getTime();
const content = lines.map((line) =>
((100 * (line[0] - start) / (finish - start)) | 0) + ': ' + line[1]

View File

@ -40,9 +40,35 @@ export default function thresholds (cmd, nodeVersion) {
}
} else
if (cmd === 'make') {
return {
'v8_base/deps/v8/src/date.o.d.raw': 50
};
if (/^v?0/.test(nodeVersion)) {
return {
'openssl/crypto/ex_data.o.d.raw': 10, 'v8/src/api.o.d.raw': 20,
'v8/src/compiler/js-graph.o.d.raw': 30, 'v8/src/debug.o.d.raw': 40,
'v8/src/heap/spaces.o.d.raw': 50, 'v8/src/hydrogen-sce.o.d.raw': 60,
'v8/src/parser.o.d.raw': 70, 'v8/src/token.o.d.raw': 80,
'v8/src/x64/stub-cache-x64.o.d.raw': 90
}
} else
if (/^v?4/.test(nodeVersion)) {
return {
'v8/src/compiler/code-generator.o.d.raw': 10, 'v8/src/compiler/operator.o.d.raw': 20,
'v8/src/factory.o.d.raw': 30, 'v8/src/hydrogen.o.d.raw': 40,
'v8/src/liveedit.o.d.raw': 50, 'v8/src/runtime/runtime-function.o.d.raw': 60,
'v8/src/v8.o.d.raw': 70, 'v8_nosnapshot/gen/libraries.o.d.raw': 80,
'openssl/crypto/ex_data.o.d.raw': 90
};
} else
if (/^v?6/.test(nodeVersion)) {
return {
'icuucx/deps/icu-small/source/common/parsepos.o.d.raw': 10, 'v8/src/api.o.d.raw': 20,
'v8/src/compiler/graph-replay.o.d.raw': 30, 'v8/src/compiler.o.d.raw': 40,
'v8/src/date.o.d.raw': 50, 'v8/src/isolate.o.d.raw': 60,
'v8/src/runtime/runtime-function.o.d.raw': 70, 'v8/src/x64/assembler-x64.o.d.raw': 80,
'icui18n/deps/icu-small/source/i18n/search.o.d.raw': 90
};
} else {
return {};
}
} else {
assert(false);
}