(c *stdapi.Context)
| 1241 | } |
| 1242 | |
| 1243 | func (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 | |
| 1265 | func (s *Server) SystemProcesses(c *stdapi.Context) error { |
| 1266 | if err := s.hook("SystemProcessesValidate", c); err != nil { |
nothing calls this directly
no test coverage detected