Search in sources :

Example 16 with OutPara

use of com.tencent.wstt.gt.OutPara in project GT by Tencent.

the class Client method setOutPara.

public void setOutPara(String paraName, long time, long value) {
    OutPara outPara = getOutPara(paraName);
    if (null != outPara && OutPara.DISPLAY_DISABLE != outPara.getDisplayProperty()) {
        outPara.setValue(time, String.valueOf(value));
        // add on 20130923 为了出参支持历史曲线
        OpPerfBridge.addHistory(outPara, outPara.getValue(), time, value);
    }
}
Also used : OutPara(com.tencent.wstt.gt.OutPara)

Example 17 with OutPara

use of com.tencent.wstt.gt.OutPara in project GT by Tencent.

the class PerfOutParaCache method put.

public void put(String key, String value) {
    OutPara outPara = outParaMap.get(key);
    if (null == outPara) {
        outPara = new OutPara();
    }
    outPara.setKey(key);
    if (// 如果有上一次的数据就移到历史
    outPara.getValue() != null) {
        outPara.addHistory(outPara.getValue());
    }
    outPara.setValue(value);
// 先不需要这句,只有注册才需要,普通的put前一定是注册过的
//		outParaMap.put(key, outPara);
}
Also used : OutPara(com.tencent.wstt.gt.OutPara)

Example 18 with OutPara

use of com.tencent.wstt.gt.OutPara in project GT by Tencent.

the class GTParamOutEditListAdapter method getView.

@Override
public View getView(int position, View convertView, ViewGroup parent) {
    ParamConst.ViewHolderDrag switch_drag = null;
    OutPara ov = (OutPara) list.get(position);
    String key = ov.getKey();
    final String alias = ov.getAlias();
    final int type = getItemViewType(position);
    /*
		 * 根据每行UI的类型进行UI模型准备与数据准备
		 */
    switch(type) {
        case TYPE_PROMPT_ITEM:
            convertView = PROMPT_ITEM_convertView;
            if (((OutPara) list.get(1)).getKey().equals(ParamConst.DIVID_TITLE)) {
                PROMPT_ITEM_title.setText(ParamConst.PROMPT_INIT_TITLE);
            } else {
                PROMPT_ITEM_title.setText(ParamConst.PROMPT_TITLE);
            }
            break;
        case TYPE_DIVIDE_ITEM:
            convertView = DIVIDE_ITEM_convertView;
            if (position == 1) {
                DIVIDE_ITEM_top_border.setVisibility(View.GONE);
            } else {
                DIVIDE_ITEM_top_border.setVisibility(View.VISIBLE);
            }
            break;
        case TYPE_DISABLE_ITEM:
            convertView = DISABLE_ITEM_convertView;
            if (2 == position || position > 1 && ((OutPara) list.get(position - 1)).getKey().equals(ParamConst.DIVID_TITLE)) {
                DISABLE_ITEM_top_border.setVisibility(View.GONE);
            } else {
                DISABLE_ITEM_top_border.setVisibility(View.VISIBLE);
            }
            break;
        case TYPE_SWITCH_ITEM:
            if (convertView == null) {
                convertView = mInflater.inflate(R.layout.gt_edit_list_item, null);
                switch_drag = new ParamConst.ViewHolderDrag();
                switch_drag.tv_key = (TextView) convertView.findViewById(R.id.draglist_key);
                switch_drag.tv_alias = (TextView) convertView.findViewById(R.id.draglist_shotkey);
                switch_drag.tv_listview_bottom_border = (TextView) convertView.findViewById(R.id.listrow_bottom_border);
                convertView.setTag(switch_drag);
            } else {
                switch_drag = (ParamConst.ViewHolderDrag) convertView.getTag();
            }
            switch_drag.tv_key.setText(key);
            switch_drag.tv_alias.setText(alias);
            if (position == (list.size() - 1)) {
                switch_drag.tv_listview_bottom_border.setVisibility(View.VISIBLE);
            } else {
                switch_drag.tv_listview_bottom_border.setVisibility(View.GONE);
            }
            if (list.size() == 2) {
                switch_drag.tv_listview_bottom_border.setVisibility(View.GONE);
            }
            int disable_titile_pos = OpUIManager.getOutListDisableTitlePosition();
            if (position > disable_titile_pos) {
                switch_drag.tv_key.setTextColor(Color.GRAY);
                switch_drag.tv_alias.setTextColor(Color.GRAY);
            } else {
                switch_drag.tv_key.setTextColor(Color.WHITE);
                switch_drag.tv_alias.setTextColor(Color.WHITE);
            }
            break;
    }
    return convertView;
}
Also used : OutPara(com.tencent.wstt.gt.OutPara) ParamConst(com.tencent.wstt.gt.manager.ParamConst)

Example 19 with OutPara

use of com.tencent.wstt.gt.OutPara in project GT by Tencent.

the class GTParamOutFragment method onListItemClick.

@Override
public void onListItemClick(ListView l, View v, int position, long id) {
    OutPara ov = OpUIManager.list_op.get(position);
    final String key = ov.getKey();
    if (key.equals(ParamConst.PROMPT_TITLE) || key.equals(ParamConst.DIVID_TITLE) || key.equals(ParamConst.PROMPT_DISABLE_TITLE)) {
        return;
    }
    ov.setAlert(false);
    GTServiceController.INSTANCE.show_alert = false;
    TagTimeEntry opProfilerData = OpPerfBridge.getProfilerData(key);
    if (null != opProfilerData && OpPerfBridge.getProfilerData(key).hasChild()) {
        Intent intent = new Intent(getActivity(), GTOpMulPerfActivity.class);
        intent.putExtra("name", key);
        intent.putExtra("alias", ov.getAlias());
        intent.putExtra("client", ov.getClient());
        getActivity().startActivity(intent);
    } else {
        Intent intent = new Intent(getActivity(), GTOpSinglePerfActivity.class);
        if (ov.getAlias().equals("SM")) {
            intent = new Intent(getActivity(), GTOpSMActivity.class);
        }
        intent.putExtra("name", key);
        intent.putExtra("alias", ov.getAlias());
        intent.putExtra("client", ov.getClient());
        getActivity().startActivity(intent);
    }
}
Also used : TagTimeEntry(com.tencent.wstt.gt.ui.model.TagTimeEntry) OutPara(com.tencent.wstt.gt.OutPara) Intent(android.content.Intent)

Example 20 with OutPara

use of com.tencent.wstt.gt.OutPara in project GT by Tencent.

the class GTAutoTestInternal method startSample.

/**
	 * 采集指定的指标
	 * @param pkgName 指定的被测应用
	 * @param pid 被测应用指定的被测进程,当pid为-1时,会采集应用所有进程的指定性能指标
	 * @param target 指定的采集指标,包括:
	 * <p>GTAutoTestInternal.INTENT_KEY_PSS</p>
	 * <p>GTAutoTestInternal.INTENT_KEY_PRI</p>
	 * <p>GTAutoTestInternal.INTENT_KEY_NET</p>
	 * <p>GTAutoTestInternal.INTENT_KEY_JIF</p>
	 * <p>GTAutoTestInternal.INTENT_KEY_CPU</p>
	 */
public static void startSample(String pkgName, int pid, String target) {
    Client client = ClientManager.getInstance().getAUTClient();
    if (client == null) {
        return;
    }
    List<OutPara> opList = new ArrayList<OutPara>();
    if (target.equals(INTENT_KEY_PSS)) {
        opList = GTAUTFragment.registerOutpara(AUTManager.SEQ_PSS, pid);
    } else if (target.equals(INTENT_KEY_NET)) {
        opList = GTAUTFragment.registerOutpara(AUTManager.SEQ_NET, -1);
    } else if (target.equals(INTENT_KEY_FPS)) {
        // FPS从属的Client是DefaultClient
        OutPara opFps = ClientManager.getInstance().getDefaultClient().getOutPara(CommonString.FPS_key);
        // 将FPS挪到已关注出参中
        if (AidlEntry.DISPLAY_DISABLE == opFps.getDisplayProperty()) {
            opFps.setMonitor(true);
            opFps.setDisplayProperty(AidlEntry.DISPLAY_NORMAL);
            OpUIManager.setItemToNormal(opFps);
        }
        // 如果FPS非观察状态,重置为观察状态
        if (!opFps.isMonitor()) {
            opFps.setMonitor(true);
        }
        OpPerfBridge.registMonitor(opFps);
        opList.add(opFps);
    } else if (target.equals(INTENT_KEY_JIF)) {
        opList = GTAUTFragment.registerOutpara(AUTManager.SEQ_JIF, pid);
    } else if (target.equals(INTENT_KEY_CPU)) {
        opList = GTAUTFragment.registerOutpara(AUTManager.SEQ_CPU, pid);
    } else if (target.equals(INTENT_KEY_PRI)) {
        opList = GTAUTFragment.registerOutpara(AUTManager.SEQ_PD, pid);
    }
    tempMap.put(new ProOutParaQueryEntry(pkgName, pid, target), opList);
    // 主动刷新出参页面的列表
    GTApp.getOpHandler().sendEmptyMessage(5);
    GTApp.getOpEditHandler().sendEmptyMessage(0);
}
Also used : OutPara(com.tencent.wstt.gt.OutPara) ArrayList(java.util.ArrayList) Client(com.tencent.wstt.gt.manager.Client)

Aggregations

OutPara (com.tencent.wstt.gt.OutPara)30 Client (com.tencent.wstt.gt.manager.Client)4 ArrayList (java.util.ArrayList)4 TagTimeEntry (com.tencent.wstt.gt.ui.model.TagTimeEntry)3 CommonString (com.tencent.wstt.gt.utils.CommonString)3 NetUtils (com.tencent.wstt.gt.api.utils.NetUtils)2 ParamConst (com.tencent.wstt.gt.manager.ParamConst)2 Intent (android.content.Intent)1 Message (android.os.Message)1 View (android.view.View)1 TextView (android.widget.TextView)1 AidlEntry (com.tencent.wstt.gt.AidlEntry)1 InPara (com.tencent.wstt.gt.InPara)1 GTMainActivity (com.tencent.wstt.gt.activity.GTMainActivity)1 CpuUtils (com.tencent.wstt.gt.api.utils.CpuUtils)1 GWSaveEntry (com.tencent.wstt.gt.log.GWSaveEntry)1