Skip to content

Commit eeeaebd

Browse files
authored
only make issue reporter link for slow renderer times (microsoft#259103)
1 parent 895f281 commit eeeaebd

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/vs/workbench/contrib/notebook/browser/contrib/cellStatusBar/executionStatusBarItemController.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -314,12 +314,17 @@ class TimerCellStatusBarItem extends Disposable {
314314
const args = encodeURIComponent(JSON.stringify({
315315
extensionId: rendererInfo?.extensionId.value ?? '',
316316
issueBody:
317-
`Auto-generated text from notebook cell performance. The duration for the renderer, ${rendererInfo?.displayName ?? key}, is slower than expected.\n` +
317+
`Auto-generated text from notebook cell performance - Please add an explanation for the performance issue, including cell content if possible.\n` +
318+
`The duration for the renderer, ${rendererInfo?.displayName ?? key}, is slower than expected.\n` +
318319
`Execution Time: ${formatCellDuration(executionDuration)}\n` +
319320
`Renderer Duration: ${formatCellDuration(renderDuration[key])}\n`
320321
}));
321322

322-
renderTimes += `- [${rendererInfo?.displayName ?? key}](command:workbench.action.openIssueReporter?${args}) ${formatCellDuration(renderDuration[key])}\n`;
323+
// Show a link to create an issue if the renderer was slow compared to the execution duration, or just exceptionally slow on its own
324+
const renderIssueLink = (renderDuration[key] > 200 && executionDuration < 2000) || renderDuration[key] > 1000;
325+
const linkText = rendererInfo?.displayName ?? key;
326+
const rendererTitle = renderIssueLink ? `[${linkText}](command:workbench.action.openIssueReporter?${args})` : `**${linkText}**`;
327+
renderTimes += `- ${rendererTitle} ${formatCellDuration(renderDuration[key])}\n`;
323328
}
324329

325330
renderTimes += `\n*${localize('notebook.cell.statusBar.timerTooltip.reportIssueFootnote', "Use the links above to file an issue using the issue reporter.")}*\n`;

0 commit comments

Comments
 (0)