Skip to content

Commit

Permalink
fix: add graph conversion while pruning duration analytics
Browse files Browse the repository at this point in the history
  • Loading branch information
orsagie committed Nov 25, 2020
1 parent f9867eb commit 0894113
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/lib/prune.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,17 @@ export async function pruneGraph(
analytics.add('prePrunedPathsCount', prePrunePathsCount);
if (isDenseGraph || pruneIsRequired) {
debug('Trying to prune the graph');
const pruneStartTime = Date.now();
const prunedTree = (await graphToDepTree(depGraph, packageManager, {
deduplicateWithinTopLevelDeps: true,
})) as DepTree;
const graphToTreeEndTime = Date.now();
analytics.add(
'prune.graphToTreeDuration',
graphToTreeEndTime - pruneStartTime,
);
const prunedGraph = await depTreeToGraph(prunedTree, packageManager);
analytics.add('prune.treeToGraphDuration', Date.now() - graphToTreeEndTime);
const postPrunePathsCount = countPathsToGraphRoot(prunedGraph);
analytics.add('postPrunedPathsCount', postPrunePathsCount);
debug('postPrunePathsCount' + postPrunePathsCount);
Expand Down

0 comments on commit 0894113

Please sign in to comment.