Integrate cleanups for comments in PR70.

This commit is contained in:
Julius Volz 2013-02-14 18:21:21 +01:00
parent d137362257
commit a908e397bc
4 changed files with 9 additions and 4 deletions

View File

@ -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
}

View File

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

View File

@ -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
}

View File

@ -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")