001package Torello.Browser.BrowserAPI;
002
003// *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
004// Java-HTML Imports
005// *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
006
007import Torello.Browser.*;
008import Torello.Browser.helper.*;
009import Torello.Browser.JavaScriptAPI.*;
010import Torello.JSON.*;
011
012import Torello.Java.ReadOnly.ReadOnlyList;
013import Torello.Java.ReadOnly.ReadOnlyArrayList;
014
015import Torello.JavaDoc.Annotations.StaticFunctional;
016import Torello.JavaDoc.Annotations.JDHeaderBackgroundImg;
017
018import Torello.Browser.BrowserAPI.NestedHelpers.Commands.Tracing$$Commands;
019
020
021// *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
022// JDK Imports
023// *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
024
025import javax.json.JsonObject;
026import javax.json.JsonValue;
027
028/**
029 * <SPAN CLASS=COPIEDJDK><B><CODE>[No Description Provided by Google]</CODE></B></SPAN>
030 * <EMBED CLASS='external-html' DATA-FILE-ID=CDP.CODE_GEN_NOTE>
031 */
032@StaticFunctional@JDHeaderBackgroundImg(EmbedTagFileID="CDP.WOOD_PLANK_NOTE")
033public class Tracing
034{
035    // No Pubic Constructors
036    private Tracing() { }
037
038
039    // ********************************************************************************************
040    // ********************************************************************************************
041    // Eliminated Types
042    // ********************************************************************************************
043    // ********************************************************************************************
044
045
046    /**
047     * Configuration for memory dump. Used only when "memory-infra" category is enabled.
048     * 
049     * <BR /><B CLASS=Exp-Top>EXPERIMENTAL</B>
050
051     * <EMBED CLASS='external-html' DATA-CTAS='JsonValue' DATA-FILE-ID=CDP.EliminatedType
052     *     DATA-NAME=MemoryDumpConfig>
053     */
054    public static final String MemoryDumpConfig =
055        "MemoryDumpConfig has been eliminated.\n" +
056        "It was replaced with the standard Java-Type: JsonValue";
057
058
059    // ********************************************************************************************
060    // ********************************************************************************************
061    // Enumerated String Constants Lists
062    // ********************************************************************************************
063    // ********************************************************************************************
064
065
066    /**
067     * Details exposed when memory request explicitly declared.
068     * Keep consistent with memory_dump_request_args.h and
069     * memory_instrumentation.mojom
070     * 
071     * <BR /><B CLASS=Exp-Top>EXPERIMENTAL</B>
072     * <BR /><BR /><B CLASS=StrEnumType>String-Enumeration Type</B>
073     */
074    public static final ReadOnlyList<String> MemoryDumpLevelOfDetail = new ReadOnlyArrayList<>
075        (String.class, "background", "detailed", "light");
076
077    /**
078     * Compression type to use for traces returned via streams.
079     * 
080     * <BR /><B CLASS=Exp-Top>EXPERIMENTAL</B>
081     * <BR /><BR /><B CLASS=StrEnumType>String-Enumeration Type</B>
082     */
083    public static final ReadOnlyList<String> StreamCompression = new ReadOnlyArrayList<>
084        (String.class, "gzip", "none");
085
086    /**
087     * Data format of a trace. Can be either the legacy JSON format or the
088     * protocol buffer format. Note that the JSON format will be deprecated soon.
089     * 
090     * <BR /><B CLASS=Exp-Top>EXPERIMENTAL</B>
091     * <BR /><BR /><B CLASS=StrEnumType>String-Enumeration Type</B>
092     */
093    public static final ReadOnlyList<String> StreamFormat = new ReadOnlyArrayList<>
094        (String.class, "json", "proto");
095
096    /**
097     * Backend type to use for tracing. <CODE>chrome</CODE> uses the Chrome-integrated
098     * tracing service and is supported on all platforms. <CODE>system</CODE> is only
099     * supported on Chrome OS and uses the Perfetto system tracing service.
100     * <CODE>auto</CODE> chooses <CODE>system</CODE> when the perfettoConfig provided to Tracing.start
101     * specifies at least one non-Chrome data source; otherwise uses <CODE>chrome</CODE>.
102     * 
103     * <BR /><B CLASS=Exp-Top>EXPERIMENTAL</B>
104     * <BR /><BR /><B CLASS=StrEnumType>String-Enumeration Type</B>
105     */
106    public static final ReadOnlyList<String> TracingBackend = new ReadOnlyArrayList<>
107        (String.class, "auto", "chrome", "system");
108
109
110
111    // ********************************************************************************************
112    // ********************************************************************************************
113    // Basic Types
114    // ********************************************************************************************
115    // ********************************************************************************************
116
117
118    /**
119     * <CODE>[No Description Provided by Google]</CODE>
120     * 
121     * <EMBED CLASS=globalDefs DATA-DOMAIN=Tracing DATA-API=BrowserAPI>
122     */
123    @JDHeaderBackgroundImg(EmbedTagFileID="CDP.NESTED_TYPE_JDHBI")
124    public static class TraceConfig
125        extends BaseType<TraceConfig>
126        implements java.io.Serializable
127    {
128        /** <EMBED CLASS='external-html' DATA-FILE-ID=SVUID> */
129        protected static final long serialVersionUID = 1;
130
131        private static final NestedHelper<Tracing.TraceConfig> singleton =
132            Torello.Browser.BrowserAPI.NestedHelpers.Types.
133                Tracing$$TraceConfig$$.singleton;
134
135        /**
136         * Controls how the trace buffer stores data. The default is <CODE>recordUntilFull</CODE>.
137         * <BR /><B CLASS=Opt-Top>OPTIONAL</B><B CLASS=Exp-Top>EXPERIMENTAL</B>
138         * <EMBED CLASS='external-html' DATA-D=Tracing DATA-C=TraceConfig DATA-F=recordMode DATA-FILE-ID=CDP.EL1>
139         * @see BaseType#enumStrList(String)
140         */
141        public final String recordMode;
142
143        /**
144         * Size of the trace buffer in kilobytes. If not specified or zero is passed, a default value
145         * of 200 MB would be used.
146         * <BR /><B CLASS=Opt-Top>OPTIONAL</B><B CLASS=Exp-Top>EXPERIMENTAL</B>
147         */
148        public final Number traceBufferSizeInKb;
149
150        /**
151         * Turns on JavaScript stack sampling.
152         * <BR /><B CLASS=Opt-Top>OPTIONAL</B><B CLASS=Exp-Top>EXPERIMENTAL</B>
153         */
154        public final Boolean enableSampling;
155
156        /**
157         * Turns on system tracing.
158         * <BR /><B CLASS=Opt-Top>OPTIONAL</B><B CLASS=Exp-Top>EXPERIMENTAL</B>
159         */
160        public final Boolean enableSystrace;
161
162        /**
163         * Turns on argument filter.
164         * <BR /><B CLASS=Opt-Top>OPTIONAL</B><B CLASS=Exp-Top>EXPERIMENTAL</B>
165         */
166        public final Boolean enableArgumentFilter;
167
168        /**
169         * Included category filters.
170         * <BR /><B CLASS=Opt-Top>OPTIONAL</B>
171         */
172        public final String[] includedCategories;
173
174        /**
175         * Excluded category filters.
176         * <BR /><B CLASS=Opt-Top>OPTIONAL</B>
177         */
178        public final String[] excludedCategories;
179
180        /**
181         * Configuration to synthesize the delays in tracing.
182         * <BR /><B CLASS=Opt-Top>OPTIONAL</B><B CLASS=Exp-Top>EXPERIMENTAL</B>
183         */
184        public final String[] syntheticDelays;
185
186        /**
187         * Configuration for memory dump triggers. Used only when "memory-infra" category is enabled.
188         * <BR /><B CLASS=Opt-Top>OPTIONAL</B><B CLASS=Exp-Top>EXPERIMENTAL</B>
189         */
190        public final JsonValue memoryDumpConfig;
191
192        /** Constructor.  Please review this class' fields for documentation. */
193        public TraceConfig(
194                ReadOnlyList<Boolean> isPresent, String recordMode, Number traceBufferSizeInKb,
195                Boolean enableSampling, Boolean enableSystrace, Boolean enableArgumentFilter,
196                String[] includedCategories, String[] excludedCategories, String[] syntheticDelays,
197                JsonValue memoryDumpConfig
198            )
199        {
200            super(singleton, Domains.Tracing, "TraceConfig", 9);
201
202            this.recordMode             = recordMode;
203            this.traceBufferSizeInKb    = traceBufferSizeInKb;
204            this.enableSampling         = enableSampling;
205            this.enableSystrace         = enableSystrace;
206            this.enableArgumentFilter   = enableArgumentFilter;
207            this.includedCategories     = includedCategories;
208            this.excludedCategories     = excludedCategories;
209            this.syntheticDelays        = syntheticDelays;
210            this.memoryDumpConfig       = memoryDumpConfig;
211
212            this.isPresent = (isPresent == null)
213                ? singleton.generateIsPresentList(this)
214                : THROWS.check(isPresent, 9, "Tracing.TraceConfig");
215        }
216
217        /** Creates an instance of this class from a {@link JsonObject}.*/
218        public static TraceConfig fromJSON(JsonObject jo)
219        { return singleton.fromJSON(jo); }
220
221        /** Returns this class's {@link NestedDescriptor} singleton-instance. class / type.*/
222        public static NestedDescriptor<TraceConfig> descriptor()
223        { return singleton.descriptor(); }
224    }
225
226
227    // ********************************************************************************************
228    // ********************************************************************************************
229    // Command-Return Types
230    // ********************************************************************************************
231    // ********************************************************************************************
232
233
234    /**
235     * Request a global memory dump.
236     * 
237     * <BR /><B CLASS=Exp-Top>EXPERIMENTAL</B>
238     * <EMBED CLASS=globalDefs DATA-DOMAIN=Tracing DATA-API=BrowserAPI DATA-CMD=requestMemoryDump>
239     * @see Tracing#requestMemoryDump
240     */
241    @JDHeaderBackgroundImg(EmbedTagFileID="CDP.NESTED_CMD_JDHBI")
242    public static class requestMemoryDump$$RET
243        extends BaseType<requestMemoryDump$$RET>
244        implements java.io.Serializable
245    {
246        /** <EMBED CLASS='external-html' DATA-FILE-ID=SVUID> */
247        protected static final long serialVersionUID = 1;
248
249        private static final NestedHelper<Tracing.requestMemoryDump$$RET> singleton =
250            Torello.Browser.BrowserAPI.NestedHelpers.CmdReturns.
251                Tracing$$requestMemoryDump$$RET.singleton;
252
253        /** GUID of the resulting global memory dump. */
254        public final String dumpGuid;
255
256        /** True iff the global memory dump succeeded. */
257        public final boolean success;
258
259        /** Constructor.  Please review this class' fields for documentation. */
260        public requestMemoryDump$$RET
261            (ReadOnlyList<Boolean> isPresent, String dumpGuid, boolean success)
262        {
263            super(singleton, Domains.Tracing, "requestMemoryDump", 2);
264
265            this.dumpGuid   = dumpGuid;
266            this.success    = success;
267
268            this.isPresent = (isPresent == null)
269                ? singleton.generateIsPresentList(this)
270                : THROWS.check(isPresent, 2, "Tracing.requestMemoryDump$$RET");
271        }
272
273        /** Creates an instance of this class from a {@link JsonObject}.*/
274        public static requestMemoryDump$$RET fromJSON(JsonObject jo)
275        { return singleton.fromJSON(jo); }
276
277        /** Returns this class's {@link NestedDescriptor} singleton-instance. class / type.*/
278        public static NestedDescriptor<requestMemoryDump$$RET> descriptor()
279        { return singleton.descriptor(); }
280    }
281
282
283    // ********************************************************************************************
284    // ********************************************************************************************
285    // Event Types
286    // ********************************************************************************************
287    // ********************************************************************************************
288
289
290    /**
291     * <CODE>[No Description Provided by Google]</CODE>
292     * 
293     * <BR /><B CLASS=Exp-Top>EXPERIMENTAL</B>
294     * <EMBED CLASS=globalDefs DATA-DOMAIN=Tracing DATA-API=BrowserAPI>
295     */
296    @JDHeaderBackgroundImg(EmbedTagFileID="CDP.NESTED_EVENT_JDHBI")
297    public static class bufferUsage
298        extends BrowserEvent<bufferUsage>
299        implements java.io.Serializable
300    {
301        /** <EMBED CLASS='external-html' DATA-FILE-ID=SVUID> */
302        protected static final long serialVersionUID = 1;
303
304        private static final NestedHelper<Tracing.bufferUsage> singleton =
305            Torello.Browser.BrowserAPI.NestedHelpers.Events.
306                Tracing$$bufferUsage$$.singleton;
307
308        /**
309         * A number in range [0..1] that indicates the used size of event buffer as a fraction of its
310         * total size.
311         * <BR /><B CLASS=Opt-Top>OPTIONAL</B>
312         */
313        public final Number percentFull;
314
315        /**
316         * An approximate number of events in the trace log.
317         * <BR /><B CLASS=Opt-Top>OPTIONAL</B>
318         */
319        public final Number eventCount;
320
321        /**
322         * A number in range [0..1] that indicates the used size of event buffer as a fraction of its
323         * total size.
324         * <BR /><B CLASS=Opt-Top>OPTIONAL</B>
325         */
326        public final Number value;
327
328        /** Constructor.  Please review this class' fields for documentation. */
329        public bufferUsage
330            (ReadOnlyList<Boolean> isPresent, Number percentFull, Number eventCount, Number value)
331        {
332            super(singleton, Domains.Tracing, "bufferUsage", 3);
333
334            this.percentFull    = percentFull;
335            this.eventCount     = eventCount;
336            this.value          = value;
337
338            this.isPresent = (isPresent == null)
339                ? singleton.generateIsPresentList(this)
340                : THROWS.check(isPresent, 3, "Tracing.bufferUsage");
341        }
342
343        /** Creates an instance of this class from a {@link JsonObject}.*/
344        public static bufferUsage fromJSON(JsonObject jo)
345        { return singleton.fromJSON(jo); }
346
347        /** Returns this class's {@link NestedDescriptor} singleton-instance. class / type.*/
348        public static NestedDescriptor<bufferUsage> descriptor()
349        { return singleton.descriptor(); }
350    }
351
352    /**
353     * Contains a bucket of collected trace events. When tracing is stopped collected events will be
354     * sent as a sequence of dataCollected events followed by tracingComplete event.
355     * 
356     * <BR /><B CLASS=Exp-Top>EXPERIMENTAL</B>
357     * <EMBED CLASS=globalDefs DATA-DOMAIN=Tracing DATA-API=BrowserAPI>
358     */
359    @JDHeaderBackgroundImg(EmbedTagFileID="CDP.NESTED_EVENT_JDHBI")
360    public static class dataCollected
361        extends BrowserEvent<dataCollected>
362        implements java.io.Serializable
363    {
364        /** <EMBED CLASS='external-html' DATA-FILE-ID=SVUID> */
365        protected static final long serialVersionUID = 1;
366
367        private static final NestedHelper<Tracing.dataCollected> singleton =
368            Torello.Browser.BrowserAPI.NestedHelpers.Events.
369                Tracing$$dataCollected$$.singleton;
370
371        /** <CODE>[No Description Provided by Google]</CODE> */
372        public final JsonValue value;
373
374        /** Constructor.  Please review this class' fields for documentation. */
375        public dataCollected(ReadOnlyList<Boolean> isPresent, JsonValue value)
376        {
377            super(singleton, Domains.Tracing, "dataCollected", 1);
378
379            this.value = value;
380
381            this.isPresent = (isPresent == null)
382                ? singleton.generateIsPresentList(this)
383                : THROWS.check(isPresent, 1, "Tracing.dataCollected");
384        }
385
386        /** Creates an instance of this class from a {@link JsonObject}.*/
387        public static dataCollected fromJSON(JsonObject jo)
388        { return singleton.fromJSON(jo); }
389
390        /** Returns this class's {@link NestedDescriptor} singleton-instance. class / type.*/
391        public static NestedDescriptor<dataCollected> descriptor()
392        { return singleton.descriptor(); }
393    }
394
395    /**
396     * Signals that tracing is stopped and there is no trace buffers pending flush, all data were
397     * delivered via dataCollected events.
398     * 
399     * <EMBED CLASS=globalDefs DATA-DOMAIN=Tracing DATA-API=BrowserAPI>
400     */
401    @JDHeaderBackgroundImg(EmbedTagFileID="CDP.NESTED_EVENT_JDHBI")
402    public static class tracingComplete
403        extends BrowserEvent<tracingComplete>
404        implements java.io.Serializable
405    {
406        /** <EMBED CLASS='external-html' DATA-FILE-ID=SVUID> */
407        protected static final long serialVersionUID = 1;
408
409        private static final NestedHelper<Tracing.tracingComplete> singleton =
410            Torello.Browser.BrowserAPI.NestedHelpers.Events.
411                Tracing$$tracingComplete$$.singleton;
412
413        /**
414         * Indicates whether some trace data is known to have been lost, e.g. because the trace ring
415         * buffer wrapped around.
416         */
417        public final boolean dataLossOccurred;
418
419        /**
420         * A handle of the stream that holds resulting trace data.
421         * <BR /><B CLASS=Opt-Top>OPTIONAL</B>
422         */
423        public final String stream;
424
425        /**
426         * Trace data format of returned stream.
427         * <BR /><B CLASS=Opt-Top>OPTIONAL</B>
428         * <EMBED CLASS='external-html' DATA-D=Tracing DATA-C=StreamFormat DATA-F=traceFormat DATA-FILE-ID=CDP.EL2>
429         * @see BaseType#enumStrList(String)
430         */
431        public final String traceFormat;
432
433        /**
434         * Compression format of returned stream.
435         * <BR /><B CLASS=Opt-Top>OPTIONAL</B>
436         * <EMBED CLASS='external-html' DATA-D=Tracing DATA-C=StreamCompression DATA-F=streamCompression DATA-FILE-ID=CDP.EL2>
437         * @see BaseType#enumStrList(String)
438         */
439        public final String streamCompression;
440
441        /** Constructor.  Please review this class' fields for documentation. */
442        public tracingComplete(
443                ReadOnlyList<Boolean> isPresent, boolean dataLossOccurred, String stream,
444                String traceFormat, String streamCompression
445            )
446        {
447            super(singleton, Domains.Tracing, "tracingComplete", 4);
448
449            this.dataLossOccurred   = dataLossOccurred;
450            this.stream             = stream;
451            this.traceFormat        = traceFormat;
452            this.streamCompression  = streamCompression;
453
454            this.isPresent = (isPresent == null)
455                ? singleton.generateIsPresentList(this)
456                : THROWS.check(isPresent, 4, "Tracing.tracingComplete");
457        }
458
459        /** Creates an instance of this class from a {@link JsonObject}.*/
460        public static tracingComplete fromJSON(JsonObject jo)
461        { return singleton.fromJSON(jo); }
462
463        /** Returns this class's {@link NestedDescriptor} singleton-instance. class / type.*/
464        public static NestedDescriptor<tracingComplete> descriptor()
465        { return singleton.descriptor(); }
466    }
467
468
469
470
471    // ********************************************************************************************
472    // ********************************************************************************************
473    // Commands
474    // ********************************************************************************************
475    // ********************************************************************************************
476
477
478    /**
479     * Stop trace events collection.
480     * 
481     * @return An instance of <CODE>{@link Script}&lt;Void&gt;</CODE>
482     *
483     * <BR /><BR />This {@code Script} instance must be <B STYLE='color:red'>executed</B> before the
484     * browser receives the invocation-request.
485     *
486     * <BR /><BR /><DIV CLASS=JDHint>
487     * This Browser-Function <I>does not have</I> a return-value.  You may choose to
488     * <B STYLE='color: red'>await</B> the {@link Promise}{@code <Void>} to ensure that
489     * the Browser Function has run to completion.
490     * </DIV>
491     */
492    public static Script<Void> end()
493    {
494        // Ultra-Simple Request JSON - Because this method has no parameters
495        final String requestJSON = "{\"method\":\"Tracing.end\"}";
496
497        return Script.NO_RET(Domains.Tracing, "end", requestJSON);
498    }
499
500    /**
501     * Gets supported tracing categories.
502     * 
503     * <BR /><B CLASS=Exp-Top>EXPERIMENTAL</B>
504     * 
505     * @return An instance of <CODE>{@link Script}&lt;String[]&gt;</CODE>
506     * 
507     * <BR /><BR />This <B>script</B> may be <B STYLE='color: red'>executed</B>, using
508     * {@link Script#exec(WebSocketSender) Script.exec}, and afterwards, a {@link Promise}
509     * <CODE>&lt;String[]&gt;</CODE> will be returned
510     *
511     * <BR /><BR />Finally, the <B>{@code Promise}</B> may be <B STYLE='color: red'>awaited</B>,
512     * using {@link Promise#await()}, <I>and the returned result of this Browser Function may
513     * be retrieved.</I>
514     *
515     * <BR /><BR /><DIV CLASS=JDHint>
516     * This Browser Function's {@code Promise} returns:
517     * <CODE>String[] (<B>categories</B>)</CODE>
518     * <BR />
519     * A list of supported tracing categories.
520     * </DIV>
521     */
522    public static Script<String[]> getCategories()
523    {
524        // Ultra-Simple Request JSON - Because this method has no parameters
525        final String requestJSON = "{\"method\":\"Tracing.getCategories\"}";
526
527        return new Script<>(
528            Domains.Tracing, "getCategories", requestJSON,
529            Tracing$$Commands::getCategories,
530            String[].class
531        );
532    }
533
534    /**
535     * Record a clock sync marker in the trace.
536     * 
537     * <BR /><B CLASS=Exp-Top>EXPERIMENTAL</B>
538     * 
539     * @param syncId The ID of this clock sync marker
540     * 
541     * @return An instance of <CODE>{@link Script}&lt;Void&gt;</CODE>
542     *
543     * <BR /><BR />This {@code Script} instance must be <B STYLE='color:red'>executed</B> before the
544     * browser receives the invocation-request.
545     *
546     * <BR /><BR /><DIV CLASS=JDHint>
547     * This Browser-Function <I>does not have</I> a return-value.  You may choose to
548     * <B STYLE='color: red'>await</B> the {@link Promise}{@code <Void>} to ensure that
549     * the Browser Function has run to completion.
550     * </DIV>
551     */
552    public static Script<Void> recordClockSyncMarker(String syncId)
553    {
554        // Build the JSON Request-Object (as a String); only 1 Parameter is passed
555        final String requestJSON = WriteJSON.get
556            (CDPTypes.STRING, "syncId", false, "Tracing.recordClockSyncMarker", syncId);
557
558        return Script.NO_RET(Domains.Tracing, "recordClockSyncMarker", requestJSON);
559    }
560
561    /**
562     * Request a global memory dump.
563     * 
564     * <BR /><B CLASS=Exp-Top>EXPERIMENTAL</B>
565     * 
566     * @param deterministic Enables more deterministic results by forcing garbage collection
567     * <BR /><B CLASS=Opt-Top>OPTIONAL</B>
568     * 
569     * @param levelOfDetail Specifies level of details in memory dump. Defaults to "detailed".
570     * <BR /><B CLASS=Opt-Top>OPTIONAL</B>
571     * 
572     * @return An instance of <CODE>{@link Script}&lt;{@link requestMemoryDump$$RET}&gt;</CODE>
573     * 
574     * <BR /><BR />This <B>script</B> may be <B STYLE='color: red'>executed</B>, using
575     * {@link Script#exec(WebSocketSender) Script.exec}, and afterwards, a {@link Promise}
576     * <CODE>&lt;{@link requestMemoryDump$$RET}&gt;</CODE> will be returned
577     *
578     * <BR /><BR />Finally, the <B>{@code Promise}</B> may be <B STYLE='color: red'>awaited</B>,
579     * using {@link Promise#await()}, <I>and the returned result of this Browser Function may
580     * be retrieved.</I>
581     *
582     * <BR /><BR /><DIV CLASS=JDHint>
583     * This Browser Function's {@code Promise} returns:{@link requestMemoryDump$$RET}
584     * A dedicated return type implies that the browser may return more than 1 datum
585     * </DIV>
586     */
587    public static Script<requestMemoryDump$$RET> requestMemoryDump
588        (Boolean deterministic, String levelOfDetail)
589    {
590        // Convert all Method Parameters into a JSON Request-Object (as a String)
591        final String requestJSON = WriteJSON.get(
592            Tracing$$Commands.requestMemoryDump$$, "Tracing.requestMemoryDump",
593            deterministic, levelOfDetail
594        );
595
596        return new Script<>(
597            Domains.Tracing, "requestMemoryDump", requestJSON,
598            requestMemoryDump$$RET::fromJSON,
599            requestMemoryDump$$RET.class
600        );
601    }
602
603    /**
604     * Start trace events collection.
605     * 
606     * <BR /><BR /><DIV CLASS=JDHint>
607     * 👍 Because of the sheer number of input parameters to this method, there is a
608     * a {@link CommandBuilder} variant to this method which may be invoked instead.
609     * 
610     * <BR /><BR />
611     * Please View: {@link #start()}
612     * </DIV>
613     * 
614     * @param categories Category/tag filter
615     * <BR /><B CLASS=Opt-Top>OPTIONAL</B><B CLASS=Exp-Top>EXPERIMENTAL</B><B CLASS=Dep-Top>DEPRECATED</B>
616     * 
617     * @param options Tracing options
618     * <BR /><B CLASS=Opt-Top>OPTIONAL</B><B CLASS=Exp-Top>EXPERIMENTAL</B><B CLASS=Dep-Top>DEPRECATED</B>
619     * 
620     * @param bufferUsageReportingInterval If set, the agent will issue bufferUsage events at this interval, specified in milliseconds
621     * <BR /><B CLASS=Opt-Top>OPTIONAL</B><B CLASS=Exp-Top>EXPERIMENTAL</B>
622     * 
623     * @param transferMode 
624     * Whether to report trace events as series of dataCollected events or to save trace to a
625     * stream (defaults to <CODE>ReportEvents</CODE>).
626     * <BR />Acceptable Values: ["ReportEvents", "ReturnAsStream"]
627     * <BR /><B CLASS=Opt-Top>OPTIONAL</B>
628     * 
629     * @param streamFormat 
630     * Trace data format to use. This only applies when using <CODE>ReturnAsStream</CODE>
631     * transfer mode (defaults to <CODE>json</CODE>).
632     * <BR /><B CLASS=Opt-Top>OPTIONAL</B>
633     * 
634     * @param streamCompression 
635     * Compression format to use. This only applies when using <CODE>ReturnAsStream</CODE>
636     * transfer mode (defaults to <CODE>none</CODE>)
637     * <BR /><B CLASS=Opt-Top>OPTIONAL</B><B CLASS=Exp-Top>EXPERIMENTAL</B>
638     * 
639     * @param traceConfig -
640     * <BR /><B CLASS=Opt-Top>OPTIONAL</B>
641     * 
642     * @param perfettoConfig 
643     * Base64-encoded serialized perfetto.protos.TraceConfig protobuf message
644     * When specified, the parameters <CODE>categories</CODE>, <CODE>options</CODE>, <CODE>traceConfig</CODE>
645     * are ignored. (Encoded as a base64 string when passed over JSON)
646     * <BR /><B CLASS=Opt-Top>OPTIONAL</B><B CLASS=Exp-Top>EXPERIMENTAL</B>
647     * 
648     * @param tracingBackend Backend type (defaults to <CODE>auto</CODE>)
649     * <BR /><B CLASS=Opt-Top>OPTIONAL</B><B CLASS=Exp-Top>EXPERIMENTAL</B>
650     * 
651     * @return An instance of <CODE>{@link Script}&lt;Void&gt;</CODE>
652     *
653     * <BR /><BR />This {@code Script} instance must be <B STYLE='color:red'>executed</B> before the
654     * browser receives the invocation-request.
655     *
656     * <BR /><BR /><DIV CLASS=JDHint>
657     * This Browser-Function <I>does not have</I> a return-value.  You may choose to
658     * <B STYLE='color: red'>await</B> the {@link Promise}{@code <Void>} to ensure that
659     * the Browser Function has run to completion.
660     * </DIV>
661     */
662    public static Script<Void> start(
663            String categories, String options, Number bufferUsageReportingInterval,
664            String transferMode, String streamFormat, String streamCompression,
665            TraceConfig traceConfig, String perfettoConfig, String tracingBackend
666        )
667    {
668        // Convert all Method Parameters into a JSON Request-Object (as a String)
669        final String requestJSON = WriteJSON.get(
670            Tracing$$Commands.start$$, "Tracing.start",
671            categories, options, bufferUsageReportingInterval, transferMode, streamFormat,
672            streamCompression, traceConfig, perfettoConfig, tracingBackend
673        );
674
675        return Script.NO_RET(Domains.Tracing, "start", requestJSON);
676    }
677
678
679    // ********************************************************************************************
680    // ********************************************************************************************
681    // CommandBuilder Getter-Methods
682    // ********************************************************************************************
683    // ********************************************************************************************
684
685
686    /**
687     * Creates a buider for conveniently assigning parameters to this method.
688     * 
689     * <BR /><BR /><DIV CLASS=JDHint>
690     * Note that the original method expects 9 parameters, and can be cumbersome.
691     * </DIV>
692     * 
693     * @return {@link CommandBuilder} instance, for assigning parameter values, one by one.
694     * @see #start
695     */
696    public static CommandBuilder<Void> start()
697    { return CommandBuilder.builder(Tracing$$Commands.start$$); }
698
699
700}