mgr/influx: Only fetch the current time once when gathering data
By fetching the current time once and storing it into a variable
we save a lot of system calls. On large clusters this can be a lot
of system calls.
In addition we also make sure that all points gathered in the same
loop/run have exactly the same timestamp.
Otherwise there will be a difference in time between the items in
InfluxDB which then causes problems when creating graphs with for
example Grafana.
Signed-off-by: Wido den Hollander <wido@42on.com>
(cherry picked from commit
0857d3bcd4175f39582376fb9980cf3f66fa09ce)