diff options
author | Dimitri Sokolyuk <demon@dim13.org> | 2016-01-29 19:49:25 +0100 |
---|---|---|
committer | Dimitri Sokolyuk <demon@dim13.org> | 2016-01-29 19:49:25 +0100 |
commit | 745c8a0395325b2ce4e308d9c0d56d514f6290cb (patch) | |
tree | b58dbc07603704cbf20ca5bd5e362ed2821ce8fb | |
parent | 7fbc4ac74bc925d99d5380dbeb7346341d70dee2 (diff) |
Add tracing
-rw-r--r-- | cmd/acme/main.go | 16 | ||||
-rw-r--r-- | provider.go | 2 |
2 files changed, 16 insertions, 2 deletions
diff --git a/cmd/acme/main.go b/cmd/acme/main.go index ebe6a91..b216793 100644 --- a/cmd/acme/main.go +++ b/cmd/acme/main.go @@ -3,11 +3,16 @@ package main import ( "flag" "log" + "os" + "runtime/trace" "dim13.org/acme" ) -var confName = flag.String("conf", "acme.toml", "configuration file") +var ( + confName = flag.String("conf", "acme.toml", "configuration file") + tracing = flag.String("trace", "", "trace output") +) func prepare(conf *Config) error { var err error @@ -77,6 +82,15 @@ func satisfice(des *desire) error { func main() { flag.Parse() + if *tracing != "" { + f, err := os.Create(*tracing) + if err != nil { + log.Fatal(err) + } + trace.Start(f) + defer trace.Stop() + } + conf, err := LoadConfig(*confName) if err != nil { log.Fatal(err) diff --git a/provider.go b/provider.go index 45ac842..4b4996c 100644 --- a/provider.go +++ b/provider.go @@ -61,7 +61,7 @@ func (p Provider) Nonce() (string, error) { // DialProvider fetches directory and initializes nonce func DialProvider(directory string) (*Provider, error) { p := &Provider{ - nonces: make(chan string, 3), + nonces: make(chan string, 100), poll: time.Second, } p.Client = http.Client{ |