Add db metrics

This commit is contained in:
Ben Johnson
2020-12-31 16:09:35 -07:00
parent da5087c14c
commit 9d0e79c2cf
5 changed files with 590 additions and 20 deletions

View File

@@ -93,14 +93,25 @@ The commands are:
`[1:])
}
// Default configuration settings.
const (
DefaultAddr = ":9090"
)
// Config represents a configuration file for the litestream daemon.
type Config struct {
// Bind address for serving metrics.
Addr string `yaml:"addr"`
// List of databases to manage.
DBs []*DBConfig `yaml:"databases"`
}
// DefaultConfig returns a new instance of Config with defaults set.
func DefaultConfig() Config {
return Config{}
return Config{
Addr: DefaultAddr,
}
}
func (c *Config) DBConfig(path string) *DBConfig {