static void saveStats(@NotNull PsiFile psiFile, @NotNull List<? extends InspectionRunner.InspectionContext> contexts,
                        @NotNull HighlightInfoUpdaterImpl highlightInfoUpdater) {
    if (!psiFile.getViewProvider().isPhysical()) {
      // ignore editor text fields/consoles etc
      return;
    }
    Map<Object, HighlightInfoUpdaterImpl.ToolLatencies> latencies = ContainerUtil.map2Map(contexts, context -> Pair.create(context.tool().getShortName(), new HighlightInfoUpdaterImpl.ToolLatencies(
                                                                 Math.max(0, context.holder().toolStamps.errorStamp - context.holder().toolStamps.initTimeStamp),
                                                                 Math.max(0, context.holder().toolStamps.warningStamp - context.holder().toolStamps.initTimeStamp),
                                                                 Math.max(0, context.holder().toolStamps.otherStamp - context.holder().toolStamps.initTimeStamp))));
    highlightInfoUpdater.saveLatencies(psiFile, latencies);
  }
static void saveStats(@NotNull PsiFile psiFile, @NotNull List<? extends InspectionRunner.InspectionContext> contexts,
                        @NotNull HighlightInfoUpdaterImpl highlightInfoUpdater)