CockpitDevToolsProfile constructor
CockpitDevToolsProfile({
- required String source,
- required String state,
- String? reason,
- CockpitCpuProfile? cpu,
- CockpitHeapProfile? heap,
- CockpitGcProfile? gc,
- CockpitGpuProfile? gpu,
- CockpitIsolateProfile? isolate,
- CockpitTimelineProfile? timeline,
- CockpitDisplayProfile? display,
- CockpitRebuildProfile? rebuild,
- CockpitVmRuntimeProfile? vm,
- CockpitVmMemoryProfile? vmMemory,
- Iterable<
CockpitAllocationTrace> allocationTraces = const <CockpitAllocationTrace>[], - Iterable<
CockpitVmLogEvent> logs = const <CockpitVmLogEvent>[], - Iterable<
CockpitVmDebugEvent> debug = const <CockpitVmDebugEvent>[], - int droppedLogs = 0,
- int droppedDebug = 0,
- CockpitPerfettoProfile? perfetto,
Implementation
CockpitDevToolsProfile({
required this.source,
required this.state,
this.reason,
this.cpu,
this.heap,
this.gc,
this.gpu,
this.isolate,
this.timeline,
this.display,
this.rebuild,
this.vm,
this.vmMemory,
Iterable<CockpitAllocationTrace> allocationTraces =
const <CockpitAllocationTrace>[],
Iterable<CockpitVmLogEvent> logs = const <CockpitVmLogEvent>[],
Iterable<CockpitVmDebugEvent> debug = const <CockpitVmDebugEvent>[],
this.droppedLogs = 0,
this.droppedDebug = 0,
this.perfetto,
}) : allocationTraces = List<CockpitAllocationTrace>.unmodifiable(
allocationTraces,
),
logs = List<CockpitVmLogEvent>.unmodifiable(logs),
debug = List<CockpitVmDebugEvent>.unmodifiable(debug) {
if (source.trim().isEmpty || state.trim().isEmpty) {
throw const FormatException('DevTools profile identity is invalid.');
}
if (reason != null && reason!.trim().isEmpty) {
throw const FormatException('DevTools profile reason is invalid.');
}
if (this.allocationTraces.length > 20) {
throw const FormatException('Allocation trace count is bounded.');
}
if (this.logs.length > 2000 || this.debug.length > 2000) {
throw const FormatException('VM event count is bounded.');
}
if (droppedLogs < 0 || droppedDebug < 0) {
throw const FormatException('VM event drop counts are invalid.');
}
}