Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@emelyanovtv
Copy link
Contributor

No description provided.

@emelyanovtv emelyanovtv force-pushed the profiler-metrics branch 3 times, most recently from 0b643d0 to b27782f Compare July 22, 2016 11:36
@emelyanovtv
Copy link
Contributor Author

@blond review plz

@anton-rudeshko
Copy link

Разве это не должно называться html rerport for profiler?

@emelyanovtv
Copy link
Contributor Author

почему ? там html даже и не пахнет =)

@anton-rudeshko
Copy link

Ой, да, в смысле, console reporter :)

if (a > b) return 1;
if (a < b) return -1;

return 0;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Просто { return a - b; }

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@emelyanovtv emelyanovtv force-pushed the profiler-metrics branch 2 times, most recently from 5371d06 to 2a28b4a Compare July 29, 2016 09:29

module.exports = function (printData) {
var printTable = new Table({
head: ['Tech Name', 'Number of calls', 'Time spend (%)', 'Percentile 95']
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Percentile 95

ms?

Copy link
Contributor

@qfox qfox Aug 9, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

['Tech', '×', 'Elapsed', 'P95'] ?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

И легенду снизу, если нужно, что есть что

@blond
Copy link
Member

blond commented Aug 9, 2016

Тут ещё появилось предложение enb make --profiler=targets|techs.

Если --profiler=techs то как сейчас.

Если --profiler=targets, то выводить таблицу из buildTimes.

По умолчанию tech.

lib/cli/make.js Outdated

make(args, cmd)
.then(function (data) {
if (cmd.profiler) return printProfiler(data.metricsInfo);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why return?

@emelyanovtv emelyanovtv force-pushed the profiler-metrics branch 5 times, most recently from 555079d to 40f5aca Compare August 15, 2016 11:59
@emelyanovtv emelyanovtv force-pushed the profiler-metrics branch 2 times, most recently from ec37e94 to 969fbc6 Compare August 15, 2016 15:59
@emelyanovtv
Copy link
Contributor Author

/ping

var Table = require('cli-table');

module.exports = {
showForTechs: function (printData) {
Copy link
Member

@blond blond Aug 16, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

printTechTable?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

блин, как-то странно, мне просто сочетание не нравится. Сейчас так printProfiler.showForTechs
, а будет printProfiler. printTechTable . print*.print смущает (

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Можешь назвать profilerUI ;)

@blond
Copy link
Member

blond commented Aug 16, 2016

Ещё бы конечно тестов для вычислений, но да ладно.

@emelyanovtv emelyanovtv force-pushed the profiler-metrics branch 3 times, most recently from a672b50 to 7e50d98 Compare August 16, 2016 10:14
@emelyanovtv
Copy link
Contributor Author

/ping

@blond
Copy link
Member

blond commented Aug 16, 2016

Я тут собрал project-stub с enb make --profiler=targets и увидел:

Target Self time Wating time Total time
desktop.bundles/index/index.bemdecl.js 62 -5 57

Время ожидания -5 ms как-то смущает :)

@@ -0,0 +1,38 @@
var _ = require('lodash');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Можно прям файл переименовать в profiler-ur.

@emelyanovtv
Copy link
Contributor Author

emelyanovtv commented Aug 16, 2016

на счёт project-stub, может кеш? я такого не встречал =(

_.map(printData, function (targetInfo) {
printTable.push([
targetInfo.target,
targetInfo.selfTime,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Сейчас из вывода не понятно что это ms. Давай сделаем человекопонятно:

const prettyMs = require('pretty-ms');

prettyMs(targetInfo.selfTime);
prettyMs(targetInfo.watingTime);
prettyMs(targetInfo.totalTime);

@blond
Copy link
Member

blond commented Aug 16, 2016

Время ожидания -5 ms как-то смущает :)

Кейс такой: зависимость у таргета есть, но она отрабатывает раньше, чем технология сборка текущего таргета начинается.

Где-то после надо добавить условие

if (depEndTime < targetStartTime) {
    selfTime = targetEndTime - targetStartTime;
}

@emelyanovtv emelyanovtv force-pushed the profiler-metrics branch 2 times, most recently from f2a7ccf to 6428caa Compare August 16, 2016 11:58
package.json Outdated
"inherit": "2.2.4",
"lodash": "4.13.1",
"percentile": "1.1.0",
"pretty-ms": "^2.1.0",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

точная зависимость

@emelyanovtv
Copy link
Contributor Author

/done

@blond
Copy link
Member

blond commented Aug 16, 2016

enb make --profiler

2016-08-16 15 07 31

enb make --profiler=targets

2016-08-16 15 08 56

buildTimePercent: _this.getBuildTimePercent(metrics.buildTime, totalTime)
};
},
'buildTimePercent'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

И ещё лучше сортировать по времени, а не по проценту. Тогда с разным временем, но одинаковым процентом будут правильно отсортированы.

Т.е. по metrics.buildTime

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

а какая разница ?=)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Мы проценты округляем, в секундах они могут отличаться.

@blond blond merged commit 2c8b64c into enb:master Aug 16, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants