func (r *RemoteSysProbeUtil) GetProcStats(pids []int32) (*model.ProcStatsWithPermByPID, error) {
	procReq := &pbgo.ProcessStatRequest{
		Pids: pids,
	}

	reqBody, err := reqEncoding.GetMarshaler(reqEncoding.ContentTypeProtobuf).Marshal(procReq)
	if err != nil {
		return nil, err
	}

	req, err := http.NewRequest("POST", procStatsURL, bytes.NewReader(reqBody))
	if err != nil {
		return nil, err
	}

	req.Header.Set("Accept", contentTypeProtobuf)
	req.Header.Set("Content-Type", procEncoding.ContentTypeProtobuf)
	resp, err := r.httpClient.Do(req)
	if err != nil {
		return nil, err
	}
	defer resp.Body.Close()

	if resp.StatusCode != http.StatusOK {
		return nil, fmt.Errorf("proc_stats request failed: Probe Path %s, url: %s, status code: %d", r.path, procStatsURL, resp.StatusCode)
	}

	body, err := ioutil.ReadAll(resp.Body)
	if err != nil {
		return nil, err
	}

	contentType := resp.Header.Get("Content-type")
	results, err := procEncoding.GetUnmarshaler(contentType).Unmarshal(body)
	if err != nil {
		return nil, err
	}

	return results, nil
}
// GetProcStats returns a set of process stats by querying system-probe
GetProcStats returns a set of process stats by querying system-probe
// GetProcStats returns a set of process stats by querying system - probe
func (r *RemoteSysProbeUtil) GetProcStats(pids []int32) (*model.ProcStatsWithPermByPID, error) {
	procReq := &pbgo.ProcessStatRequest{
		Pids: pids,
	}
	reqBody, err := reqEncoding.GetMarshaler(reqEncoding.ContentTypeProtobuf).Marshal(procReq)
	if err != nil {
		return nil, err
	}
	req, err := http.NewRequest("POST", procStatsURL, bytes.NewReader(reqBody))
	if err != nil {
		return nil, err
	}
	req.Header.Set("Accept", contentTypeProtobuf)
	req.Header.Set("Content-Type", procEncoding.ContentTypeProtobuf)
	resp, err := r.httpClient.Do(req)
	if err != nil {
		return nil, err
	}
	defer resp.Body.Close()
	if resp.StatusCode != http.StatusOK {
		return nil, fmt.Errorf("proc_stats request failed: Probe Path %s, url: %s, status code: %d", r.path, procStatsURL, resp.StatusCode)
	}
	body, err := ioutil.ReadAll(resp.Body)
	if err != nil {
		return nil, err
	}
	contentType := resp.Header.Get("Content-type")
	results, err := procEncoding.GetUnmarshaler(contentType).Unmarshal(body)
	if err != nil {
		return nil, err
	}
	return results, nil
}
func ( r * RemoteSysProbeUtil ) GetProcStats ( pids [ ] int32 ) ( * model . ProcStatsWithPermByPID , error ) { procReq := & pbgo . ProcessStatRequest { Pids : pids , } reqBody , err := reqEncoding . GetMarshaler ( reqEncoding . ContentTypeProtobuf ) . Marshal ( procReq ) if err != nil { return nil , err } req , err := http . NewRequest ( " " , procStatsURL , bytes . NewReader ( reqBody ) ) if err != nil { return nil , err } req . Header . Set ( " " , contentTypeProtobuf ) req . Header . Set ( " " , procEncoding . ContentTypeProtobuf ) resp , err := r . httpClient . Do ( req ) if err != nil { return nil , err } defer resp . Body . Close ( ) if resp . StatusCode != http . StatusOK { return nil , fmt . Errorf ( " " , r . path , procStatsURL , resp . StatusCode ) } body , err := ioutil . ReadAll ( resp . Body ) if err != nil { return nil , err } contentType := resp . Header . Get ( " " ) results , err := procEncoding . GetUnmarshaler ( contentType ) . Unmarshal ( body ) if err != nil { return nil , err } return results , nil }
GetProcStats returns a set of process stats by querying system-probe
GetProcStats returns a set of process stats by querying system - probe