# The dpdkstat plugin
+This plugin is optional and only has a specific use case: monitoring DPDK applications
+that don't expose stats in any other way than the DPDK xstats API.
+
**Data Plane Development Kit** (DPDK) is a set of drivers and libraries for fast
-packet processing.
+packet processing. Please note that this plugin is a polling based plugin rather
+than an events based plugin (using it will drive up core utilization on a system).
+
+**PLEASE DO NOT USE THIS PLUGIN FOR OVS-DPDK**. dpdkstat is really for DPDK
+applications that have no other way of exposing stats. For OVS or OVS-with-DPDK the
+Open vSwitch plugins available in collectd 5.8.0 should be used for
+collecting stats and events. In addition the OVS plugin is events based rather
+than polling based and will have a smaller footprint on the system.
## Summary
*/
static XS(Collectd_plugin_register_read) {
- return _plugin_register_generic_userdata(aTHX, PLUGIN_READ, "read");
+ _plugin_register_generic_userdata(aTHX, PLUGIN_READ, "read");
}
static XS(Collectd_plugin_register_write) {
- return _plugin_register_generic_userdata(aTHX, PLUGIN_WRITE, "write");
+ _plugin_register_generic_userdata(aTHX, PLUGIN_WRITE, "write");
}
static XS(Collectd_plugin_register_log) {
- return _plugin_register_generic_userdata(aTHX, PLUGIN_LOG, "log");
+ _plugin_register_generic_userdata(aTHX, PLUGIN_LOG, "log");
}
static XS(Collectd_plugin_register_notification) {
- return _plugin_register_generic_userdata(aTHX, PLUGIN_NOTIF, "notification");
+ _plugin_register_generic_userdata(aTHX, PLUGIN_NOTIF, "notification");
}
static XS(Collectd_plugin_register_flush) {
- return _plugin_register_generic_userdata(aTHX, PLUGIN_FLUSH, "flush");
+ _plugin_register_generic_userdata(aTHX, PLUGIN_FLUSH, "flush");
}
typedef int perl_unregister_function_t(const char *name);
unreg(SvPV_nolen(ST(0)));
XSRETURN_EMPTY;
-
- return;
} /* static void _plugin_unregister_generic ( ... ) */
/*
*/
static XS(Collectd_plugin_unregister_read) {
- return _plugin_unregister_generic(aTHX, plugin_unregister_read, "read");
+ _plugin_unregister_generic(aTHX, plugin_unregister_read, "read");
}
static XS(Collectd_plugin_unregister_write) {
- return _plugin_unregister_generic(aTHX, plugin_unregister_write, "write");
+ _plugin_unregister_generic(aTHX, plugin_unregister_write, "write");
}
static XS(Collectd_plugin_unregister_log) {
- return _plugin_unregister_generic(aTHX, plugin_unregister_log, "log");
+ _plugin_unregister_generic(aTHX, plugin_unregister_log, "log");
}
static XS(Collectd_plugin_unregister_notification) {
- return _plugin_unregister_generic(aTHX, plugin_unregister_notification,
- "notification");
+ _plugin_unregister_generic(aTHX, plugin_unregister_notification,
+ "notification");
}
static XS(Collectd_plugin_unregister_flush) {
- return _plugin_unregister_generic(aTHX, plugin_unregister_flush, "flush");
+ _plugin_unregister_generic(aTHX, plugin_unregister_flush, "flush");
}
/*
}
#endif
+static rd_kafka_resp_err_t kafka_error() {
+#if RD_KAFKA_VERSION >= 0x000b00ff
+ return rd_kafka_last_error();
+#else
+ return rd_kafka_errno2err(errno);
+#endif
+}
+
static uint32_t kafka_hash(const char *keydata, size_t keylen) {
uint32_t hash = 5381;
for (; keylen > 0; keylen--)
if ((ctx->topic = rd_kafka_topic_new(ctx->kafka, ctx->topic_name,
topic_conf)) == NULL) {
ERROR("write_kafka plugin: cannot create topic : %s\n",
- rd_kafka_err2str(rd_kafka_errno2err(errno)));
+ rd_kafka_err2str(kafka_error()));
return errno;
}