Include memory usage in -diagnostics report
This commit is contained in:
parent
2a106bf923
commit
4d62b488b7
2 changed files with 7 additions and 1 deletions
|
@ -234,7 +234,9 @@ var sys: System = (function () {
|
||||||
return (<any>process).cwd();
|
return (<any>process).cwd();
|
||||||
},
|
},
|
||||||
getMemoryUsage() {
|
getMemoryUsage() {
|
||||||
global.gc();
|
if (global.gc) {
|
||||||
|
global.gc();
|
||||||
|
}
|
||||||
return process.memoryUsage().heapUsed;
|
return process.memoryUsage().heapUsed;
|
||||||
},
|
},
|
||||||
exit(exitCode?: number): void {
|
exit(exitCode?: number): void {
|
||||||
|
|
|
@ -337,12 +337,16 @@ module ts {
|
||||||
|
|
||||||
reportDiagnostics(errors);
|
reportDiagnostics(errors);
|
||||||
if (commandLine.options.diagnostics) {
|
if (commandLine.options.diagnostics) {
|
||||||
|
var memoryUsed = sys.getMemoryUsage();
|
||||||
reportCountStatistic("Files", program.getSourceFiles().length);
|
reportCountStatistic("Files", program.getSourceFiles().length);
|
||||||
reportCountStatistic("Lines", countLines(program));
|
reportCountStatistic("Lines", countLines(program));
|
||||||
reportCountStatistic("Nodes", checker ? checker.getNodeCount() : 0);
|
reportCountStatistic("Nodes", checker ? checker.getNodeCount() : 0);
|
||||||
reportCountStatistic("Identifiers", checker ? checker.getIdentifierCount() : 0);
|
reportCountStatistic("Identifiers", checker ? checker.getIdentifierCount() : 0);
|
||||||
reportCountStatistic("Symbols", checker ? checker.getSymbolCount() : 0);
|
reportCountStatistic("Symbols", checker ? checker.getSymbolCount() : 0);
|
||||||
reportCountStatistic("Types", checker ? checker.getTypeCount() : 0);
|
reportCountStatistic("Types", checker ? checker.getTypeCount() : 0);
|
||||||
|
if (memoryUsed) {
|
||||||
|
reportStatisticalValue("Memory used", Math.round(memoryUsed / 1000) + "K");
|
||||||
|
}
|
||||||
reportTimeStatistic("Parse time", bindStart - parseStart);
|
reportTimeStatistic("Parse time", bindStart - parseStart);
|
||||||
reportTimeStatistic("Bind time", checkStart - bindStart);
|
reportTimeStatistic("Bind time", checkStart - bindStart);
|
||||||
reportTimeStatistic("Check time", emitStart - checkStart);
|
reportTimeStatistic("Check time", emitStart - checkStart);
|
||||||
|
|
Loading…
Reference in a new issue