prometheus-node-exporter-lua: fix corner case in hostapd_stations
authorMartin Weinelt <hexa@darmstadt.ccc.de>
Sat, 26 Jun 2021 00:15:17 +0000 (02:15 +0200)
committerEtienne Champetier <champetier.etienne@gmail.com>
Tue, 6 Jul 2021 17:37:36 +0000 (13:37 -0400)
commita1b145abb026938ca5e2c205396cc007b49da15f
tree88559df7bcb986bcb219b887b6528ed181cf0595
parenta98596168ade0ace524ca51067f00e2956ec8cee
prometheus-node-exporter-lua: fix corner case in hostapd_stations

There was a corner case, when a vif had no stations, that
evaluate_metrics for a station that was nil and had no collected metrics
would have been called.

Comment the code, to make it easier to understand and follow, and
simplify some variable names along the way.

Signed-off-by: Martin Weinelt <hexa@darmstadt.ccc.de>
utils/prometheus-node-exporter-lua/files/usr/lib/lua/prometheus-collectors/hostapd_stations.lua