mirror of
https://github.com/prometheus/prometheus
synced 2024-12-24 07:23:02 +00:00
Integrate cleanups for comments in PR70.
This commit is contained in:
parent
d137362257
commit
a908e397bc
@ -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
2
main.go
@ -76,8 +76,8 @@ func main() {
|
||||
|
||||
appState := &appstate.ApplicationState{
|
||||
Config: conf,
|
||||
RuleManager: ruleManager,
|
||||
Persistence: persistence,
|
||||
RuleManager: ruleManager,
|
||||
TargetManager: targetManager,
|
||||
}
|
||||
|
||||
|
@ -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
|
||||
}
|
||||
|
@ -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…
Reference in New Issue
Block a user