Documentation
¶
Index ¶
Constants ¶
const ( SystemLog = "/var/lib/komizo/system.log" // AccessLog is where the generated site blocks write. See alpine.sh. AccessLog = "/srv/_proxy/logs/access.log" )
Where the sampler writes and how much it keeps.
Here rather than in the app package because the two scripts that read and write this file are here, and a path that lives apart from the only things that use it is a value two places have to agree about.
Variables ¶
var AlpineInitScript string
var AlpineProxyScript string
var AlpineRemoveScript string
var AlpineScript string
Functions ¶
func Inventory ¶ added in v0.0.12
func Inventory() string
Inventory is one tab-separated record per app, plus the box itself.
func Metrics ¶ added in v0.0.12
Metrics totals the requests in a range, per app, off the proxy's access log.
func Sampler ¶ added in v0.0.12
func Sampler() string
Sampler is the per-minute script exactly as it lands on the box.
func SamplerInstall ¶ added in v0.0.12
SamplerInstall writes the sampler onto the box and puts it in cron.
version is the komizo release doing the installing and stamp is the content hash of what it writes. Both are recorded so the interface can answer two different questions: which komizo set this box up, and would running the update change anything.
func ShQuote ¶ added in v0.0.12
ShQuote wraps a value for a shell command line.
Single quotes, with any single quote in the value closed, escaped and reopened -- the one form that is safe for arbitrary text in POSIX sh.
Exported and living HERE because this is the package that builds shell. The app package had its own copy; it now calls this one, so there is a single definition of the rule that makes every quoted value in this tool safe.
func Storage ¶ added in v0.0.12
Storage measures one app's volumes with du, now.
The app name is SHELL-QUOTED rather than interpolated bare: it is the only value here that comes from a caller rather than from a constant in this file. The app package validates it too, but that made the safety of this line depend on a rule enforced in another package -- the same argument shQuote carries there.
func SystemLogRange ¶ added in v0.0.12
SystemLogRange reads back what the sampler wrote in a range.
Types ¶
This section is empty.