rabbit_go
2 years agoClean up the expiration of stale metrics and prepare for production
jweigele [Mon, 12 Dec 2022 02:51:44 +0000 (18:51 -0800)]
Clean up the expiration of stale metrics and prepare for production

 * Add power metric expiration
 * Make the map expiry keys a joined string, which will help prevent
    weird array lengths being required all over the place, makes expiry
    more generic in implementation
 * Switch routing keys to their production variants
 * _Should_ work in kubernetes as the others do, just need to deploy

2 years agoLarge logging and flags revamp
jweigele [Mon, 12 Dec 2022 01:25:50 +0000 (17:25 -0800)]
Large logging and flags revamp

 * Everything is using klog (interfaced with logr) to do log output now
 * This provides different visibility levels for debug and a better
   format
 * Init flags and logger creation in main (emulate other files mostly)
 * As part of the revamp, provide some structured yaml marshalling for
   future config

2 years agoFormatting slight tweaks (logging) and build script updates
jweigele [Sat, 10 Dec 2022 06:55:46 +0000 (22:55 -0800)]
Formatting slight tweaks (logging) and build script updates

2 years agoTidy up helper somewhat, and start on implementing reprocess
jweigele [Fri, 9 Dec 2022 22:50:25 +0000 (14:50 -0800)]
Tidy up helper somewhat, and start on implementing reprocess

For helper:
 * Helper does most of the json I/O so we don't need to import in other files
 * Add some structs to manage the complexity of multiple routing keys
 * Various convenience options (IncludeDate on send, Source in the RabbitConfig) for easier scope

For reprocess:
 * Reads in temp pretty simply, and sets prometheus gauges as we've done before
 * Kinda handles DIY temperature (resends and prometheus gauge), and does not care about motion (so won't send it back out)
 * Weird chain of structs to implement different devices
 * Have not started on power or other complicated logic yet

2 years agoAdded separate builds, and implemented new timecolorshift functionality
jweigele [Tue, 6 Dec 2022 20:17:26 +0000 (12:17 -0800)]
Added separate builds, and implemented new timecolorshift functionality

 * Dockerfile.whatever is called to build for a particular binary, buildall.sh does all the ones we know about
   - Still need to call dockregassemble at the end, don't forget!
 * Most of the functionality in timecolorshift is ported over from the python version
   * This does mean that the colors are hardcoded in the binary, maybe look at grabbing them from kubernetes directly in the future
 * Have only really gone through one peak at midday, so unsure how the color mixing and rollover func works

2 years agoAbstract some of this out further, routing key passed as setup (seems to be tested...
jweigele [Tue, 6 Dec 2022 16:20:04 +0000 (08:20 -0800)]
Abstract some of this out further, routing key passed as setup (seems to be tested working)

2 years agoBreak out helper functions to a helper package for further work
jweigele [Tue, 6 Dec 2022 16:10:56 +0000 (08:10 -0800)]
Break out helper functions to a helper package for further work

2 years agoOne more change, denotes the module as a git repo so we don't fetch over https
jweigele [Tue, 6 Dec 2022 15:35:11 +0000 (07:35 -0800)]
One more change, denotes the module as a git repo so we don't fetch over https

2 years agoUpdate module path for potential imports later
jweigele [Tue, 6 Dec 2022 15:06:19 +0000 (07:06 -0800)]
Update module path for potential imports later

2 years agoFirst working run!
jweigele [Tue, 6 Dec 2022 04:03:59 +0000 (20:03 -0800)]
First working run!

 * Rename the module slightly for future compat (I think?)
 * Connects to the rabbitmq server and sends messages like we'd want
 * Some values hardcoded, and not really any retry or backoff logic
    - This is actually good! I swear!
    - Leave the kubelet doing the backoff and retry, and see how that takes
 * One restarted mq server seemed to work, but probably needs some testing

2 years agoInitial commit, really just spams lol on a random topic
jweigele [Tue, 6 Dec 2022 02:40:31 +0000 (18:40 -0800)]
Initial commit, really just spams lol on a random topic