Merge pull request #2847 from rpv-tomsk/collectd-master
authorPavel Rochnyak <pavel2000@ngs.ru>
Thu, 5 Jul 2018 03:38:33 +0000 (10:38 +0700)
committerGitHub <noreply@github.com>
Thu, 5 Jul 2018 03:38:33 +0000 (10:38 +0700)
tree-wide: Use interval value from plugin context, do not set 'vl->interval' in plugins more.

src/dpdkevents.c
src/redis.c
src/utils_dpdk.c

index 9970be0..2a44b2c 100644 (file)
@@ -419,8 +419,12 @@ static int dpdk_events_config(oconfig_item_t *ci) {
 static int dpdk_helper_link_status_get(dpdk_helper_ctx_t *phc) {
   dpdk_events_ctx_t *ec = DPDK_EVENTS_CTX_GET(phc);
 
-  /* get Link Status values from DPDK */
+/* get Link Status values from DPDK */
+#if RTE_VERSION < RTE_VERSION_NUM(18, 05, 0, 0)
   uint8_t nb_ports = rte_eth_dev_count();
+#else
+  uint8_t nb_ports = rte_eth_dev_count_avail();
+#endif
   if (nb_ports == 0) {
     DPDK_CHILD_LOG("dpdkevent-helper: No DPDK ports available. "
                    "Check bound devices to DPDK driver.\n");
index 7edd329..41442b6 100644 (file)
@@ -654,8 +654,6 @@ static void redis_read_server_info(redis_node_t *rn) {
                     "total_connections_received", DS_TYPE_DERIVE);
   redis_handle_info(rn->name, rr->str, "total_operations", NULL,
                     "total_commands_processed", DS_TYPE_DERIVE);
-  redis_handle_info(rn->name, rr->str, "operations_per_second", NULL,
-                    "instantaneous_ops_per_sec", DS_TYPE_GAUGE);
   redis_handle_info(rn->name, rr->str, "expired_keys", NULL, "expired_keys",
                     DS_TYPE_DERIVE);
   redis_handle_info(rn->name, rr->str, "evicted_keys", NULL, "evicted_keys",
index 1d4668f..aee9791 100644 (file)
@@ -853,7 +853,11 @@ uint128_t str_to_uint128(const char *str, int len) {
 }
 
 uint8_t dpdk_helper_eth_dev_count(void) {
+#if RTE_VERSION < RTE_VERSION_NUM(18, 05, 0, 0)
   uint8_t ports = rte_eth_dev_count();
+#else
+  uint8_t ports = rte_eth_dev_count_avail();
+#endif
   if (ports == 0) {
     ERROR(
         "%s:%d: No DPDK ports available. Check bound devices to DPDK driver.\n",