Преглед изворни кода

Add platform to status information

Ask Bjørn Hansen пре 12 година
родитељ
комит
fc9554cfa0
2 измењених фајлова са 15 додато и 9 уклоњено
  1. 9 7
      monitor.go
  2. 6 2
      status.html

+ 9 - 7
monitor.go

@@ -276,10 +276,11 @@ func StatusServer(zones Zones) func(http.ResponseWriter, *http.Request) {
 		sort.Sort(RatesByCount{rates})
 
 		type statusData struct {
-			Version string
-			Zones   Rates
-			Uptime  DayDuration
-			Global  struct {
+			Version  string
+			Zones    Rates
+			Uptime   DayDuration
+			Platform string
+			Global   struct {
 				Queries         *metrics.StandardMeter
 				Histogram       histogramData
 				HistogramRecent histogramData
@@ -289,9 +290,10 @@ func StatusServer(zones Zones) func(http.ResponseWriter, *http.Request) {
 		uptime := DayDuration{time.Since(timeStarted)}
 
 		status := statusData{
-			Version: VERSION,
-			Zones:   rates,
-			Uptime:  uptime,
+			Version:  VERSION,
+			Zones:    rates,
+			Uptime:   uptime,
+			Platform: runtime.GOARCH + "-" + runtime.GOOS,
 		}
 
 		status.Global.Queries = metrics.Get("queries").(*metrics.StandardMeter)

+ 6 - 2
status.html

@@ -74,8 +74,12 @@
 
 		<table class="table table-bordered table-condensed">
 		<tr>
-			<td class="info header">Uptime</td><td>{{.Uptime.DayString}}</td>
-
+			<td class="header">Uptime</td>
+			<td>{{.Uptime.DayString}}</td>
+		</tr>
+		<tr>
+			<td class="header">Platform</td>
+			<td>{{.Platform}}</td>
 		</tr>
 		</table>