command
module
Version:
v0.0.0-...-58fb5c8
Opens a new window with list of versions in this module.
Published: Apr 26, 2021
License: MIT
Opens a new window with license information.
Imports: 18
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
README
¶
mac-stats
Fetches battery and SSD info and stores in a Postgres DB.
Tested under Catalina (10.15.7)
install
- build
go
binary
- create the database, see schema
- config database, the config file needs to be either in the current dir or in ~/.config
change the config file
display example
With grafana and query
SELECT
stamp AS "time",
((metrics->>'UnitRead')::integer) AS "Unit Read"
FROM
ssd
WHERE
$__timeFilter(stamp)
scheduling
- update plist file
- start the job
launchctl load mac-stats.plist
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>laurent.mac-stats</string>
<key>ProgramArguments</key>
<array>
<string>/Users/laurent/go/bin/mac-stats</string>
</array>
<key>StartInterval</key>
<integer>3600</integer>
<key>RunAtLoad</key>
<true/>
<key>StandardErrorPath</key>
<string>/tmp/mac-stats.err</string>
<key>StandardOutPath</key>
<string>/tmp/mac-stats.out</string>
</dict>
</plist>
requirements:
Documentation
¶
There is no documentation for this package.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.