github.com/wtfutil/wtf@v0.43.0/modules/newrelic/client/server_metrics.go (about) 1 package newrelic 2 3 import ( 4 "fmt" 5 ) 6 7 // GetServerMetrics will return a slice of Metric items for a particular 8 // Server ID, optionally filtering by MetricsOptions. 9 func (c *Client) GetServerMetrics(id int, options *MetricsOptions) ([]Metric, error) { 10 mc := NewMetricClient(c) 11 12 return mc.GetMetrics( 13 fmt.Sprintf( 14 "servers/%d/metrics.json", 15 id, 16 ), 17 options, 18 ) 19 } 20 21 // GetServerMetricData will return all metric data for a particular Server and 22 // slice of metric names, optionally filtered by MetricDataOptions. 23 func (c *Client) GetServerMetricData(id int, names []string, options *MetricDataOptions) (*MetricDataResponse, error) { 24 mc := NewMetricClient(c) 25 26 return mc.GetMetricData( 27 fmt.Sprintf( 28 "servers/%d/metrics/data.json", 29 id, 30 ), 31 names, 32 options, 33 ) 34 }