github.com/hhsnopek/up@v0.1.1/internal/metrics/metrics_example_test.go (about) 1 package metrics_test 2 3 import ( 4 "time" 5 6 "github.com/apex/up/internal/metrics" 7 ) 8 9 func Example() { 10 m := metrics.New(). 11 Namespace("AWS/ApiGateway"). 12 Metric("Count"). 13 Stat("Sum"). 14 Dimension("ApiName", "app"). 15 Period(5). 16 TimeRange(time.Now().Add(-time.Hour), time.Now()) 17 18 res, err := metrics.Get(m) 19 _ = res 20 _ = err 21 }