WordPress at a glance
function is not described

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

DataStore::get_count() private WC 1.0

Get count for the passed in stock status.

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

No Hooks.

Return

Int. Count.

Usage

// private - for code of main (parent) class only
$result = $this->get_count( $status );
$status(string) (required)
Status slug.

Code of DataStore::get_count() WC 5.2.2

<?php
private function get_count( $status ) {
	global $wpdb;

	return (int) $wpdb->get_var(
		$wpdb->prepare(
			"
			SELECT count( DISTINCT posts.ID ) FROM {$wpdb->posts} posts
			LEFT JOIN {$wpdb->wc_product_meta_lookup} wc_product_meta_lookup ON posts.ID = wc_product_meta_lookup.product_id
			WHERE posts.post_type IN ( 'product', 'product_variation' )
			AND wc_product_meta_lookup.stock_status = %s
			",
			$status
		)
	);
}