mirror of
https://github.com/kemko/nomad.git
synced 2026-01-06 18:35:44 +03:00
comments
This commit is contained in:
@@ -65,14 +65,6 @@ func (a *Allocations) Stats(alloc *Allocation, q *QueryOptions) (map[string]*Tas
|
||||
return res, nil
|
||||
}
|
||||
|
||||
func getErrorMsg(resp *http.Response) error {
|
||||
if errMsg, err := ioutil.ReadAll(resp.Body); err == nil {
|
||||
return fmt.Errorf(string(errMsg))
|
||||
} else {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
// Allocation is used for serialization of allocations.
|
||||
type Allocation struct {
|
||||
ID string
|
||||
|
||||
@@ -399,8 +399,6 @@ func parseWriteMeta(resp *http.Response, q *WriteMeta) error {
|
||||
|
||||
// decodeBody is used to JSON decode a body
|
||||
func decodeBody(resp *http.Response, out interface{}) error {
|
||||
//res, _ := ioutil.ReadAll(resp.Body)
|
||||
//fmt.Fprintf(os.Stdout, "DIPTANU BODY %v", res)
|
||||
dec := json.NewDecoder(resp.Body)
|
||||
return dec.Decode(out)
|
||||
}
|
||||
|
||||
@@ -130,6 +130,7 @@ type Client struct {
|
||||
|
||||
consulService *consul.ConsulService
|
||||
|
||||
// HostStatsCollector collects host resource usage stats
|
||||
hostStatsCollector *stats.HostStatsCollector
|
||||
resourceUsage *stats.RingBuff
|
||||
resourceUsageLock sync.RWMutex
|
||||
|
||||
@@ -259,6 +259,10 @@ func (e *UniversalExecutor) removeChrootMounts() error {
|
||||
return e.ctx.AllocDir.UnmountAll()
|
||||
}
|
||||
|
||||
// getAllPids returns the pids of all the processes spun up by the executor. We
|
||||
// use the libcontainer apis to get the pids when the user is using cgroup
|
||||
// isolation and we scan the entire process table if the user is not using any
|
||||
// isolation
|
||||
func (e *UniversalExecutor) getAllPids() ([]*nomadPid, error) {
|
||||
if e.command.ResourceLimits {
|
||||
manager := getCgroupManager(e.groups, e.cgPaths)
|
||||
|
||||
@@ -72,7 +72,7 @@ func (s *HTTPServer) ClientAllocRequest(resp http.ResponseWriter, req *http.Requ
|
||||
clientStats := s.agent.client.StatsReporter()
|
||||
allocStats, ok := clientStats.AllocStats()[allocID]
|
||||
if !ok {
|
||||
return nil, CodedError(404, "alloc not running in node")
|
||||
return nil, CodedError(404, "alloc not running on node")
|
||||
}
|
||||
|
||||
if task := req.URL.Query().Get("task"); task != "" {
|
||||
|
||||
Reference in New Issue
Block a user