Package cs1302.tracer.execution
Record Class TraceResult
java.lang.Object
java.lang.Record
cs1302.tracer.execution.TraceResult
- Record Components:
schemaVersion- Envelope schema version.format- Payload format name.status- completed, stopped, or failed.stopReason- Machine-readable reason, or null on normal completion.phase- Phase at completion or failure.complete- Whether execution and capture completed normally.trace- Payload; null when unavailable, empty steps when capture ran without snapshots.limits- Effective trace policy.counters- Resource accounting and snapshot counters.diagnostics- Human-readable diagnostics; never an isolation attestation.stdout- Bounded guest standard output, decoded as UTF-8.stderr- Bounded guest standard error, decoded as UTF-8.
public record TraceResult(int schemaVersion, String format, String status, String stopReason, String phase, boolean complete, Object trace, TraceLimits limits, Map<String,Long> counters, List<String> diagnostics, String stdout, String stderr)
extends Record
Versioned opt-in job result. The trace payload retains its existing format.
-
Constructor Summary
ConstructorsConstructorDescriptionTraceResult(int schemaVersion, String format, String status, String stopReason, String phase, boolean complete, Object trace, TraceLimits limits, Map<String, Long> counters, List<String> diagnostics, String stdout, String stderr) Creates an instance of aTraceResultrecord class. -
Method Summary
Modifier and TypeMethodDescriptionbooleancomplete()Returns the value of thecompleterecord component.counters()Returns the value of thecountersrecord component.Returns the value of thediagnosticsrecord component.final booleanIndicates whether some other object is "equal to" this one.static TraceResultCreates a failed TraceResult with default unlimited limits.static TraceResultfailed(String format, String phase, String diagnostic, TraceLimits limits) Creates a failed TraceResult with specified effective limits.format()Returns the value of theformatrecord component.final inthashCode()Returns a hash code value for this object.limits()Returns the value of thelimitsrecord component.phase()Returns the value of thephaserecord component.intReturns the value of theschemaVersionrecord component.status()Returns the value of thestatusrecord component.stderr()Returns the value of thestderrrecord component.stdout()Returns the value of thestdoutrecord component.static TraceResultCreates a stopped TraceResult with default unlimited limits.static TraceResultstopped(String format, String reason, String diagnostic, TraceLimits limits) Creates a stopped TraceResult with specified effective limits.Returns the value of thestopReasonrecord component.final StringtoString()Returns a string representation of this record class.trace()Returns the value of thetracerecord component.
-
Constructor Details
-
TraceResult
public TraceResult(int schemaVersion, String format, String status, String stopReason, String phase, boolean complete, Object trace, TraceLimits limits, Map<String, Long> counters, List<String> diagnostics, String stdout, String stderr) Creates an instance of aTraceResultrecord class.- Parameters:
schemaVersion- the value for theschemaVersionrecord componentformat- the value for theformatrecord componentstatus- the value for thestatusrecord componentstopReason- the value for thestopReasonrecord componentphase- the value for thephaserecord componentcomplete- the value for thecompleterecord componenttrace- the value for thetracerecord componentlimits- the value for thelimitsrecord componentcounters- the value for thecountersrecord componentdiagnostics- the value for thediagnosticsrecord componentstdout- the value for thestdoutrecord componentstderr- the value for thestderrrecord component
-
-
Method Details
-
failed
Creates a failed TraceResult with default unlimited limits.- Parameters:
format- Output format.phase- Failure phase.diagnostic- Human-readable diagnostic.- Returns:
- New failed TraceResult instance.
-
failed
public static TraceResult failed(String format, String phase, String diagnostic, TraceLimits limits) Creates a failed TraceResult with specified effective limits.- Parameters:
format- Output format.phase- Failure phase.diagnostic- Human-readable diagnostic.limits- Effective trace limits.- Returns:
- New failed TraceResult instance.
-
stopped
Creates a stopped TraceResult with default unlimited limits.- Parameters:
format- Output format.reason- Machine-readable reason.diagnostic- Human-readable diagnostic.- Returns:
- New stopped TraceResult instance.
-
stopped
public static TraceResult stopped(String format, String reason, String diagnostic, TraceLimits limits) Creates a stopped TraceResult with specified effective limits.- Parameters:
format- Output format.reason- Machine-readable reason.diagnostic- Human-readable diagnostic.limits- Effective trace limits.- Returns:
- New stopped TraceResult instance.
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
schemaVersion
public int schemaVersion()Returns the value of theschemaVersionrecord component.- Returns:
- the value of the
schemaVersionrecord component
-
format
Returns the value of theformatrecord component.- Returns:
- the value of the
formatrecord component
-
status
Returns the value of thestatusrecord component.- Returns:
- the value of the
statusrecord component
-
stopReason
Returns the value of thestopReasonrecord component.- Returns:
- the value of the
stopReasonrecord component
-
phase
Returns the value of thephaserecord component.- Returns:
- the value of the
phaserecord component
-
complete
public boolean complete()Returns the value of thecompleterecord component.- Returns:
- the value of the
completerecord component
-
trace
Returns the value of thetracerecord component.- Returns:
- the value of the
tracerecord component
-
limits
Returns the value of thelimitsrecord component.- Returns:
- the value of the
limitsrecord component
-
counters
Returns the value of thecountersrecord component.- Returns:
- the value of the
countersrecord component
-
diagnostics
Returns the value of thediagnosticsrecord component.- Returns:
- the value of the
diagnosticsrecord component
-
stdout
Returns the value of thestdoutrecord component.- Returns:
- the value of the
stdoutrecord component
-
stderr
Returns the value of thestderrrecord component.- Returns:
- the value of the
stderrrecord component
-