Commit graph

8 commits

Author SHA1 Message Date
sparky8512
5cc43f6e1d Address a bunch of pylint and yapf complaints
I don't necessarily think all of these make the code better or easier to read, but it's easier to just go along with what the tools want, since they do generally make things better.

There should be no functional changes here.
2022-09-14 12:55:50 -07:00
sparky8512
6ab737165e Correct help text and default for server URL arg
Not sure why I thought the InfluxDB 2.x client library accepted a bare host/port for the server, in addition to a full URL. It does not, as reported in issue #49.  The 1.x client did, but it didn't take a URL for server, anyway.

This corrects the help text to indicate the URL argument specifies a... URL, and corrects the default to be something that could actually work.
2022-07-06 16:51:48 -07:00
sparky8512
b11e6f4978 Catch and ignore KeyboardInterrupt exception
Per discussion in PR #40 comments. This will prevent a stack dump from littering the output when interrupting script run via Control-C. That was useful to have for a while, but probably is not anymore.

Also, fix up a few corner cases where rc could be used without it having been set.
2022-03-02 14:48:51 -08:00
sparky8512
09b8717131 Tweaks/fixes mostly related to --poll-loops
Adjust how the --poll-loops option handles the first set of polled loops for history stats, to make that set of data run against a number of samples (and therefore total time interval) that more closely matches subsequent sets of polled loops. This especially applies to the case where the stats are resuming from a prior counter, where without this logic, the first set had an unintuitively large number of samples.

Fix timestamp reporting for history stats to better reflect the actual accumulated data, for cases where later polls of the history data had failed. This introduced the potential for the status data and the history stats data to have inconsistent timestamps, and required the timestamp collection to be moved from the individual output scripts into dish_common. Rather than deal with the complication this would create for CSV output, where there is only 1 timestamp field, just disallow the combination of options that could result in different timestamps (For CSV output only).

Fix an error case where poll loop counting was not being reset correctly.

Fix explicit --samples option to be honored when resuming from counter for history stats.
2022-02-20 13:39:07 -08:00
sparky8512
0225a9783c Various fixes to the InfluxDB 2.x script
This should address all the comments I dropped onto pull request #37.

The only significant fix here is that the SSL command line options should all work now, although slightly differently than how they work in the InfluxDB 1.x script. Whether or not SSL is enabled is controlled by the URL, specifically whether it is an https: URL or an http: one, and the options just control the CA cert parameters.
2022-02-19 15:33:58 -08:00
sparky8512
8655f75bab Record stats from polled data on script shutdown
If there was history data collected via the --poll-loops option, but not yet used to compute history stats, do so on script shutdown. This should reduce the amount of data lost when the script restarts, for example to reboot the system on which it runs, since --poll-loops allows for collection of history data beyond the 15-minute buffer size the dish (currently) holds.

This will only work if the script is shut down via SIGTERM or SIGINT (for example, by interrupting with Control-C).
2022-01-20 14:07:09 -08:00
Peter Hasse
08ebefcb6e revert from utc to local time 2021-11-24 17:26:40 +01:00
Peter Hasse
5905fb00f9 initial commit influxDB 2.0 client 2021-11-24 15:06:36 +01:00