java.lang.Object
org.elasticsearch.action.admin.cluster.stats.CCSUsageTelemetry

public class CCSUsageTelemetry extends Object
Service holding accumulated CCS search usage statistics. Individual cross-cluster searches will pass CCSUsage data here to have it collated and aggregated. Snapshots of the current CCS Telemetry Usage can be obtained by getting CCSTelemetrySnapshot objects.
Theory of operation: Each search creates a CCSUsage.Builder, which can be updated during the progress of the search request, and then it instantiates a CCSUsage object when the request is finished. That object is passed to updateUsage(CCSUsage) on the request processing end (whether successful or not). The updateUsage(CCSUsage) method will then update the internal counters and metrics.
When we need to return the current state of the telemetry, we can call getCCSTelemetrySnapshot() which produces a snapshot of the current state of the telemetry as CCSTelemetrySnapshot. These snapshots are additive so when collecting the snapshots from multiple nodes, an empty snapshot is created and then all the node's snapshots are added to it to obtain the summary telemetry.