Class ProfilerLaunchConfig
Parsed profiler launch options for a host application (AntHill, IOProfileRunner, MonitoringDemo, …). Resolved from CLI args and/or environment variables, then handed to ProfilerLauncher to produce the exporter list and (optionally) flip the telemetry gate before Typhon.Engine.TyphonProfiler.Start(Typhon.Engine.IResource,Typhon.Engine.ProfilerSessionMetadata,Typhon.Engine.ProfilerOptions,System.Action).
public sealed record ProfilerLaunchConfig : IEquatable<ProfilerLaunchConfig>
- Inheritance
-
ProfilerLaunchConfig
- Implements
- Inherited Members
Remarks
Convention. Two output channels are recognized: a sidecar trace file (post-mortem analysis in the workbench's Trace mode) and a TCP listener for live attach (workbench's Attach mode). Either, both, or neither can be configured. LiveWaitMs turns the live exporter's Initialize(ProfilerSessionMetadata) into a synchronous "wait for first client" gate so the host can pause at startup until a viewer attaches.
Sources of truth. The runtime self-resolves this from the merged telemetry configuration via FromConfiguration(IConfiguration) (the
typhon.telemetry.json file plus TYPHON__PROFILER__* environment variables — see TelemetryConfig). Hosts that still want CLI
control layer FromArgs(string[]) on top with MergedWith(ProfilerLaunchConfig) and feed the result through the AddTyphonProfiler override hook.
Sentinels. Unset state is encoded in-band: TraceFilePath is null, LivePort
is -1, LiveWaitMs is 0. MergedWith(ProfilerLaunchConfig) uses these sentinels to decide which
config "wins" per field, so an unset field in the override doesn't clobber the base.
Constructors
ProfilerLaunchConfig()
public ProfilerLaunchConfig()
Fields
DefaultLivePort
The default port used when --live is given without an explicit number.
public const int DefaultLivePort = 9100
Field Value
Properties
IsActive
True if any output channel is requested (trace file OR live port).
public bool IsActive { get; }
Property Value
LivePort
TCP port the Typhon.Engine.Internals.TcpExporter listens on, or -1 for no live exporter.
public int LivePort { get; init; }
Property Value
LiveWaitMs
If > 0, Initialize(ProfilerSessionMetadata) blocks up to this many milliseconds waiting for the
first live client to connect. Lets the host pause at startup until the workbench is attached. 0 disables
the wait — Initialize returns immediately and clients connect when they connect.
public int LiveWaitMs { get; init; }
Property Value
TraceFilePath
Path to the .typhon-trace file the Typhon.Engine.Internals.FileExporter writes to, or null for no file output.
public string TraceFilePath { get; init; }
Property Value
Methods
Equals(object?)
public override bool Equals(object? obj)
Parameters
objobject
Returns
Equals(ProfilerLaunchConfig?)
public bool Equals(ProfilerLaunchConfig? other)
Parameters
otherProfilerLaunchConfig
Returns
FromArgs(string[])
Parse from a process-style argv array. Recognized flags:
--trace <path>— sidecar file path--live [port]— TCP port (default DefaultLivePort if omitted or non-numeric)--live-wait <ms>— synchronous wait timeout in milliseconds
public static ProfilerLaunchConfig FromArgs(string[] args)
Parameters
argsstring[]
Returns
FromConfiguration(IConfiguration)
Parse from a merged IConfiguration — the standard source for the zero-host-code startup path.
Recognized keys (under the existing Typhon:Profiler namespace, beside Enabled):
Typhon:Profiler:Trace— sidecar file pathTyphon:Profiler:Live— TCP port (or any non-numeric value to use DefaultLivePort)Typhon:Profiler:LiveWaitMs— wait timeout in milliseconds
typhon.telemetry.json (probed in the current directory then next to the
engine assembly) overlaid with TYPHON__PROFILER__* environment variables.
Unset keys leave the field at its sentinel; a null config yields an all-sentinel (inactive) result.
public static ProfilerLaunchConfig FromConfiguration(IConfiguration config)
Parameters
configIConfiguration
Returns
GetHashCode()
public override int GetHashCode()
Returns
MergedWith(ProfilerLaunchConfig)
Combine two configs — fields explicitly set in overrideWith win over this.
"Set" means "different from the field's sentinel": TraceFilePath non-null, LivePort
≥ 0, LiveWaitMs > 0. Use as env.MergedWith(args) for the standard "CLI overrides env"
precedence.
public ProfilerLaunchConfig MergedWith(ProfilerLaunchConfig overrideWith)
Parameters
overrideWithProfilerLaunchConfig
Returns
ToString()
public override string ToString()
Returns
Operators
operator ==(ProfilerLaunchConfig?, ProfilerLaunchConfig?)
public static bool operator ==(ProfilerLaunchConfig? left, ProfilerLaunchConfig? right)
Parameters
leftProfilerLaunchConfigrightProfilerLaunchConfig
Returns
operator !=(ProfilerLaunchConfig?, ProfilerLaunchConfig?)
public static bool operator !=(ProfilerLaunchConfig? left, ProfilerLaunchConfig? right)
Parameters
leftProfilerLaunchConfigrightProfilerLaunchConfig