Joey Hafner
97e4cc547a
1. homelab [Gitea](https://gitea.jafner.tools/Jafner/homelab), [Github (docker_config)](https://github.com/Jafner/docker_config), [Github (wiki)](https://github.com/Jafner/wiki), [Github (cloud_tools)](https://github.com/Jafner/cloud_tools), [Github (self-hosting)](https://github.com/Jafner/self-hosting). - Rename? Jafner.net? Wouldn't that be `Jafner/Jafner.net/Jafner.net`? 2. Jafner.dev [Github](https://github.com/Jafner/Jafner.dev). 3. dotfiles [Gitea](https://gitea.jafner.tools/Jafner/dotfiles), [Github](https://github.com/Jafner/dotfiles). 4. nvgm [Gitea](https://gitea.jafner.tools/Jafner/nvgm) 5. pamidi [Gitea](https://gitea.jafner.tools/Jafner/pamidi), [Github](https://github.com/Jafner/pamidi) 6. docker-llm-amd [Gitea](https://gitea.jafner.tools/Jafner/docker-llm-amd) 7. doradash [Gitea](https://gitea.jafner.tools/Jafner/doradash) 8. clip-it-and-ship-it [Gitea (PyClipIt)](https://gitea.jafner.tools/Jafner/PyClipIt), [Github](https://github.com/Jafner/clip-it-and-ship-it). 9. razer battery led [Github](https://github.com/Jafner/Razer-BatteryLevelRGB) 10. 5etools-docker [Github](https://github.com/Jafner/5etools-docker) 11. jafner-homebrew [Github](https://github.com/Jafner/jafner-homebrew)
20 lines
830 B
Bash
20 lines
830 B
Bash
#!/bin/bash
|
|
# this script converts the output of the "forge tps" command (in the form of the .forgetps file) into json for sending to influxdb
|
|
# by default it reads from stdin and outputs to a .forgetps.json file
|
|
while IFS= read -r line; do
|
|
if [ "$line" != "" ]; then
|
|
DIM=$(echo -n "$line" | awk '{print $2}')
|
|
if [ "$DIM" = "Mean" ]; then
|
|
DIM="Overall"
|
|
fi
|
|
TPT=$(echo "$line" | grep -oE 'Mean tick time: .+ms' | awk '{print $4}')
|
|
TPS=$(echo "$line" | grep -oE 'Mean TPS: .+' | awk '{print $3}')
|
|
JSON+=\{$(echo \"dim\":\"$DIM\",\"tpt\":$TPT,\"tps\":$TPS)\},
|
|
fi
|
|
#done < .forgetps # inputs from .forgetps file
|
|
done <$1 # inputs from file passed via stdin
|
|
JSON=$(echo ${JSON} | sed 's/,$//')
|
|
|
|
#echo [${JSON}] >&1 # outputs to stdout
|
|
echo [${JSON}] > .forgetps.json # uncomment this to output to file
|