WordPress at a glance
function is not described

Automattic\WooCommerce\Admin\API\Reports\Stock\Stats

DataStore::get_product_count() private WC 1.0

Get product count for the store.

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

No Hooks.

Return

Int. Product count.

Usage

// private - for code of main (parent) class only
$result = $this->get_product_count();

Code of DataStore::get_product_count() WC 5.3.0

<?php
private function get_product_count() {
	$query_args              = array();
	$query_args['post_type'] = array( 'product', 'product_variation' );
	$query                   = new \WP_Query();
	$query->query( $query_args );
	return intval( $query->found_posts );
}