Interface ITracePoint
interface ITracePoint
Extends com.amazon.apmf.IStandard
ITracePoint interface extends ITraceCategory to add new API calls.
Tracepoints emitted with this interface can be emitted in three ways:
Instant: A tracepoint at an instant of type, depicted as an arrow on Perfetto
Begin->End: A tracepoint representing a block of time, depicted
as a rectangle on Perfetto. These two functions must be called in order.
To use this interface, pass in any wanted parameters to args,
timestamp, flowId, and terminateFlowId then call one of the
three emit methods above. After calling any of these emit methods,
all passed in data will be reset for the next tracepoint emission.
Methods
args()
Sets the args of tracepoint for ITracePoint. Note: When using end(), passing the same key will overwrite the value passed in begin()ITracePoint*args(string[]args)
Parameters
args
string[] — Required
Debug arguments that must come as a key-value pair.
Returns
ITracePoint*
ITracePoint with set args.
timestamp()
Sets the timestamp of tracepoint for ITracePointITracePoint*timestamp(u64timestamp,ClockTypeclock)
Parameters
timestamp
u64 — Required
Timestamp of tracepoint.
clock
ClockType — Required
ClockType enum used to set Perfetto clock type.
Returns
ITracePoint*
ITracePoint with set timestamp.
flowId()
Sets the flow Id of tracepoint for ITracePoint. Tracepoints with the same flow Id will be connected on the UI by an arrow. This can be used in conjunction with terminateFlowId to start a new flow and end a previous one.ITracePoint*flowId(i64flowId,ScopeTypescope)
Parameters
flowId
i64 — Required
Id to denote that two (or more) tracepoints are related.
scope
ScopeType — Required
ScopeType enum used to declare if globally or process scoped.
Returns
ITracePoint*
ITracePoint with set flowId.
terminateFlowId()
Sets the flow ID to terminate of tracepoint for ITracePoint, releasing the Id to be reused. This can be used in conjunction with flowId to start a new flow and end a previous one.ITracePoint*terminateFlowId(i64flowId,ScopeTypescope)
Parameters
flowId
i64 — Required
The Id of the Flow to terminate.
scope
ScopeType — Required
ScopeType enum used to declare if globally or process scoped.
Returns
ITracePoint*
ITracePoint with set terminateFlowId.
begin()
void begin()
Creates a tracepoint with trace_type “begin”, along with
the set parameters from ITracePointBuilder. Any following “end”
method will mark the end of this emitted tracepoint.
Note when emitting a tracepoint, the values passed for args,
timestamp, flowId, and terminateFlowId will be reset afterwards
Setting a cookie will be similar to calling async tracepoints
Setting a timestamp will be similar to calling offset tracepoints
Setting a flowID will be similar to call flow tracepoints
Tracepoints emitted using this method should include a name and
args set through ITracePointBuilder.
end()
void end()
Creates a tracepoint with trace_type “end”, along with
the set parameters from ITracePointBuilder. Any preceeding “begin”
method will be ended by this emitted tracepoint. If a “begin”
tracepoint is not terminated by an “end” tracepoint, the “begin”
tracepoint will go on until the end of the tracefile
Note, when emitting a tracepoint, the values passed for args,
timestamp, flowId, and terminateFlowId will be reset afterwards
Setting a cookie will be similar to calling async tracepoints
Setting a timestamp will be similar to calling offset tracepoints
Setting a flowID will be similar to call flow tracepoints
instant()
void instant()
Creates a tracepoint with trace_type “instant”, along with
the set parameters from ITracePointBuilder.
Note, when emitting a tracepoint, the values passed for args,
timestamp, flowId, and terminateFlowId will be reset afterwards
Setting a cookie will be similar to calling async tracepoints
Setting a timestamp will be similar to calling offset tracepoints
Setting a flowID will be similar to call flow tracepoints
Tracepoints emitted using this method should include a name and
args set through ITracePointBuilder.

