Skip to content

Commit

Permalink
add profiling (#5)
Browse files Browse the repository at this point in the history
  • Loading branch information
bamarni committed Jul 18, 2016
1 parent 5640815 commit 6aae7df
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions dockness.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,10 @@ import (
"github.com/docker/machine/libmachine"
"github.com/docker/machine/libmachine/drivers"
"github.com/miekg/dns"
_ "github.com/rakyll/gom/http"
"log"
"net"
"net/http"
"os"
"os/signal"
"strings"
Expand Down Expand Up @@ -109,8 +111,14 @@ func main() {
tld := flag.String("tld", "docker", "Top-level domain to use")
ttl := flag.Uint("ttl", 0, "Time to Live for DNS records")
debug := flag.Bool("debug", false, "Enable debugging")
profile := flag.Bool("profile", false, "Enable profiling")
_ = flag.Int("profile-port", 6060, "Enable profiling on a given port")
flag.Parse()

if *profile {
go http.ListenAndServe("localhost:6060", nil)
}

dockness := &Dockness{
Ttl: *ttl,
Tld: *tld,
Expand Down

0 comments on commit 6aae7df

Please sign in to comment.