Mode:
Duration:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
package main
import "fmt"
type Metric struct {
Name string
Value int
}
func main() {
metrics := []Metric{
{Name: "Requests", Value: 1200},
{Name: "Errors", Value: 5},
{Name: "Latency(ms)", Value: 80},
}
fmt.Println("Dashboard Metrics")
for _, metric := range metrics {
fmt.Println(metric.Name, ":", metric.Value)
}
if metrics[1].Value > 10 {
fmt.Println("Alert: High error rate")
} else {
fmt.Println("System Healthy")
}
}Coding works best on desktop or with an external keyboard.