@Nullable
    private ObjectStatistics getObjectStatistics(@NotNull DBNDatabaseNode node, @NotNull Event event) {
        DBSObject object = node.getObject();
        if (!(object instanceof DBPObjectStatistics statistics)) {
            return null;
        }

        boolean statsWasRead;
        DBNNode parentNode = getParentItem(node);
        DBSObject parentObject = parentNode instanceof DBNDatabaseNode pn ? DBUtils.getPublicObject(pn.getObject()) : null;
        if (parentObject instanceof DBPObjectStatisticsCollector) { // && !((DBPObjectStatisticsCollector) parentObject).isStatisticsCollected()
            statsWasRead = ((DBPObjectStatisticsCollector) parentObject).isStatisticsCollected();
        } else {
            // If there is no stats collector then do not check for stats presence
            // Because it will trigger stats read job which won't read any statistics (as there is no way to load it for individual object).
            statsWasRead = true;// statistics.hasStatistics();
        }

        long maxObjectSize = statsWasRead ? getMaxObjectSize((TreeItem) event.item) : -1;
        if (statsWasRead && maxObjectSize >= 0) {
            long statObjectSize = statistics.getStatObjectSize();
            if (statObjectSize <= 0) {
                // Empty or no size - nothing to show
                return null;
            }
            Format format;
            synchronized (classFormatMap) {
                format = classFormatMap.get(object.getClass().getName());
                if (format == null) {
                    try {
                        Method getStatObjectSizeMethod = object.getClass().getMethod("getStatObjectSize");
                        Property propAnnotation = getStatObjectSizeMethod.getAnnotation(Property.class);
                        if (propAnnotation != null) {
                            Class<? extends Format> formatterClass = propAnnotation.formatter();
                            if (formatterClass != Format.class) {
                                format = formatterClass.getConstructor().newInstance();
                            }
                        }
                    } catch (Exception e) {
                        log.debug(e);
                    }
                    if (format == null) {
                        format = numberFormat;
                    }
                    classFormatMap.put(object.getClass().getName(), format);
                }
            }
            return new ObjectStatistics.Known(statObjectSize, maxObjectSize, format);
        } else if (parentNode instanceof DBNDatabaseNode) {
            DBSObject realParentObject = DBUtils.getPublicObject(((DBNDatabaseNode) parentNode).getObject());
            TreeItem parentItem = ((TreeItem) event.item).getParentItem();
            getObjectStatistics(node.getParentNode(), realParentObject, parentItem);
        }

        return new ObjectStatistics.Unknown();
    }
Statistics node renderer.
Draws connection type marker next to the item name.
Draws item statistics in the right part.
plugins/org.jkiss.dbeaver.ui.navigator/src/org/jkiss/dbeaver/ui/navigator/database/StatisticsNavigatorNodeRenderer.java