You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There is no visibility into what a ComponentRenderer costs. For a ComboBox or Grid that renders a component per item, this is often the dominant cost of a page load and the main reason a UIDL response is large, and right now nothing measures it.
Also a 5.0 regression
The agent-based kit had ComponentRendererInstrumentation, which put advice on com.vaadin.flow.data.renderer.ComponentRenderer.createComponent and emitted a span Component creation with a vaadin.component attribute. It went away with the agent in the 5.0 rewrite.
Why the kit cannot do it today
ComponentRenderer.createComponent has no listener, callback or interceptor. Unlike data provider queries, there is no Flow SPI in flight for it either.
There is a partial shim for Grid and TreeGrid: both implement HasDataGenerators, so a DataGenerator can be attached and its generateData calls counted and timed per component. That measures the whole per-item JSON generation, renderer included, rather than the renderer alone. ComboBox does not expose it, since its generator is package private on ComboBoxDataController.
Proposed work
Ship the DataGenerator-based measurement for Grid and TreeGrid, which needs no Flow change, as vaadin.data.item.generate.duration tagged by component.
There is no visibility into what a
ComponentRenderercosts. For aComboBoxorGridthat renders a component per item, this is often the dominant cost of a page load and the main reason a UIDL response is large, and right now nothing measures it.Also a 5.0 regression
The agent-based kit had
ComponentRendererInstrumentation, which put advice oncom.vaadin.flow.data.renderer.ComponentRenderer.createComponentand emitted a spanComponent creationwith avaadin.componentattribute. It went away with the agent in the 5.0 rewrite.Why the kit cannot do it today
ComponentRenderer.createComponenthas no listener, callback or interceptor. Unlike data provider queries, there is no Flow SPI in flight for it either.There is a partial shim for
GridandTreeGrid: both implementHasDataGenerators, so aDataGeneratorcan be attached and itsgenerateDatacalls counted and timed per component. That measures the whole per-item JSON generation, renderer included, rather than the renderer alone.ComboBoxdoes not expose it, since its generator is package private onComboBoxDataController.Proposed work
DataGenerator-based measurement forGridandTreeGrid, which needs no Flow change, asvaadin.data.item.generate.durationtagged by component.ComponentRenderer.createComponent. Worth revisiting once feat: report data provider queries on the service event bus flow#25262 lands, since that establishes the pattern for this kind of observation point.