Package: wsc-influx-tools
WSC Influx ToolsThis project is in aid of theBridgestone World Solar Challenge.This is a python module which provides several CLI tools for interacting with the event's influx database.Installing wsc-influx-toolswsc-influx-tools is a python package. THis has been tested on Linux and Mac (using Python 3.11).
Let us know if there are any issues. It can be installed usingpip.pipinstallwsc-influx-toolsThe commands have useful help$ wsc-influx-send-data --help
usage: wsc-influx-send-data [-h] [--config CONFIG] [--url URL] [--bucket BUCKET] [--org ORG]
                            [--token TOKEN] [--debug] [--quiet] [--dryrun] [--input INPUT]Writing data to influxwsc-influx-tools provides a tool to send line format to an Influx V2 database from the CLI,
given a URL and a token.Note that many of hte fields included below are overwritten (e.g. car name, team number, etc.)Note that the precision used for the timestamp at the end of the line is nanoseconds (i.e. seconds * 1000000000)wsc-influx-send-data--urlhttps://telemetry.worldsolarchallenge.org/test/ingest/michigan--tokenTOKEN_GOES_HERE<< EOFtelemetry,event=BWSC2023,class=Cruiser,team=World\ Solar\ Challenge\ Faculty,car=Solar\ Wombat\ 3,shortname=WSC\ Faculty longitude=135.26007,latitude=-30.24246,altitude=187.3,distance=432162,solarEnergy=20914846,batteryEnergy=52278368 1697461695000000000EOFReading data from InfluxFor testing purposes, teams are provided with access to the InfluxDB V3 bucket to which their
data is written. The line format, written above, can be downloaded as CSV using the below command:By default the wsc-influx-get-data command will query the last day's data from the given
measurement in the given bucket.wsc-influx-get-data\--buckettest-teamdata\--measurementteamdata\--format=csv\--tokenTOKEN_GOES_HEREThe above results in a CSV output on the command line:,iox::measurement,time,altitude,batteryEnergy,car,class,distance,escapedname,event,host,latitude,longitude,shortname,solarEnergy,team,teamnum0,teamdata,2023-10-1613:08:15,187.3,52278368.0,Astrum,Challenger,432162.0,michigan,BWSC2023,telegraf-deployment-michigan-6c497bc786-f4xdg,-30.24246,135.26007,Michigan,20914846.0,UniversityofMichiganSolarCarTeam,2Copyright 2021-2023 David SnowdonRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.