Package io.flutter.util
Class TraceSection
java.lang.Object
io.flutter.util.TraceSection
- All Implemented Interfaces:
AutoCloseable
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
Wraps Trace.beginSection to ensure that the line length stays below 127 code units.static void
beginAsyncSection
(String sectionName, int cookie) Wraps Trace.beginAsyncSection to ensure that the line length stays below 127 code units.void
close()
static void
end()
Wraps Trace.endSection.static void
endAsyncSection
(String sectionName, int cookie) Wraps Trace.endAsyncSection to ensure that the line length stays below 127 code units.static TraceSection
Factory used to support the try-with-resource construct.
-
Method Details
-
scoped
Factory used to support the try-with-resource construct.To get scoped trace events, use the try-with-resource construct, for instance:
try (TraceSection e = TraceSection.scoped("MyTraceEvent")) { // code. }
-
close
public void close()- Specified by:
close
in interfaceAutoCloseable
-
begin
Wraps Trace.beginSection to ensure that the line length stays below 127 code units.- Parameters:
sectionName
- The string to display as the section name in the trace.
-
end
Wraps Trace.endSection.- Throws:
RuntimeException
-
beginAsyncSection
Wraps Trace.beginAsyncSection to ensure that the line length stays below 127 code units.- Parameters:
sectionName
- The string to display as the section name in the trace.cookie
- Unique integer defining the section.
-
endAsyncSection
Wraps Trace.endAsyncSection to ensure that the line length stays below 127 code units.
-