Skip to content

[ML] Add the number of ML nodes to the ML feature set usage info #33850

@droberts195

Description

@droberts195

Currently the ML usage info contains details of how many jobs and datafeeds are created/running, but not the most basic statistic of how many ML nodes are in the cluster.

It should be pretty easy to add this to the MachineLearningFeatureSetUsage class. Then the MachineLearningFeatureSet.execute() method can populate it by iterating the discovery nodes in the cluster state and looking for the ml.enabled attribute (which basically propagates each node's node.ml setting to the other nodes).

Something like:

        int mlNodeCount = 0;
        for (DiscoveryNode node : clusterState.getNodes()) {
            Map<String, String> nodeAttributes = node.getAttributes();
            String enabled = nodeAttributes.get(MachineLearning.ML_ENABLED_NODE_ATTR);
            if (Boolean.parseBoolean(enabled)) {
                ++mlNodeCount;
            }
        }

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions