WordPress at a glance
function is not described

Automattic\WooCommerce\Admin\API\Reports\PerformanceIndicators

Controller::get_stats_data() public WC 1.0

Get report stats data, avoiding duplicate requests for stats that use the same endpoint.

{} It's a method of the class: Controller{}

No Hooks.

Return

WP_REST_Response|WP_Error. Report stats data.

Usage

$Controller = new Controller();
$Controller->get_stats_data( $report, $query_args );
$report(string) (required)
Report slug to request data for.
$query_args(array) (required)
Report query args.

Code of Controller::get_stats_data() WC 5.3.0

<?php
public function get_stats_data( $report, $query_args ) {
	// Return from cache if we've already requested these report stats.
	if ( isset( $this->stats_data[ $report ] ) ) {
		return $this->stats_data[ $report ];
	}

	// Request the report stats.
	$request_url = $this->endpoints[ $report ];
	$request     = new \WP_REST_Request( 'GET', $request_url );
	$request->set_param( 'before', $query_args['before'] );
	$request->set_param( 'after', $query_args['after'] );

	$response = rest_do_request( $request );

	// Cache the response.
	$this->stats_data[ $report ] = $response;

	return $response;
}