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);
}
}
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);
}
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;
}
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);
}
}
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);
}
Aggregations