Browse Source

Integrate cleanups for comments in PR70.

pull/70/head
Julius Volz 12 years ago
parent
commit
a908e397bc
  1. 5
      appstate/appstate.go
  2. 2
      main.go
  3. 2
      utility/strconv.go
  4. 4
      web/status.go

5
appstate/appstate.go

@ -20,9 +20,12 @@ import (
"github.com/prometheus/prometheus/storage/metric"
)
// ApplicationState is an encapsulation of all relevant Prometheus application
// runtime state. It enables simpler passing of this state to components that
// require it.
type ApplicationState struct {
Config *config.Config
RuleManager rules.RuleManager
Persistence metric.MetricPersistence
RuleManager rules.RuleManager
TargetManager retrieval.TargetManager
}

2
main.go

@ -76,8 +76,8 @@ func main() {
appState := &appstate.ApplicationState{
Config: conf,
RuleManager: ruleManager,
Persistence: persistence,
RuleManager: ruleManager,
TargetManager: targetManager,
}

2
utility/strconv.go

@ -67,6 +67,8 @@ func StringToDuration(durationStr string) (duration time.Duration, err error) {
duration *= 60
case "s":
duration *= 1
default:
panic("Invalid time unit in duration string.")
}
return
}

4
web/status.go

@ -20,9 +20,9 @@ import (
)
type PrometheusStatus struct {
Status string
Config string
Rules string
Status string
Targets string
}
@ -32,9 +32,9 @@ type StatusHandler struct {
func (h *StatusHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
status := &PrometheusStatus{
Status: "TODO: add status information here",
Config: h.appState.Config.ToString(0),
Rules: "TODO: list rules here",
Status: "TODO: add status information here",
Targets: "TODO: list targets here",
}
t, _ := template.ParseFiles("web/templates/status.html")

Loading…
Cancel
Save