guilbaults / infiniband-exporter

Prometheus exporter for a Infiniband Fabric
Apache License 2.0
55 stars 22 forks source link

Refactor Switch Processing #30

Closed gabrieleiannetti closed 3 years ago

gabrieleiannetti commented 3 years ago

Hi,

the following changes are improving switch port processing e.g. there was a drop of the last 2 switch ports.
Also few refactorings were done for more precise error handling and also this should prepare the exporter for the next feature to export the channel adapter data.

To check the update for processing complete list of switch ports, you can make a diff of the relevant IB metrics as following:

Get relevant metrics from master branch:

  1. git checkout master
  2. ./infiniband-exporter.py --from-file ibqueryerrors_switch.out &
  3. wget -O metrics_master http://localhost:9683/metrics
  4. grep -P "^infiniband_[\w]+{" metrics_master | sort > relevant_metrics_master

Get relevant metrics from improve_switch_port_parsing branch:

  1. git checkout improve_switch_port_parsing
  2. ./infiniband-exporter.py --from-file ibqueryerrors_switch.out &
  3. wget -O metrics_improve_switch_port_parsing http://localhost:9683/metrics
  4. grep -P "^infiniband_[\w]+{" metrics_improve_switch_port_parsing | sort > relevant_metrics_improve_switch_port_parsing

Make diff of relevant metrics: diff relevant_metrics_master relevant_metrics_improve_switch_port_parsing

Check line count of relevant metrics files:

wc -l relevant_metrics_*
   30947 relevant_metrics_improve_switch_port_parsing
   28950 relevant_metrics_master

Best