Skip to content

Commit

Permalink
Possibility to disable net monitoring
Browse files Browse the repository at this point in the history
  • Loading branch information
Soulou committed Jan 15, 2016
1 parent 6473367 commit e398663
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 9 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# CHANGELOG

## v0.3.3

* Let user disable Net monitoring

## v0.3.2

* BUGFIX fd leak when reading cgroup file
Expand Down
17 changes: 9 additions & 8 deletions config/env.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,15 @@ import (
)

var ENV = map[string]string{
"DOCKER_URL": "http://localhost:4243",
"PORT": "4244",
"REFRESH_TIME": "5",
"CGROUP_SOURCE": "docker",
"CGROUP_DIR": "/sys/fs/cgroup",
"PROC_DIR": "/proc",
"RUNNER_DIR": "/usr/bin",
"DEBUG": "false",
"DOCKER_URL": "http://127.0.0.1:4243",
"PORT": "4244",
"REFRESH_TIME": "20",
"CGROUP_SOURCE": "docker",
"CGROUP_DIR": "/sys/fs/cgroup",
"PROC_DIR": "/proc",
"RUNNER_DIR": "/usr/bin",
"DEBUG": "false",
"NET_MONITORING": "true",
}

var (
Expand Down
5 changes: 4 additions & 1 deletion server/acadock_monitoring.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"flag"
"fmt"
"log"
"os"

"net/http"
"net/http/pprof"
Expand Down Expand Up @@ -134,7 +135,9 @@ func main() {
doProfile := flag.Bool("profile", false, "profile app")
flag.Parse()
go cpu.Monitor()
go net.Monitor("eth0")
if os.Getenv("NET_MONITORING") == "false" {
go net.Monitor("eth0")
}

r := martini.Classic()

Expand Down

0 comments on commit e398663

Please sign in to comment.