// Package profiler provides the Chrome DevTools Protocol // commands, types, and events for the Profiler domain. // // Generated by the cdproto-gen command.
package profiler // Code generated by cdproto-gen. DO NOT EDIT. import ( ) // DisableParams [no description]. type DisableParams struct{} // Disable [no description]. // // See: https://chromedevtools.github.io/devtools-protocol/tot/Profiler#method-disable func () *DisableParams { return &DisableParams{} } // Do executes Profiler.disable against the provided context. func ( *DisableParams) ( context.Context) ( error) { return cdp.Execute(, CommandDisable, nil, nil) } // EnableParams [no description]. type EnableParams struct{} // Enable [no description]. // // See: https://chromedevtools.github.io/devtools-protocol/tot/Profiler#method-enable func () *EnableParams { return &EnableParams{} } // Do executes Profiler.enable against the provided context. func ( *EnableParams) ( context.Context) ( error) { return cdp.Execute(, CommandEnable, nil, nil) } // GetBestEffortCoverageParams collect coverage data for the current isolate. // The coverage data may be incomplete due to garbage collection. type GetBestEffortCoverageParams struct{} // GetBestEffortCoverage collect coverage data for the current isolate. The // coverage data may be incomplete due to garbage collection. // // See: https://chromedevtools.github.io/devtools-protocol/tot/Profiler#method-getBestEffortCoverage func () *GetBestEffortCoverageParams { return &GetBestEffortCoverageParams{} } // GetBestEffortCoverageReturns return values. type GetBestEffortCoverageReturns struct { Result []*ScriptCoverage `json:"result,omitempty"` // Coverage data for the current isolate. } // Do executes Profiler.getBestEffortCoverage against the provided context. // // returns: // // result - Coverage data for the current isolate. func ( *GetBestEffortCoverageParams) ( context.Context) ( []*ScriptCoverage, error) { // execute var GetBestEffortCoverageReturns = cdp.Execute(, CommandGetBestEffortCoverage, nil, &) if != nil { return nil, } return .Result, nil } // SetSamplingIntervalParams changes CPU profiler sampling interval. Must be // called before CPU profiles recording started. type SetSamplingIntervalParams struct { Interval int64 `json:"interval"` // New sampling interval in microseconds. } // SetSamplingInterval changes CPU profiler sampling interval. Must be called // before CPU profiles recording started. // // See: https://chromedevtools.github.io/devtools-protocol/tot/Profiler#method-setSamplingInterval // // parameters: // // interval - New sampling interval in microseconds. func ( int64) *SetSamplingIntervalParams { return &SetSamplingIntervalParams{ Interval: , } } // Do executes Profiler.setSamplingInterval against the provided context. func ( *SetSamplingIntervalParams) ( context.Context) ( error) { return cdp.Execute(, CommandSetSamplingInterval, , nil) } // StartParams [no description]. type StartParams struct{} // Start [no description]. // // See: https://chromedevtools.github.io/devtools-protocol/tot/Profiler#method-start func () *StartParams { return &StartParams{} } // Do executes Profiler.start against the provided context. func ( *StartParams) ( context.Context) ( error) { return cdp.Execute(, CommandStart, nil, nil) } // StartPreciseCoverageParams enable precise code coverage. Coverage data for // JavaScript executed before enabling precise code coverage may be incomplete. // Enabling prevents running optimized code and resets execution counters. type StartPreciseCoverageParams struct { CallCount bool `json:"callCount,omitempty"` // Collect accurate call counts beyond simple 'covered' or 'not covered'. Detailed bool `json:"detailed,omitempty"` // Collect block-based coverage. AllowTriggeredUpdates bool `json:"allowTriggeredUpdates,omitempty"` // Allow the backend to send updates on its own initiative } // StartPreciseCoverage enable precise code coverage. Coverage data for // JavaScript executed before enabling precise code coverage may be incomplete. // Enabling prevents running optimized code and resets execution counters. // // See: https://chromedevtools.github.io/devtools-protocol/tot/Profiler#method-startPreciseCoverage // // parameters: func () *StartPreciseCoverageParams { return &StartPreciseCoverageParams{} } // WithCallCount collect accurate call counts beyond simple 'covered' or 'not // covered'. func ( StartPreciseCoverageParams) ( bool) *StartPreciseCoverageParams { .CallCount = return & } // WithDetailed collect block-based coverage. func ( StartPreciseCoverageParams) ( bool) *StartPreciseCoverageParams { .Detailed = return & } // WithAllowTriggeredUpdates allow the backend to send updates on its own // initiative. func ( StartPreciseCoverageParams) ( bool) *StartPreciseCoverageParams { .AllowTriggeredUpdates = return & } // StartPreciseCoverageReturns return values. type StartPreciseCoverageReturns struct { Timestamp float64 `json:"timestamp,omitempty"` // Monotonically increasing time (in seconds) when the coverage update was taken in the backend. } // Do executes Profiler.startPreciseCoverage against the provided context. // // returns: // // timestamp - Monotonically increasing time (in seconds) when the coverage update was taken in the backend. func ( *StartPreciseCoverageParams) ( context.Context) ( float64, error) { // execute var StartPreciseCoverageReturns = cdp.Execute(, CommandStartPreciseCoverage, , &) if != nil { return 0, } return .Timestamp, nil } // StopParams [no description]. type StopParams struct{} // Stop [no description]. // // See: https://chromedevtools.github.io/devtools-protocol/tot/Profiler#method-stop func () *StopParams { return &StopParams{} } // StopReturns return values. type StopReturns struct { Profile *Profile `json:"profile,omitempty"` // Recorded profile. } // Do executes Profiler.stop against the provided context. // // returns: // // profile - Recorded profile. func ( *StopParams) ( context.Context) ( *Profile, error) { // execute var StopReturns = cdp.Execute(, CommandStop, nil, &) if != nil { return nil, } return .Profile, nil } // StopPreciseCoverageParams disable precise code coverage. Disabling // releases unnecessary execution count records and allows executing optimized // code. type StopPreciseCoverageParams struct{} // StopPreciseCoverage disable precise code coverage. Disabling releases // unnecessary execution count records and allows executing optimized code. // // See: https://chromedevtools.github.io/devtools-protocol/tot/Profiler#method-stopPreciseCoverage func () *StopPreciseCoverageParams { return &StopPreciseCoverageParams{} } // Do executes Profiler.stopPreciseCoverage against the provided context. func ( *StopPreciseCoverageParams) ( context.Context) ( error) { return cdp.Execute(, CommandStopPreciseCoverage, nil, nil) } // TakePreciseCoverageParams collect coverage data for the current isolate, // and resets execution counters. Precise code coverage needs to have started. type TakePreciseCoverageParams struct{} // TakePreciseCoverage collect coverage data for the current isolate, and // resets execution counters. Precise code coverage needs to have started. // // See: https://chromedevtools.github.io/devtools-protocol/tot/Profiler#method-takePreciseCoverage func () *TakePreciseCoverageParams { return &TakePreciseCoverageParams{} } // TakePreciseCoverageReturns return values. type TakePreciseCoverageReturns struct { Result []*ScriptCoverage `json:"result,omitempty"` // Coverage data for the current isolate. Timestamp float64 `json:"timestamp,omitempty"` // Monotonically increasing time (in seconds) when the coverage update was taken in the backend. } // Do executes Profiler.takePreciseCoverage against the provided context. // // returns: // // result - Coverage data for the current isolate. // timestamp - Monotonically increasing time (in seconds) when the coverage update was taken in the backend. func ( *TakePreciseCoverageParams) ( context.Context) ( []*ScriptCoverage, float64, error) { // execute var TakePreciseCoverageReturns = cdp.Execute(, CommandTakePreciseCoverage, nil, &) if != nil { return nil, 0, } return .Result, .Timestamp, nil } // Command names. const ( CommandDisable = "Profiler.disable" CommandEnable = "Profiler.enable" CommandGetBestEffortCoverage = "Profiler.getBestEffortCoverage" CommandSetSamplingInterval = "Profiler.setSamplingInterval" CommandStart = "Profiler.start" CommandStartPreciseCoverage = "Profiler.startPreciseCoverage" CommandStop = "Profiler.stop" CommandStopPreciseCoverage = "Profiler.stopPreciseCoverage" CommandTakePreciseCoverage = "Profiler.takePreciseCoverage" )