Skip to content
This repository has been archived by the owner on Feb 29, 2020. It is now read-only.

Commit

Permalink
Merge pull request #4 from prometheus/code-cleanup
Browse files Browse the repository at this point in the history
Clean up some bits in the Mesos exporter
  • Loading branch information
juliusv committed Mar 19, 2015
2 parents bd6aa81 + f3c0cee commit a4a6638
Showing 1 changed file with 20 additions and 16 deletions.
36 changes: 20 additions & 16 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,57 +4,61 @@ import (
"encoding/json"
"flag"
"fmt"
"github.com/antonlindstrom/mesos_stats"
"github.com/golang/glog"
"github.com/prometheus/client_golang/prometheus"
"io/ioutil"
"net/http"
"os"
"time"

"github.com/antonlindstrom/mesos_stats"
"github.com/golang/glog"
"github.com/prometheus/client_golang/prometheus"
)

var (
configFile = flag.String("config.file", "", "Path to config file.")
metricsPath = flag.String("web.telemetry-path", "/metrics", "Path under which to expose metrics.")
)

var (
cpuLimitVal = prometheus.NewGaugeVec(
prometheus.GaugeOpts{
Namespace: "mesos_task",
Name: "cpus_limit",
Help: "CPU share limit.",
Name: "cpu_limit",
Help: "Fractional CPU limit.",
},
[]string{"service", "mesos_slave", "framework_id"},
[]string{"task", "mesos_slave", "framework_id"},
)
cpuSysVal = prometheus.NewGaugeVec(
prometheus.GaugeOpts{
Namespace: "mesos_task",
Name: "cpus_system_time_secs",
Help: "CPU system time for task.",
Name: "cpu_system_seconds_total",
Help: "Cumulative system CPU time in seconds.",
},
[]string{"service", "mesos_slave", "framework_id"},
[]string{"task", "mesos_slave", "framework_id"},
)
cpuUsrVal = prometheus.NewGaugeVec(
prometheus.GaugeOpts{
Namespace: "mesos_task",
Name: "cpus_user_time_secs",
Help: "CPU system time for task.",
Name: "cpu_user_seconds_total",
Help: "Cumulative user CPU time in seconds.",
},
[]string{"service", "mesos_slave", "framework_id"},
[]string{"task", "mesos_slave", "framework_id"},
)
memLimitVal = prometheus.NewGaugeVec(
prometheus.GaugeOpts{
Namespace: "mesos_task",
Name: "mem_limit_bytes",
Name: "memory_limit_bytes",
Help: "Task memory limit in bytes.",
},
[]string{"service", "mesos_slave", "framework_id"},
[]string{"task", "mesos_slave", "framework_id"},
)
memRssVal = prometheus.NewGaugeVec(
prometheus.GaugeOpts{
Namespace: "mesos_task",
Name: "mem_rss_bytes",
Name: "memory_rss_bytes",
Help: "Task memory RSS usage in bytes.",
},
[]string{"service", "mesos_slave", "framework_id"},
[]string{"task", "mesos_slave", "framework_id"},
)
)

Expand Down

0 comments on commit a4a6638

Please sign in to comment.