Changeset 2009680
- Timestamp:
- 01/10/2019 08:27:11 AM (7 years ago)
- Location:
- woo-prometheus-metrics/trunk
- Files:
-
- 2 edited
-
readme.txt (modified) (2 diffs)
-
woo-prometheus-metrics.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
woo-prometheus-metrics/trunk/readme.txt
r1961997 r2009680 5 5 * Requires at least: 4.7.2 6 6 * Tested up to: 4.9.5 7 * Stable tag: 0.0. 27 * Stable tag: 0.0.4 8 8 * License: GPLv2 9 9 … … 13 13 14 14 * `woocommerce_product_count` - a count of products listed. 15 * `woocommerce_order_count` - a count of orders on the system. 16 17 For later version, we might also provide order counts broken down by status. 15 * `woocommerce_order_count` - a count of orders on the system, by 'status'. 16 * `woocommerce_user_count` - a count of users on the system. 18 17 19 18 We gather the metrics with the following section of Prometheus configuration: -
woo-prometheus-metrics/trunk/woo-prometheus-metrics.php
r2000813 r2009680 5 5 Plugin URI: https://wordpress.org/plugins/woo-prometheus-metrics 6 6 Description: Plugin to monitor the count of products and orders on a Woocommerce site. 7 Version: 0.0. 37 Version: 0.0.4 8 8 Author: Ross Golder <ross@golder.org> 9 9 Author URI: http://www.golder.org/ … … 77 77 $order_counts = array(); 78 78 foreach($order_statuses as $order_status) { 79 $order_counts[$order_status] = wc_orders_count($order_status); 79 $s = substr($order_status, 3); // Drop the 'wc-' prefix 80 $order_counts[$s] = wc_orders_count($s); 80 81 } 81 82
Note: See TracChangeset
for help on using the changeset viewer.