feat(agent) multi-driver db monitoring, hot-plug config, release pipeline

This commit is contained in:
2026-06-15 17:29:53 +01:00
parent db6ed003f1
commit 40811ed6e8
17 changed files with 949 additions and 34 deletions

View File

@@ -0,0 +1,30 @@
package sqlite
import (
"os"
"bugs.watch/agent/internal/aggregate"
)
// Collector reports the on-disk size of a SQLite database file.
// No driver or connection is needed; we simply stat the file.
// Failures are silently skipped.
type Collector struct {
path string
}
func New(path string) *Collector {
return &Collector{path: path}
}
func (c *Collector) Name() string { return "sqlite" }
func (c *Collector) Close() {}
func (c *Collector) Collect(window *aggregate.Window) {
info, err := os.Stat(c.path)
if err != nil {
return
}
window.SetDBSizeBytes(uint64(info.Size()))
}