github.com/projecteru2/core@v0.0.0-20240321043226-06bcc1c23f58/resource/plugins/binary/metrics.go (about) 1 package binary 2 3 import ( 4 "context" 5 6 binarytypes "github.com/projecteru2/core/resource/plugins/binary/types" 7 plugintypes "github.com/projecteru2/core/resource/plugins/types" 8 ) 9 10 // GetMetricsDescription . 11 func (p Plugin) GetMetricsDescription(ctx context.Context) (*plugintypes.GetMetricsDescriptionResponse, error) { 12 req := &binarytypes.GetMetricsDescriptionRequest{} 13 resp := &plugintypes.GetMetricsDescriptionResponse{} 14 return resp, p.call(ctx, GetMetricsDescriptionCommand, req, resp) 15 } 16 17 // GetMetrics . 18 func (p Plugin) GetMetrics(ctx context.Context, podname, nodename string) (*plugintypes.GetMetricsResponse, error) { 19 req := &binarytypes.GetMetricsRequest{ 20 Podname: podname, 21 Nodename: nodename, 22 } 23 resp := &plugintypes.GetMetricsResponse{} 24 return resp, p.call(ctx, GetMetricsCommand, req, resp) 25 }