+
+ next unless $last_lines;
+
+ my $last_line = $last_lines->[$i];
+ my @c = ( 'instance', ps_cols_visible );
+ my @influx;
+ foreach my $j ( 0 .. $#$line ) {
+ #push @influx, $c[$j] . '=' . $line->[$j];
+ push @influx, $c[$j] . '='
+ . ( $j >= 9 && $j != 13 ? $line->[$j] - $last_line->[$j] : $line->[$j] )
+ . ( $j == 3 || $j >= 6 && $j != 9 ? 'i' : '' );
+ }
+ my $influx = join(',', @influx);
+ $influx =~ s/,user=([^,]+)/ user="$1"/;
+ print $influx_fh "ganeti,$influx\n" unless $influx =~ m/(#|__)/;
+