Search in sources :

Example 11 with TagTimeEntry

use of com.tencent.wstt.gt.ui.model.TagTimeEntry in project GT by Tencent.

the class GTMemoryDaemonThread method doTask.

@Override
void doTask() {
    int total = 0;
    TagTimeEntry[] opPerfDatas = OpPerfBridge.getAllProfilerData();
    for (TagTimeEntry tte : opPerfDatas) {
        int single = 0;
        if (tte.hasChild()) {
            single = tte.getChildren()[0].getRecordSize();
            // 总值计算时,复数要乘倍数
            total += single * tte.getChildren().length;
        } else {
            single = tte.getRecordSize();
            total += single;
        }
        validSingleLimit(single, tte);
    }
    if (// gw部分已经超一级警戒了,prof部分就不需要看了
    !validTopLimit(total)) {
        return;
    }
    if (GTTime.isEnable()) {
        List<GroupTimeEntry> timeGroupList = GTTimeInternal.getAllGroup();
        for (GroupTimeEntry gte : timeGroupList) {
            for (TagTimeEntry tte : gte.entrys()) {
                int single = tte.getRecordSize();
                total += single;
            }
        }
    }
    if (// 先判断一级警戒,如果没有过一级警戒,才会判断二级警戒
    !validTopLimit(total)) {
        return;
    }
    if (// 先判断二级警戒,如果没有过二级警戒,才会判断三级警戒
    !validSecendLimit(total)) {
        return;
    }
    validThirdLimit(total);
}
Also used : TagTimeEntry(com.tencent.wstt.gt.ui.model.TagTimeEntry) GroupTimeEntry(com.tencent.wstt.gt.ui.model.GroupTimeEntry)

Example 12 with TagTimeEntry

use of com.tencent.wstt.gt.ui.model.TagTimeEntry in project GT by Tencent.

the class OpPerfBridge method startProfier.

public static void startProfier(OutPara outPara, int funcId, String desc, String unit) {
    if (outPara == null) {
        return;
    }
    outPara.hasMonitorOnce = true;
    TagTimeEntry profilerEntry = opPerfManager.get(outPara.getKey());
    if (null == profilerEntry) {
        profilerEntry = new TagTimeEntry(null);
        profilerEntry.setName(outPara.getKey());
        profilerEntry.setAlias(outPara.getAlias());
        profilerEntry.setFunctionId(funcId);
        profilerEntry.setDesc(desc);
        profilerEntry.setUnit(unit);
        profilerEntry.setExkey(ClientManager.getInstance().getClientKey(outPara.getClient()));
        opPerfManager.add(profilerEntry);
    }
}
Also used : TagTimeEntry(com.tencent.wstt.gt.ui.model.TagTimeEntry)

Example 13 with TagTimeEntry

use of com.tencent.wstt.gt.ui.model.TagTimeEntry in project GT by Tencent.

the class OpPerfBridge method setThreshold.

public static void setThreshold(String key, ThresholdEntry threshold) {
    TagTimeEntry profilerEntry = opPerfManager.get(key);
    if (null == profilerEntry) {
        return;
    }
    profilerEntry.setThresholdEntry(threshold);
}
Also used : TagTimeEntry(com.tencent.wstt.gt.ui.model.TagTimeEntry)

Example 14 with TagTimeEntry

use of com.tencent.wstt.gt.ui.model.TagTimeEntry in project GT by Tencent.

the class OpPerfBridge method startProfier.

/**
 * 多维的启动性能统计,在UI上也需要展示多条曲线
 * @param key
 * @param funcId
 */
public static void startProfier(OutPara outPara, String[] subKeys, int[] funcIds, String desc, String unit) {
    if (outPara == null) {
        return;
    }
    outPara.hasMonitorOnce = true;
    TagTimeEntry profilerEntry = opPerfManager.get(outPara.getKey());
    if (null == profilerEntry) {
        profilerEntry = new TagTimeEntry(null);
        profilerEntry.setName(outPara.getKey());
        profilerEntry.setAlias(outPara.getAlias());
        profilerEntry.setFunctionId(funcIds[0]);
        profilerEntry.setDesc(desc);
        profilerEntry.setUnit(unit);
        profilerEntry.setExkey(ClientManager.getInstance().getClientKey(outPara.getClient()));
        profilerEntry.initChildren(subKeys.length);
        int i = 0;
        for (TagTimeEntry subEntry : profilerEntry.getSubTagEntrys()) {
            subEntry.setName(subKeys[i]);
            subEntry.setFunctionId(funcIds[i]);
            i++;
        }
        opPerfManager.add(profilerEntry);
    }
}
Also used : TagTimeEntry(com.tencent.wstt.gt.ui.model.TagTimeEntry)

Example 15 with TagTimeEntry

use of com.tencent.wstt.gt.ui.model.TagTimeEntry in project GT by Tencent.

the class OpPerfBridge method setOutparaChangedListener.

public static void setOutparaChangedListener(String smName, ChangedListener changedListener) {
    TagTimeEntry tte = getProfilerData(smName);
    tte.setChangedListener(changedListener);
}
Also used : TagTimeEntry(com.tencent.wstt.gt.ui.model.TagTimeEntry)

Aggregations

TagTimeEntry (com.tencent.wstt.gt.ui.model.TagTimeEntry)35 GroupTimeEntry (com.tencent.wstt.gt.ui.model.GroupTimeEntry)11 TimeEntry (com.tencent.wstt.gt.ui.model.TimeEntry)5 File (java.io.File)5 FileWriter (java.io.FileWriter)5 IOException (java.io.IOException)5 Builder (android.app.AlertDialog.Builder)4 DialogInterface (android.content.DialogInterface)4 Intent (android.content.Intent)4 View (android.view.View)4 TextView (android.widget.TextView)4 ArrayList (java.util.ArrayList)4 Bundle (android.os.Bundle)3 OnClickListener (android.view.View.OnClickListener)3 ImageButton (android.widget.ImageButton)3 ImageView (android.widget.ImageView)3 LinearLayout (android.widget.LinearLayout)3 RelativeLayout (android.widget.RelativeLayout)3 OutPara (com.tencent.wstt.gt.OutPara)3 GWSaveEntry (com.tencent.wstt.gt.log.GWSaveEntry)3