public static StopWatch createStopWatch(ScreenLifeCycle lifeCycle, String loggingId) { return new Slf4JStopWatch(loggingId + lifeCycle.getSuffix(), LoggerFactory.getLogger(UIPerformanceLogger.class)); } }
/** * Loads a descriptor. * * @param resourcePath path to the resource containing the XML * @param id screen ID * @param params screen parameters * @return root XML element */ public Element load(String resourcePath, String id, Map<String, Object> params) { StopWatch xmlLoadWatch = UIPerformanceLogger.createStopWatch(ScreenLifeCycle.XML, id); String template = loadTemplate(resourcePath); Document document = getDocument(template, params); xmlLoadWatch.stop(); return document.getRootElement(); }
@Override public void execute(Context context, Frame window) { String loggingId = context.getFullFrameId(); try { if (fragment.getFrameOwner() instanceof AbstractFrame) { Element companionsElem = element.element("companions"); if (companionsElem != null) { StopWatch companionStopWatch = createStopWatch(ScreenLifeCycle.COMPANION, loggingId); initCompanion(companionsElem, (AbstractFrame) fragment.getFrameOwner()); companionStopWatch.stop(); } } StopWatch injectStopWatch = createStopWatch(ScreenLifeCycle.INJECTION, loggingId); FrameOwner controller = fragment.getFrameOwner(); UiControllerDependencyInjector dependencyInjector = beanLocator.getPrototype(UiControllerDependencyInjector.NAME, controller, options); dependencyInjector.inject(); injectStopWatch.stop(); } catch (Throwable e) { throw new RuntimeException("Unable to init custom frame class", e); } } }
@Override public void execute(Context context, Frame window) { String loggingId = ComponentsHelper.getFullFrameId(this.fragment); StopWatch stopWatch = createStopWatch(ScreenLifeCycle.INIT, loggingId); ScreenFragment frameOwner = fragment.getFrameOwner(); UiControllerUtils.fireEvent(frameOwner, ScreenFragment.InitEvent.class, new ScreenFragment.InitEvent(frameOwner, options)); stopWatch.stop(); UiControllerUtils.fireEvent(frameOwner, ScreenFragment.AfterInitEvent.class, new ScreenFragment.AfterInitEvent(frameOwner, options)); } }
StopWatch loadStopWatch = createStopWatch(ScreenLifeCycle.LOAD, screenPath);
StopWatch loadStopWatch = createStopWatch(ScreenLifeCycle.LOAD, screenPath);
checkNotYetOpened(screen); StopWatch uiPermissionsWatch = createStopWatch(ScreenLifeCycle.UI_PERMISSIONS, screen.getId()); StopWatch beforeShowWatch = createStopWatch(ScreenLifeCycle.BEFORE_SHOW, screen.getId()); StopWatch afterShowWatch = createStopWatch(ScreenLifeCycle.AFTER_SHOW, screen.getId());
StopWatch companionStopWatch = createStopWatch(ScreenLifeCycle.COMPANION, controller.getId());
StopWatch createStopWatch = createStopWatch(ScreenLifeCycle.CREATE, windowInfo.getId()); StopWatch loadStopWatch = createStopWatch(ScreenLifeCycle.LOAD, windowInfo.getId()); StopWatch injectStopWatch = createStopWatch(ScreenLifeCycle.INJECTION, windowInfo.getId()); StopWatch initStopWatch = createStopWatch(ScreenLifeCycle.INIT, windowInfo.getId());
StopWatch createStopWatch = createStopWatch(ScreenLifeCycle.CREATE, windowInfo.getId()); StopWatch loadStopWatch = createStopWatch(ScreenLifeCycle.LOAD, windowInfo.getId());
StopWatch createStopWatch = createStopWatch(ScreenLifeCycle.CREATE, windowInfo.getId());