C# Class Kudu.Core.Infrastructure.ProcessExtensions

Mostra file Open project: projectkudu/kudu

Public Methods

Method Description
GetChildren ( this process, ITracer tracer, bool recursive = true ) : IEnumerable
GetCommandLine ( this process ) : string
GetDescription ( string>.Dictionary environment ) : string
GetEnvironmentVariables ( this process ) : string>.Dictionary
GetIsScmSite ( string>.Dictionary environment ) : bool
GetIsWebJob ( string>.Dictionary environment ) : bool
GetParentId ( this process, ITracer tracer ) : int

Get parent id.

GetParentProcess ( this process, ITracer tracer ) : Process

Get parent process.

GetTotalProcessorTime ( this process, ITracer tracer ) : System.TimeSpan

Calculates the sum of TotalProcessorTime for the current process and all its children.

GetUserName ( this process ) : string
Kill ( this process, bool includesChildren, ITracer tracer ) : void
MiniDump ( this process, string dumpFile, MINIDUMP_TYPE dumpType ) : void
Start ( this process, ITracer tracer, Stream output, Stream error, Stream input = null, IdleManager idleManager = null ) : Task
TryGetEnvironmentVariables ( this process, string>.Dictionary &environmentVariables ) : bool

Private Methods

Method Description
CopyStreamAsync ( Stream from, Stream to, Kudu.Core.Infrastructure.IdleManager idleManager, CancellationToken cancellationToken, bool closeAfterCopy = false ) : Task
EnvToDictionary ( byte env ) : string>.Dictionary
FlushAllAsync ( IProcess process, ITracer tracer, Kudu.Core.Infrastructure.IdleManager idleManager, CancellationTokenSource cancellationTokenSource, IEnumerable tasks ) : Task
GetChildren ( int pid, Dictionary tree, bool recursive ) : IEnumerable
GetCommandLineCore ( IntPtr hProcess ) : string
GetEnvironmentVariablesCore ( IntPtr hProcess ) : string>.Dictionary
GetPeb32 ( IntPtr hProcess ) : IntPtr
GetPeb64 ( IntPtr hProcess ) : IntPtr
GetPebNative ( IntPtr hProcess ) : IntPtr
GetPenv ( IntPtr hProcess ) : IntPtr
GetProcessBitness ( IntPtr hProcess ) : int
GetProcessTree ( ITracer tracer ) : List>.Dictionary
HasReadAccess ( IntPtr hProcess, IntPtr address, int &size ) : bool
SafeCloseStream ( Stream stream ) : void
SafeGetProcessById ( int pid ) : Process
SafeKillProcess ( Process process, ITracer tracer ) : void
TryGetProcessHandle ( this process, IntPtr &processHandle ) : bool
TryReadIntPtr ( IntPtr hProcess, IntPtr ptr, IntPtr &readPtr ) : bool

Method Details

GetChildren() public static method

public static GetChildren ( this process, ITracer tracer, bool recursive = true ) : IEnumerable
process this
tracer ITracer
recursive bool
return IEnumerable

GetCommandLine() public static method

public static GetCommandLine ( this process ) : string
process this
return string

GetDescription() public static method

public static GetDescription ( string>.Dictionary environment ) : string
environment string>.Dictionary
return string

GetEnvironmentVariables() public static method

public static GetEnvironmentVariables ( this process ) : string>.Dictionary
process this
return string>.Dictionary

GetIsScmSite() public static method

public static GetIsScmSite ( string>.Dictionary environment ) : bool
environment string>.Dictionary
return bool

GetIsWebJob() public static method

public static GetIsWebJob ( string>.Dictionary environment ) : bool
environment string>.Dictionary
return bool

GetParentId() public static method

Get parent id.
public static GetParentId ( this process, ITracer tracer ) : int
process this
tracer ITracer
return int

GetParentProcess() public static method

Get parent process.
public static GetParentProcess ( this process, ITracer tracer ) : Process
process this
tracer ITracer
return System.Diagnostics.Process

GetTotalProcessorTime() public static method

Calculates the sum of TotalProcessorTime for the current process and all its children.
public static GetTotalProcessorTime ( this process, ITracer tracer ) : System.TimeSpan
process this
tracer ITracer
return System.TimeSpan

GetUserName() public static method

public static GetUserName ( this process ) : string
process this
return string

Kill() public static method

public static Kill ( this process, bool includesChildren, ITracer tracer ) : void
process this
includesChildren bool
tracer ITracer
return void

MiniDump() public static method

public static MiniDump ( this process, string dumpFile, MINIDUMP_TYPE dumpType ) : void
process this
dumpFile string
dumpType MINIDUMP_TYPE
return void

Start() public static method

public static Start ( this process, ITracer tracer, Stream output, Stream error, Stream input = null, IdleManager idleManager = null ) : Task
process this
tracer ITracer
output Stream
error Stream
input Stream
idleManager IdleManager
return Task

TryGetEnvironmentVariables() public static method

public static TryGetEnvironmentVariables ( this process, string>.Dictionary &environmentVariables ) : bool
process this
environmentVariables string>.Dictionary
return bool