source
structure Std.Internal.IO.Process.ResourceUsageStats :
Type

Represents resource usage statistics for a process or thread. All time values are in milliseconds.

- cpuUserTime : Time.Millisecond.Offset

  CPU time spent in user mode (milliseconds)

- cpuSystemTime : Time.Millisecond.Offset

  CPU time spent in kernel mode (milliseconds)

- peakResidentSetSizeKb : UInt64

  Peak resident set size (max physical memory usage) in kilobytes

- sharedMemorySizeKb : UInt64

  Size of shared memory segments (kilobytes)

- unsharedDataSizeKb : UInt64

  Size of unshared data segment (kilobytes)

- unsharedStackSizeKb : UInt64

  Size of unshared stack segment (kilobytes)

- minorPageFaults : UInt64

  Number of minor (soft) page faults (no disk I/O)

- majorPageFaults : UInt64

  Number of major (hard) page faults (disk I/O required)

- swapOperations : UInt64

  Number of swap ins or swap outs

- blockInputOps : UInt64

  Number of block input operations (disk reads)

- blockOutputOps : UInt64

  Number of block output operations (disk writes)

- messagesSent : UInt64

  Number of IPC messages sent

- messagesReceived : UInt64

  Number of IPC messages received

- signalsReceived : UInt64

  Number of signals received

- voluntaryContextSwitches : UInt64

  Number of voluntary context switches (process yielded CPU)

- involuntaryContextSwitches : UInt64

  Number of involuntary context switches (process preempted)

Instances For

source
instance Std.Internal.IO.Process.instReprResourceUsageStats :
Repr ResourceUsageStats
Equations

- Std.Internal.IO.Process.instReprResourceUsageStats = { reprPrec := Std.Internal.IO.Process.instReprResourceUsageStats.repr }

source
def Std.Internal.IO.Process.instReprResourceUsageStats.repr :
ResourceUsageStats → Nat → Format
Equations

- One or more equations did not get rendered due to their size.

Instances For

source
instance Std.Internal.IO.Process.instInhabitedResourceUsageStats :
Inhabited ResourceUsageStats
Equations

- Std.Internal.IO.Process.instInhabitedResourceUsageStats = { default := Std.Internal.IO.Process.instInhabitedResourceUsageStats.default }

source
def Std.Internal.IO.Process.instInhabitedResourceUsageStats.default :
ResourceUsageStats
Equations

- One or more equations did not get rendered due to their size.

Instances For

source
structure Std.Internal.IO.Process.PId :
Type

A process identifier, represented by a numeric ID in UNIX systems (e.g. 1000).

- toUInt64 : UInt64

  The numeric process ID.

Instances For

source
instance Std.Internal.IO.Process.instInhabitedPId :
Inhabited PId
Equations

- Std.Internal.IO.Process.instInhabitedPId = { default := Std.Internal.IO.Process.instInhabitedPId.default }

source
def Std.Internal.IO.Process.instInhabitedPId.default :
PId
Equations

- Std.Internal.IO.Process.instInhabitedPId.default = { toUInt64 := default }

Instances For

source
instance Std.Internal.IO.Process.instDecidableEqPId :
DecidableEq PId
Equations

- Std.Internal.IO.Process.instDecidableEqPId = Std.Internal.IO.Process.instDecidableEqPId.decEq

source
def Std.Internal.IO.Process.instDecidableEqPId.decEq (x✝ x✝¹ : PId) :
Decidable (x✝ = x✝¹)
Equations

- Std.Internal.IO.Process.instDecidableEqPId.decEq { toUInt64 := a } { toUInt64 := b } = if h : a = b then h ▸ isTrue ⋯ else isFalse ⋯

Instances For

source
instance Std.Internal.IO.Process.instOrdPId :
Ord PId
Equations

- Std.Internal.IO.Process.instOrdPId = { compare := Std.Internal.IO.Process.instOrdPId.ord }

source
def Std.Internal.IO.Process.instOrdPId.ord :
PId → PId → Ordering
Equations

- Std.Internal.IO.Process.instOrdPId.ord { toUInt64 := a } { toUInt64 := b } = (compare a b).then Ordering.eq

Instances For

source
instance Std.Internal.IO.Process.instReprPId :
Repr PId
Equations

- Std.Internal.IO.Process.instReprPId = { reprPrec := fun (u : Std.Internal.IO.Process.PId) => Repr.addAppParen (Std.Format.text "PId.mk " ++ repr u.toUInt64) }

source
@[inline]
def Std.Internal.IO.Process.getProcessTitle :
IO String

Gets the title of the current process.

Equations

- Std.Internal.IO.Process.getProcessTitle = Std.Internal.UV.System.getProcessTitle

Instances For

source
@[inline]
def Std.Internal.IO.Process.setProcessTitle (title : String) :
IO Unit

Sets the title of the current process.

Equations

- Std.Internal.IO.Process.setProcessTitle title = Std.Internal.UV.System.setProcessTitle title

Instances For

source
@[inline]
def Std.Internal.IO.Process.getId :
IO PId

Gets the current process id.

Equations

- Std.Internal.IO.Process.getId = Std.Internal.IO.Process.PId.mk <$> Std.Internal.UV.System.osGetPid

Instances For

source
@[inline]
def Std.Internal.IO.Process.getParentId :
IO PId

Gets the current process parent id.

Equations

- Std.Internal.IO.Process.getParentId = Std.Internal.IO.Process.PId.mk <$> Std.Internal.UV.System.osGetPpid

Instances For

source
@[inline]
def Std.Internal.IO.Process.getCwd :
IO System.FilePath

Gets the current working directory.

Equations

- Std.Internal.IO.Process.getCwd = do let a ← Std.Internal.UV.System.cwd pure { toString := a }

Instances For

source
@[inline]
def Std.Internal.IO.Process.setCwd (path : System.FilePath) :
IO Unit

Changes the current working directory to a new one.

Equations

- Std.Internal.IO.Process.setCwd path = Std.Internal.UV.System.chdir path.toString

Instances For

source
@[inline]
def Std.Internal.IO.Process.getPriority (pid : PId) :
IO Int64

Gets the scheduling priority of a process.

Equations

- Std.Internal.IO.Process.getPriority pid = Std.Internal.UV.System.osGetPriority pid.toUInt64

Instances For

source
@[inline]
def Std.Internal.IO.Process.setPriority (pid : PId) (priority : Int64) :
IO Unit

Sets the scheduling priority of a process.

Equations

- Std.Internal.IO.Process.setPriority pid priority = Std.Internal.UV.System.osSetPriority pid.toUInt64 priority

Instances For

source
@[inline]
def Std.Internal.IO.Process.getResourceUsage :
IO ResourceUsageStats

Retrieves resource usage statistics.

Equations

- One or more equations did not get rendered due to their size.

Instances For

source
@[inline]
def Std.Internal.IO.Process.getExecutablePath :
IO System.FilePath

Returns the absolute path of the current executable.

Equations

- Std.Internal.IO.Process.getExecutablePath = System.FilePath.mk <$> Std.Internal.UV.System.exePath

Instances For

source
@[inline]
def Std.Internal.IO.Process.freeMemory :
IO UInt64

Returns the amount of free system memory in bytes.

Equations

- Std.Internal.IO.Process.freeMemory = Std.Internal.UV.System.freeMemory

Instances For

source
@[inline]
def Std.Internal.IO.Process.totalMemory :
IO UInt64

Returns the total system memory in bytes.

Equations

- Std.Internal.IO.Process.totalMemory = Std.Internal.UV.System.totalMemory

Instances For

source
@[inline]
def Std.Internal.IO.Process.constrainedMemory :
IO UInt64

Returns the constrained memory limit in bytes.

Equations

- Std.Internal.IO.Process.constrainedMemory = Std.Internal.UV.System.constrainedMemory

Instances For

source
@[inline]
def Std.Internal.IO.Process.availableMemory :
IO UInt64

Returns the available memory for allocation in bytes.

Equations

- Std.Internal.IO.Process.availableMemory = Std.Internal.UV.System.availableMemory

Instances For