Unnamed: 0
int64
0
305k
body
stringlengths
7
52.9k
name
stringlengths
1
185
7,600
void (@Nullable PlaybackContext context, String text, Type type) { if (type == Type.error) { LOG.error(text); } else { LOG.info(text); } }
message
7,601
void (Project project, CompletableFuture<?> callback) { EP_NAME.getExtensionList().forEach(extension -> extension.patchCommandCallback(project, callback) ); }
applyPatchesToCommandCallback
7,602
void () { performanceTestSpan = TRACER.spanBuilder(SPAN_NAME).setNoParent().startSpan(); performanceScope = performanceTestSpan.makeCurrent(); }
startSpan
7,603
void () { if (performanceScope != null) performanceScope.close(); if (performanceTestSpan != null) performanceTestSpan.end(); }
endSpan
7,604
Context () { if (performanceTestSpan != null) return Context.current().with(performanceTestSpan); return Context.current(); }
getContext
7,605
IJTracer (boolean noopTracer) { return noopTracer ? WARMUP_TRACER : TRACER; }
getTracer
7,606
Span (@NotNull String name, @NotNull Attributes attributes) { return span.addEvent(name, attributes); }
addEvent
7,607
Span (@NotNull String name, @NotNull Attributes attributes, long timestamp, @NotNull TimeUnit unit) { return span.addEvent(name, attributes, timestamp, unit); }
addEvent
7,608
Span (@NotNull StatusCode statusCode, @NotNull String description) { return span.setStatus(statusCode, description); }
setStatus
7,609
Span (@NotNull Throwable exception, @NotNull Attributes additionalAttributes) { return span.recordException(exception, additionalAttributes); }
recordException
7,610
Span (@NotNull String name) { return span.updateName(name); }
updateName
7,611
void () { listener.onEnd(this); span.end(); }
end
7,612
void (long timestamp, @NotNull TimeUnit unit) { listener.onEnd(this); span.end(timestamp, unit); }
end
7,613
SpanContext () { return span.getSpanContext(); }
getSpanContext
7,614
boolean () { return span.isRecording(); }
isRecording
7,615
void () { }
activityFinished
7,616
ActivityTracker (@NotNull Supplier<@NotNull @NlsSafe String> debugMessageProducer) { if (disabledOutsideIntegrationTests) return dumbTracker; long keyNumber = keyNumberCounter.getAndIncrement(); synchronized (LOCK) { activities.put(keyNumber, debugMessageProducer); } return new MyActivityTracker(keyNumber); }
registerBeginningOfInitializationActivity
7,617
boolean () { if (disabledOutsideIntegrationTests) return true; if (!StartupManager.getInstance(myProject).postStartupActivityPassed()) { LOG.info("Project startup activities are not finished yet."); return false; } Supplier<@NotNull @NlsSafe String> nextMessage; synchronized (LOCK) { if (activities.isEmpty()) return tr...
isProjectInitializationAndIndexingFinished
7,618
void () { synchronized (LOCK) { activities.remove(code); } }
activityFinished
7,619
void (Project project, CompletableFuture<?> callback) { }
patchCommandCallback
7,620
void () { try { if (isProfilingEnabled()) { PropertiesComponent.getInstance(project).setValue(PROFILE_INDEXING_COMPONENT, false); PropertiesComponent.getInstance(project).setValue(PROFILE_WITH_ASYNC, false); Profiler.getCurrentProfilerHandler(project).startProfiling(project.getName(), new ArrayList<>()); DumbService.ge...
enteredDumbMode
7,621
void (Project project) { DumbService.getInstance(project).smartInvokeLater(() -> myAlarm.addRequest(() -> { if (DumbService.isDumb(project)) { runScriptAfterDumb(project); } else { ProfilersController.getInstance(); if (Profiler.isAnyProfilingStarted()) { try { ProfilersController.getInstance().getCurrentProfilerHandle...
runScriptAfterDumb
7,622
boolean () { return PropertiesComponent.getInstance(project).getBoolean(PROFILE_INDEXING_COMPONENT); }
isProfilingEnabled
7,623
void (@Nullable Project project) { myProject = project; if (project != null && !project.isDefault() && !project.isDisposed()) { Disposer.register(project, () -> { if (project == myProject) { Disposer.dispose(onStop); } }); } }
setProject
7,624
Project () { return myProject; }
getProject
7,625
void (MessageBusConnection connection) { super.subscribeListeners(connection); connection.subscribe(DynamicPluginListener.TOPIC, myDynamicPluginListener); }
subscribeListeners
7,626
void () { super.onStop(); myStopped = true; }
onStop
7,627
PlaybackCommand (@NotNull String _command, int line, @NotNull File scriptDir) { String command = _command.replaceAll("[\r\n]+$", ""); String[] cmdline = command.split("\\s+"); PlaybackCommand playbackCommand = null; if (cmdline.length > 0) { String commandName = cmdline[0]; CreateCommand createCommand = CommandProvider...
createCommand
7,628
void (@NotNull String fullCommandLine) { myChainedReporter.startOfCommand(fullCommandLine); myOTSpanLogger.startSpan(fullCommandLine); }
startOfCommand
7,629
void (@Nullable String errDescriptionOrNull) { myOTSpanLogger.endSpan(errDescriptionOrNull); myChainedReporter.endOfCommand(errDescriptionOrNull); }
endOfCommand
7,630
void (@Nullable Project project) { myChainedReporter.startOfScript(project); SpanBuilder spanBuilder = PerformanceTestSpan.TRACER.spanBuilder("Script Runner"); if (SystemProperties.getBooleanProperty(REPORT_RUNNER_SPAN_AS_ROOT, false)) { spanBuilder = spanBuilder.setNoParent(); } mySpan = spanBuilder.startSpan(); myOTS...
startOfScript
7,631
void () { myChainedReporter.scriptCanceled(); }
scriptCanceled
7,632
void (@Nullable Project project) { Disposer.dispose(myOTSpanLogger); mySpan.end(); myChainedReporter.endOfScript(project); }
endOfScript
7,633
void (@NotNull Object file, @NotNull Path path) { try { objectMapper.writerWithDefaultPrettyPrinter().writeValue(path.toFile(), file); } catch (IOException e) { throw new RuntimeException("Failed to write data to " + path, e); } }
dump
7,634
String (@NotNull Project project) { return collectHardwareInfo(); }
collectInfo
7,635
String () { SystemInfo si = new SystemInfo(); HardwareAbstractionLayer hal = si.getHardware(); OperatingSystem os = si.getOperatingSystem(); info.add("=====OS SUMMARY=====\n"); printOperatingSystem(os); printComputerSystem(hal.getComputerSystem()); info.add("\n=====CPU SUMMARY=====\n"); printProcessor(hal.getProcessor(...
collectHardwareInfo
7,636
void (final OperatingSystem os) { info.add(String.valueOf(os)); info.add("Booted: " + Instant.ofEpochSecond(os.getSystemBootTime())); info.add("Uptime: " + FormatUtil.formatElapsedSecs(os.getSystemUptime())); info.add("Running with" + (os.isElevated() ? "" : "out") + " elevated permissions."); }
printOperatingSystem
7,637
void (final ComputerSystem computerSystem) { info.add("System: " + computerSystem.toString()); }
printComputerSystem
7,638
void (CentralProcessor processor) { info.add(processor.toString()); info.add(" Cores:"); for (CentralProcessor.PhysicalProcessor p : processor.getPhysicalProcessors()) { info.add(" " + p.getPhysicalProcessorNumber() + ": efficiency=" + p.getEfficiency() + ", id=" + p.getIdString()); } }
printProcessor
7,639
void (GlobalMemory memory) { info.add("Physical Memory: \n " + memory.toString()); VirtualMemory vm = memory.getVirtualMemory(); info.add("Virtual Memory: \n " + vm.toString()); List<PhysicalMemory> pmList = memory.getPhysicalMemory(); if (!pmList.isEmpty()) { info.add("Physical Memory: "); for (PhysicalMemory pm : pmL...
printMemory
7,640
void (CentralProcessor processor) { long[] prevTicks = processor.getSystemCpuLoadTicks(); long[][] prevProcTicks = processor.getProcessorCpuLoadTicks(); // Wait a second... Util.sleep(1000); long[] ticks = processor.getSystemCpuLoadTicks(); long user = ticks[TickType.USER.getIndex()] - prevTicks[TickType.USER.getIndex(...
printCpu
7,641
void (OperatingSystem os, GlobalMemory memory) { OSProcess myProc = os.getProcess(os.getProcessId()); if (myProc == null) { return; } info.add( "My PID: " + myProc.getProcessID() + " with affinity " + Long.toBinaryString(myProc.getAffinityMask())); info.add("Processes: " + os.getProcessCount() + ", Threads: " + os.getT...
printProcesses
7,642
void (List<HWDiskStore> list) { info.add("Disks:"); for (HWDiskStore disk : list) { info.add(" " + disk.toString()); List<HWPartition> partitions = disk.getPartitions(); for (HWPartition part : partitions) { info.add(" |-- " + part.toString()); } } }
printDisks
7,643
void (List<LogicalVolumeGroup> list) { if (!list.isEmpty()) { info.add("Logical Volume Groups:"); for (LogicalVolumeGroup lvg : list) { info.add(" " + lvg.toString()); } } }
printLVgroups
7,644
void (FileSystem fileSystem) { info.add("File System:"); info.add(String.format(" File Descriptors: %d/%d", fileSystem.getOpenFileDescriptors(), fileSystem.getMaxFileDescriptors())); for (OSFileStore fs : fileSystem.getFileStores()) { long usable = fs.getUsableSpace(); long total = fs.getTotalSpace(); info.add(String.f...
printFileSystem
7,645
void (List<NetworkIF> list) { StringBuilder sb = new StringBuilder("Network Interfaces:"); if (list.isEmpty()) { sb.append(" Unknown"); } else { for (NetworkIF net : list) { if (net.getIfAlias() != null) { sb.append("\n ").append(net); } } } info.add(sb.toString()); }
printNetworkInterfaces
7,646
void (NetworkParams networkParams) { info.add("Network parameters:\n " + networkParams.toString()); }
printNetworkParameters
7,647
void (List<Display> list) { info.add("Displays:"); int i = 0; for (Display display : list) { info.add(" Display " + i + ":"); info.add(String.valueOf(display)); i++; } }
printDisplays
7,648
void (List<GraphicsCard> list) { info.add("Graphics Cards:"); if (list.isEmpty()) { info.add(" None detected."); } else { for (GraphicsCard card : list) { info.add(" " + card); } } }
printGraphicsCards
7,649
String () { return "Hardware"; }
toString
7,650
ScriptRunner (@Nullable PlaybackCommandReporter scriptRunnerReporter) { myScriptRunnerReporter = scriptRunnerReporter; return this; }
setScriptRunnerReporter
7,651
void (@NotNull final Project project, @NotNull String text, @Nullable File workingDir) { PlaybackRunnerExtended runner = new PlaybackRunnerExtended(text, new CommandLogger(), project); runner.setScriptDir(workingDir); runner.setCommandStartStopProcessor(myScriptRunnerReporter != null ? myScriptRunnerReporter : SystemPr...
doRunScript
7,652
void (@NotNull ProgressIndicator indicator) { CountDownLatch countDownLatch = new CountDownLatch(1); runner.run().whenComplete((o, throwable) -> { countDownLatch.countDown(); }); final ScheduledExecutorService myExecutor = ConcurrencyUtil.newSingleScheduledThreadExecutor("Performance plugin script runner"); myExecutor....
run
7,653
void () { super.setRejected(); try { Profiler.getCurrentProfilerHandler().stopProfiling(new ArrayList<>()); } catch (Exception ignored) { } final Notification errorNotification = new Notification(PlaybackRunnerExtended.NOTIFICATION_GROUP, PerformanceTestingBundle.message("callback.stop"), errorText(), NotificationType....
setRejected
7,654
String () { return Strings.notNullize(getError()); }
errorText
7,655
DataContext (@NotNull Editor editor) { Editor hostEditor = editor instanceof EditorWindow ? ((EditorWindow)editor).getDelegate() : editor; DataContext parent = DataManager.getInstance().getDataContext(editor.getContentComponent()); return SimpleDataContext.builder() .setParent(parent) .add(CommonDataKeys.HOST_EDITOR, h...
createEditorContext
7,656
void (Path jsonPath, String name, @Nullable Integer value, @Nullable Long startTime) { String stringToWrite; if (value != null && startTime != null) { stringToWrite = String.format("{\"%s_count\":%d,\"%1$s_time\":%d}", name, value, System.currentTimeMillis() - startTime); } else if (startTime != null) { stringToWrite =...
writeMetricsToJson
7,657
void (@Nullable Project project) { isCanceled = false; timer.start(); }
startOfScript
7,658
void () { isCanceled = true; }
scriptCanceled
7,659
void (@Nullable Project project) { timer.stop(); ApplicationManager .getApplication() .invokeLater(() -> { Notifications.Bus.notify(getDelayNotification(timer.getTotalTime(), timer.getAverageDelay(), timer.getLongestDelay()), project); if (!isCanceled && ProfilersController.getInstance().isStoppedByScript()) { new Fini...
endOfScript
7,660
Notification (long totalTime, long averageDelay, long maxDelay) { return new Notification(PlaybackRunnerExtended.NOTIFICATION_GROUP, PerformanceTestingBundle.message("delay.notification.title"), PerformanceTestingBundle.message("delay.notification.message", totalTime, averageDelay, maxDelay), NotificationType.INFORMATI...
getDelayNotification
7,661
Promise<Object> (@NotNull PlaybackContext context) { ActionCallback callback = createCallback(); try { execute(callback, context); } catch (Throwable throwable) { callback.reject(throwable.getMessage()); } return Promises.toPromise(callback); }
_execute
7,662
ActionCallback () { return new ActionCallbackProfilerStopper(); }
createCallback
7,663
Holder (VirtualFile file) { final Holder holder = new Holder(); VfsUtilCore.iterateChildrenRecursively(file, null, virtualFile -> { if (virtualFile.is(VFileProperty.SYMLINK) && !virtualFile.is(VFileProperty.HIDDEN)) { holder.setSymlink(); } if (!virtualFile.isDirectory()) { holder.increaseByOne(); } return true; }); re...
analyzeFiles
7,664
String (boolean addGeneralInfo) { StringBuilder output = new StringBuilder(); FileEditorManagerImpl fileEditorManager = (FileEditorManagerImpl)FileEditorManager.getInstance(project); VirtualFile baseDir = ProjectUtil.guessProjectDir(project); if (baseDir != null) { Holder holder = analyzeFiles(baseDir); output.append("...
collectMetrics
7,665
boolean () { return isSymlink; }
isSymlink
7,666
void () { isSymlink = true; }
setSymlink
7,667
int () { return numOfFiles; }
getNumOfFiles
7,668
void () { numOfFiles++; }
increaseByOne
7,669
Promise<Object> (final @NotNull PlaybackContext context) { final ActionCallback actionCallback = new ActionCallbackProfilerStopper(); String input = extractCommandArgument(PREFIX); try { pressKey(EditorKey.valueOf(input), context.getProject()); actionCallback.setDone(); } catch (Throwable e) { actionCallback.reject(e.g...
_execute
7,670
void (EditorKey editorKey, Project project) { String actionID = editorKey.action; Editor editor = FileEditorManager.getInstance(project).getSelectedTextEditor(); if (editor != null) { ApplicationManager.getApplication().runWriteAction(Context.current().wrap(() -> { TraceUtil.runWithSpanThrows(PerformanceTestSpan.TRACER...
pressKey
7,671
Promise<Object> (@NotNull PlaybackContext context) { ActionCallback myActionCallback = new ActionCallbackProfilerStopper(); ReformatCodeProcessor codeProcessor = new ReformatCodeProcessor(context.getProject(), false); codeProcessor.setPostRunnable(() -> { context.message(PerformanceTestingBundle.message("command.reform...
_execute
7,672
void (@NotNull ActionCallback callback, @NotNull PlaybackContext context) { writeExitMetricsIfNeeded(); String[] arguments = getText().split(" ", 2); ApplicationManager.getApplication().executeOnPooledThread(() -> { try { TimeUnit.SECONDS.sleep(Long.parseLong(arguments[1])); ApplicationManager.getApplication().exit(tru...
execute
7,673
Promise<Object> (@NotNull PlaybackContext context) { final ActionCallback actionCallback = new ActionCallbackProfilerStopper(); final MessageBusConnection busConnection = context.getProject().getMessageBus().connect(); busConnection.subscribe(PowerSaveMode.TOPIC, () -> actionCallback.setDone()); ApplicationManager.getA...
_execute
7,674
void () { }
dispose
7,675
String () { return PREFIX + getName(); }
getPrefix
7,676
Boolean () { return extractCommandArgument(getPrefix()).contains("WARMUP"); }
isWarmupMode
7,677
Boolean () { return extractCommandArgument(getPrefix()).contains("ENABLE_SYSTEM_METRICS"); }
systemMetricsEnabled
7,678
SpanBuilder (SpanBuilder spanBuilder) { if (systemMetricsEnabled()) { return new SpanBuilderWithSystemInfoAttributes(spanBuilder); } return spanBuilder; }
wrapIfNeed
7,679
Span (String name) { SpanBuilder spanBuilder = wrapIfNeed(tracer.spanBuilder(name)); return spanBuilder.startSpan(); }
startSpan
7,680
Promise<Object> (@NotNull final PlaybackContext context) { final ActionCallback actionCallback = new ActionCallbackProfilerStopper(); String extension = extractCommandArgument(PREFIX); @NotNull Project project = context.getProject(); DumbService.getInstance(project).smartInvokeLater(() -> { InspectionManagerEx inspecti...
_execute
7,681
void (@NotNull AnalysisScope scope) { super.notifyInspectionsFinished(scope); context.message(PerformanceTestingBundle.message("command.inspection.finish"), getLine()); actionCallback.setDone(); }
notifyInspectionsFinished
7,682
AnalysisScope (String extension, @NotNull Project project) { AnalysisScope scope; if (extension.isEmpty()) { scope = new AnalysisScope(project); } else { Collection<VirtualFile> files = getFiles(extension, project); if (files.isEmpty()) { return null; } scope = new AnalysisScope(project, getFiles(extension, project)); ...
getAnalysisScope
7,683
Collection<VirtualFile> (@NotNull final String extension, @NotNull Project project) { final Collection<VirtualFile> files = new HashSet<>(100); FileIndex index = ProjectRootManager.getInstance(project).getFileIndex(); index.iterateContent(fileOrDir -> { if (StringUtil.equals(fileOrDir.getExtension(), extension)) { file...
getFiles
7,684
Editor (PlaybackContext context) { TypingTarget typingTarget = findTarget(context); if (typingTarget == null) throw new IllegalStateException("typingTarget is null"); if (!(typingTarget instanceof EditorComponentImpl)) throw new IllegalStateException("typingTarget is not EditorComponentImpl, but " + typingTarget.getCla...
getEditor
7,685
Promise<Object> (final @NotNull PlaybackContext context) { final ActionCallback actionCallback = new ActionCallbackProfilerStopper(); Project project = context.getProject(); String[] args = getArgs(); final String tab = myOptions.tab; final String insertText = args.length > 1 ? args[1] : ""; Ref<String> tabId = new Ref...
_execute
7,686
String[] () { return getArgs(PREFIX); }
getArgs
7,687
String[] (String prefix) { String input = extractCommandArgument(prefix); String[] args = input.split("\\|"); Args.parse(myOptions, args[0].split(" ")); return args; }
getArgs
7,688
void (Project project, String insertText, Semaphore typingSemaphore) { SearchEverywhereUI ui = SearchEverywhereManager.getInstance(project).getCurrentlyShownUI(); Span insertSpan = PerformanceTestSpan.TRACER.spanBuilder("searchEverywhere_items_loaded").startSpan(); Span firstBatchAddedSpan = PerformanceTestSpan.TRACER....
insertText
7,689
void (@NotNull List<? extends SearchEverywhereFoundElementInfo> list) { super.elementsAdded(list); firstBatchAddedSpan.setAttribute("number", list.size()); firstBatchAddedSpan.end(); }
elementsAdded
7,690
void (Project project, String typingText, Semaphore typingSemaphore) { SearchEverywhereUI ui = SearchEverywhereManager.getInstance(project).getCurrentlyShownUI(); Document document = ui.getSearchField().getDocument(); Semaphore oneLetterLock = new Semaphore(1); ThreadPoolExecutor typing = ConcurrencyUtil.newSingleThrea...
typeText
7,691
void (@NotNull List<? extends SearchEverywhereFoundElementInfo> list) { firstBatchAddedSpan.get().setAttribute("number", list.size()); firstBatchAddedSpan.get().end(); }
elementsAdded
7,692
void (@NotNull List<Object> items) { super.searchFinished(items); oneLetterLock.release(); oneLetterSpan.get().setAttribute("number", items.size()); oneLetterSpan.get().end(); if (isTypingFinished.get()) { typingSemaphore.release(); typing.shutdown(); } }
searchFinished
7,693
void (@NotNull SearchEverywhereUI ui) {}
attachSearchListeners
7,694
Promise<Object> (@NotNull final PlaybackContext context) { final ActionCallback actionCallback = new ActionCallbackProfilerStopper(); final String[] commandArguments = extractCommandArgument(PREFIX).split("\\s+", 2); String shortInspectionName = commandArguments[0]; String extension = ""; if (commandArguments.length > ...
_execute
7,695
void (@NotNull AnalysisScope scope) { super.notifyInspectionsFinished(scope); try { File tempDirectory = FileUtil.createTempDirectory("inspection", "result"); final InspectionResultsView view = getView(); if (view != null) { ExportToXMLActionKt.dumpToXml(view.getCurrentProfile(), view.getTree(), view.getProject(), view...
notifyInspectionsFinished
7,696
String () { return PREFIX; }
getSpanName
7,697
String () { return IdeActions.GROUP_MAIN_MENU; }
getGroupId
7,698
String () { return ActionPlaces.MAIN_MENU; }
getPlace
7,699
String (Iterator<String> args, @NotNull String text) { if (!args.hasNext()) throw new RuntimeException("Too few arguments in " + text); return args.next(); }
nextArg