
"Process", "IO Data Operations/sec", $processName "Process", "IO Other Bytes/sec", $processName

"Process", "IO Other Operations/sec", $processName

If we don't, # then they fail to return any information for a few seconds. $processName = get-processName $process # We store the performance counter objects in a hashtable. $process = $( throw "Please specify a process for which to get disk usage.") # As a heuristic, gets the total IO and Data operations per second, and # returns their sum. Start-sleep -m ( $pollInterval - $elapsed) $lastPoll = get-date if( $pollInterval -gt $elapsed) $elapsed = ( get-date).Subtract( $lastPoll).TotalMilliseconds $lastWindowHeight = $windowHeight # Sleep for their desired amount of elapsed time, # adjusted for how much time we've actually spent working. $notDisplayed = ( $processes.Count - $output.Count) If( $processes.Count -gt ( $windowHeight - 7)) # Display the results $output | format-table Id,ProcessName,MainWindowTitle,Processor,Disk,WorkingSet Select-object -First ( $windowHeight - 7) $output = $processes | sort -desc $sortCriteria | If the window is to short, show no output. # Tailor the length of the list to the height of the # window. ( -not ( $lastWindowHeight -eq $windowHeight))) # Since clear-host makes the screen flash, we only do so when # we have fewer processes than we did the last time if(( $processes.Count -lt $lastSnapshotCount) -or ` $activity = get-diskActivity $process $process | add-member NoteProperty Disk $activity $cpuPercent = get-cpuPercent $process $process | add-member NoteProperty Processor $cpuPercent # Get the disk activity, based on I/O Perf Counters, # for the process in question. # Go through all of the processes we captured foreach( $process in $processes) # Set the cursor position, get the processes, and store # the time of the snapshot $host.UI.RawUI.CursorPosition = $coords $processes = get-process | sort Id # The coordinates to which we position the output $coords = new-object .Coordinates 0,0Ĭlear-host while( -not $host.UI.RawUI.KeyAvailable) # Store the performance counters we need # for the CPU, and Disk I/O numbers $cpuPerfCounters = $null $lastPoll = get-date $lastSnapshotCount = 0 # usage: poll-process # sortCriteria must be one of "Id", "ProcessName", "MainWindowTitle", # "Processor", "Disk", or "WorkingSet" # pollInterval is specified in milliseconds # param( Identifiers in packages.# poll-process.ps1 # Continuously display a process list, sorted # by the desired criteria.

#DISKTIVITY CODE#
I also think the Delphi package system's goal is primarily dynamic loading of code (iow plugins) and using it quite transparently and easy. Otherwise the whole file size (and memory!) sharing bit goes out of the window.
#DISKTIVITY WINDOWS#
Their workaround is pretty much making copies of it in specific containers, is like saying Windows doesn't have DLL hell, because you can place the copies of all dlls in the same directory as the each app. Runtime 64bit: 7.16Mb (-53%) + 8.62Mb runtimeīut size change per plug-in is more dramatic: Because if they're would be installed system-wide, they would be shared between all apps.įor example for my app (total size, including plug-ins): They usually prefer to provide bpls themselves and this kills whole advantage of using runtime packages. Not many developers know about it and provide it with their applications. Problem is - Delphi Redist isn't as well-known, as C++ Redist. And this mechanism is called "Runtime packages". But! Funny thing, but Delphi allows this too. Problem with Pascal - is that all that stuff is always built-in into every EXE and DLL, it produces.

Real reason, why C++ programs are so small - they use C++ Runtime Redist. It's one of two biggest EXE size offenders. I don't see, that anybody has mentioned obvious way to decrease EXE size - runtime packages. Sorry for necroposting, but, I guess, my post will be useful.
