MCPcopy Create free account
hub / github.com/convox/rack / SystemMetrics

Method SystemMetrics

pkg/api/controllers.go:1243–1263  ·  view source on GitHub ↗
(c *stdapi.Context)

Source from the content-addressed store, hash-verified

1241}
1242
1243func (s *Server) SystemMetrics(c *stdapi.Context) error {
1244 if err := s.hook("SystemMetricsValidate", c); err != nil {
1245 return err
1246 }
1247
1248 var opts structs.MetricsOptions
1249 if err := stdapi.UnmarshalOptions(c.Request(), &opts); err != nil {
1250 return err
1251 }
1252
1253 v, err := s.provider(c).WithContext(c.Context()).SystemMetrics(opts)
1254 if err != nil {
1255 return err
1256 }
1257
1258 if vs, ok := interface{}(v).(Sortable); ok {
1259 sort.Slice(v, vs.Less)
1260 }
1261
1262 return c.RenderJSON(v)
1263}
1264
1265func (s *Server) SystemProcesses(c *stdapi.Context) error {
1266 if err := s.hook("SystemProcessesValidate", c); err != nil {

Callers

nothing calls this directly

Calls 7

hookMethod · 0.95
providerMethod · 0.95
RequestMethod · 0.80
ContextMethod · 0.80
SliceMethod · 0.80
SystemMetricsMethod · 0.65
WithContextMethod · 0.65

Tested by

no test coverage detected