public final class ByTrace extends Object
ByTrace logs.
This class traces the start, end, and value changes of key processes that last for at least 3 ms.
Example: To trace a name verification that is expected to complete within 5 ms:
ByTrace.startTrace("checkName", "5");
Bytrace.finishTrace("checkName");
To trace the number of layers, which is 3:
Bytrace.count("curLayer", 3);
Each startTrace matches one finishTrace, and they must have the same value.
| 限定符和类型 | 字段 | 说明 |
|---|---|---|
static long |
BYTRACE_TAG_APP |
Indicates a tag used by third parties.
|
| 构造器 | 说明 |
|---|---|
ByTrace() |
| 限定符和类型 | 方法 | 说明 |
|---|---|---|
static void |
countTrace(String name,
int count) |
Records a trace for generating a count, such as clock pulse and the number of layers.
|
static void |
finishTrace(String value) |
Records a trace and marks it as the end of a task.
|
static void |
startTrace(String value) |
Records a trace and marks it as the start of a task.
|
static void |
startTrace(String value,
float limit) |
Records a trace with the expected completion time and marks it as the start of a task.
|
static void |
updateTraceLabel() |
Updates the trace label when your process has started.
|
public static final long BYTRACE_TAG_APP
public static void updateTraceLabel()
public static void startTrace(String value, float limit)
value has started. The finishTrace(java.lang.String) method using the same value must be
invoked at the end of the transaction.value - Indicates the operation name.limit - Indicates the expected time required for completing the operation, in milliseconds.public static void startTrace(String value)
value has started. The finishTrace(java.lang.String) method using the same value must be
invoked at the end of the transaction.value - Indicates the operation name.public static void finishTrace(String value)
value has ended. This method must be invoked after the startTrace(java.lang.String,float) or
startTrace(java.lang.String) method is invoked.value - Indicates the operation name. It must be the same as the value of
startTrace(java.lang.String,float) or startTrace(java.lang.String).public static void countTrace(String name, int count)
name - Indicates the operation name.count - Indicates the count of the operation.