Highlights
- •ProcessPerformance is a tool to measure resource consumption of running processes.
- •It provides information about the utilization of CPU, memory and network resources.
- •ProcessPerformance is as an easy-to-use command-line tool.
- •It is implemented for the .Net Core platform, which runs in most operating systems.
- •It has been used in many projects to measure the efficiency of complex systems.
Abstract
Keywords
Current code version | 1.1.1 |
Permanent link to code/repository used for this code version | https://github.com/SoftwareImpacts/SIMPAC-2021-199 |
Permanent link to Reproducible Capsule | https://codeocean.com/capsule/7889504/tree/v1 |
Legal Code License | MIT |
Code versioning system used | git |
Software code languages, tools, and services used | C# 8.0 |
Compilation requirements, operating environments & dependencies | .Net Core 3.1+, TraceEvent 2.0.55 |
If available Link to developer documentation/manual | https://github.com/ComputationalReflection/ProcessPerformance/blob/master/README.md |
Support email for questions | [email protected] |
1. Introduction
2. Application description and functions

- •CPU consumption, measured as the percentage of use of the total CPU resources. It is computed with the following equation:(1)
The first operand is the TotalProcessorTime property of the Process class, which returns the time that the microprocessor spends working on a task (it is the sum of user and privileged processor time) []. Processor times are represented as blue rectangles in Fig. 1. Clock time is the elapsed execution time for the time interval measured (i.e., in Fig. 1). The division of these two values gives us the percentage of CPU used by the process. That value is then divided by the number of system cores (the ProcessorCount property of the Environment class) to obtain the CPU consumption, because TotalProcessorTime represents the sum of working times for all the cores. - •Overall network traffic refers to the number of bytes transferred across the network by all the processes since ProcessPerformance is executed. The GetIPv4Statistics method is used to get that information from the operating system, including the bytes sent (BytesSent property of IPv4InterfaceStatistics, shown as dark green rectangles in Fig. 1) and received (BytesReceived property, shown as light green rectangles in Fig. 1). With this information, ProcessPerformance displays both the number of bytes transferred and the transmission rate.
- •Process network consumption is the number of bytes transferred by one single process across the network since ProcessPerformance started measuring. A TraceEventSession object is used to register all the TCP/IP events triggered in the system. It follows the Observer design pattern, where listeners are registered to be notified when different events occur [[25]]. ProcessPerformance registers itself for the TcpIpRecv and TcpIpSend events to store the information about data received and sent. Each time one of these two events is triggered, we check whether the process causing the data transfer is the one to be monitored and, if so, we update the variables counting the number of bytes transmitted by that process. Fig. 1 shows the data sent by a process with dark gray rectangles, while light gray boxes represent the data received.
- •Memory consumption. To measure the memory consumed by a process at runtime, we count the maximum size of working set memory used by a process (i.e., the PeakWorkingSet property of Process []). The working set of a process is the set of memory pages currently visible to the process in physical RAM memory. Those pages are resident and available for an application to be used without triggering a page fault. The working set includes both shared and private data. The shared data comprises the pages that contain all the instructions that the process executes, including those from the process modules and the system libraries. As shown in Fig. 1, it is common that the working set memory used by a process grows at runtime as the program demands more memory from the operating system.

2.1 Usage and examples
- •. A space-separated list of the names or PIDs (process identifiers) of the processes to be monitored. If no process is passed, the overall system resources are displayed.
- •-interval:milliseconds. The interval used to gather the runtime information of resource consumption, expressed in milliseconds. The default value is 1,000 (one second).
- •-network:IP_address. IP address of the network interface used to measure data transmission.
- •-csv. Shows the output in comma-separated values (CSV) format.
- •-help. Describes the different command-line arguments.

3. Impact
4. Limitations
Declaration of Competing Interest
Acknowledgments
References
- Valgrind: A program supervision framework.Electron. Notes Theor. Comput. Sci. 2003; 89: 44-66
V. Salapura, K. Ganesan, A. Gara, M. Gschwind, J.C. Sexton, R.E. Walkup, Next-Generation Performance Counters: Towards Monitoring Over Thousand Concurrent Events, in: ISPASS 2008 - IEEE International Symposium On Performance Analysis Of Systems And Software, 2008, pp. 139–146.
- Rewriting executable files to measure program behavior.Softw. Pract. Exp. 1994; 24: 197-218
- Monitors: An operating system structuring concept.Commun. ACM. 1974; 17: 549-557
- A comparative study of real time operating systems for embedded systems.Int. J. Innov. Res. Comput. Commun. Eng. 2016; 6: 12008-12014
- Process explorer v16.43.2021 (https://docs.microsoft.com/en-us/sysinternals/downloads/process-explorer)
- System monitor.2021 (https://help.gnome.org/users/gnome-system-monitor/stable)
- Activity monitor user guide for mac OS Monterey.2021 (https://support.apple.com/guide/activity-monitor/welcome/mac)
- Tasklist.2021 (https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/tasklist)
- tOp. linux manual page.2021 (https://man7.org/linux/man-pages/man1/top.1.html)
- iotop. linux manual page.2021 (https://www.man7.org/linux/man-pages/man8/iotop.8.html)
- Nethogs.2021 (https://github.com/raboof/nethogs)
- Instrumentation tools.in: Fast Simulation Of Computer Architectures. Springer, US, Boston, MA1995: 47-86
- Debugging and profiling.in: Pro Apache NetBeans. Springer, 2020: 127-178
L. Uhsadel, A. Georges, I. Verbauwhede, Exploiting Hardware Performance Counters, in: 5th Workshop On Fault Diagnosis And Tolerance In Cryptography, 2008, pp. 59–67.
- Perfmon.2021 (https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/perfmon)
- Process monitor v3.86.2021 (https://docs.microsoft.com/en-us/sysinternals/downloads/procmon)
- Perf: Linux profiling with performance counters.2021 (https://perf.wiki.kernel.org/index.php)
- Are hardware performance counters a cost effective way for integrity checking of programs.in: Proceedings Of The Sixth ACM Workshop On Scalable Trusted Computing. STC’11. Association for Computing Machinery, New York, NY, USA2011: 71-76
- Java management extensions for application management.IBM Syst. J. 2001; 40: 104-129
- Dotnet-trace performance analysis utility.2021 (https://docs.microsoft.com/en-us/dotnet/core/diagnostics/dotnet-trace)
- Psutil. cross-platform lib for process and system monitoring in python.2021 (https://github.com/giampaolo/psutil)
- Process.TotalProcessorTime property (system.diagnostics).2021 (https://docs.microsoft.com/en-us/dotnet/api/system.diagnostics.process.totalprocessortime?view=netcore-3.1)
- The microsoft.diagnostics.tracing.TraceEvent library.2021 (https://github.com/Microsoft/perfview/blob/main/documentation/TraceEvent/TraceEventLibrary.md)
- Elements of Reusable Object-Oriented Software.Addison-Wesley Reading, Massachusetts1995
- Process.PeakWorkingSet64 property (system.diagnostics).2021 (https://docs.microsoft.com/en-us/dotnet/api/system.diagnostics.process.peakworkingset64?view=netcore-3.1)
- Statistically rigorous java performance evaluation.in: Proceedings Of The 22nd Annual ACM SIGPLAN Conference On Object-Oriented Programming Systems And Applications. OOPSLA. ACM, New York, NY, USA2007: 57-76
- Rule-based program specialization to optimize gradually typed code.Knowl.-Based Syst. 2019; 179: 145-173
- SSA transformations to facilitate type inference in dynamically typed code.Comput. J. 2017; 60: 1300-1315
- Including both static and dynamic typing in the same programming language.IET Softw. 2010; 4: 268-282
- Design and implementation of an efficient hybrid dynamic and static typing language.Softw. Pract. Exp. 2016; 46: 199-226
- Optimizing runtime performance of hybrid dynamically and statically typed languages for the .NET platform.J. Syst. Softw. 2016; 113: 114-129
- Union and intersection types to support both dynamic and static typing.Inform. Process. Lett. 2011; 111: 278-286
- Type inference to optimize a hybrid statically and dynamically typed language.Comput. J. 2011; 54: 1901-1924
- A comprehensive evaluation of common python implementations.IEEE Softw. 2014; 32: 76-84
- JINDY: a java library to support invokedynamic.Comput. Sci. Inf. Syst. 2014; 11: 47-68
- The runtime performance of invokedynamic: An evaluation with a java library.IEEE Softw. 2013; 31: 82-90
- Efficient runtime metaprogramming services for java.J. Syst. Softw. 2019; 153: 220-237
- Efficient runtime aspect weaving for java applications.Inf. Softw. Technol. 2018; 100: 73-86
- Efficient aspect weaver for the .NET platform.IEEE Lat. Am. Trans. 2015; 13: 1534-1541
- Applying dynamic separation of aspects to distributed systems security: a case study.IET Softw. 2012; 6: 231-248
- The DSAW aspect-oriented software development platform.Int. J. Softw. Eng. Knowl. Eng. 2011; 21: 891-929
- A hybrid class- and prototype-based object model to support language-neutral structural intercession.Inf. Softw. Technol. 2014; 44: 199-219
- Efficient support of dynamic inheritance for class- and prototype-based languages.J. Syst. Softw. 2013; 86: 278-301
- Designing an adaptable heterogeneous abstract machine by means of reflection.Inf. Softw. Technol. 2005; 47
- Framework for the declarative implementation of native mobile applications.IET Softw. 2014; 8: 19-32
- DIMAG: A framework for automatic generation of mobile applications for multiple platforms.in: Proceedings Of The 6th International Conference On Mobile Technology, Application And Systems. Mobility’09. 2009: 1-8
- Generating native user interfaces for multiple devices by means of model transformation.Front. Inf. Technol. Electr. Eng. 2015; 16
- An infrastructure to deliver synchronous remote programming labs.IEEE Trans. Learn. Technol. 2021; 14: 161-172
- Heterogeneous tree structure classification to label java programmers according to their expertise level.Future Gener. Comput. Syst. 2020; 105: 380-394
- Massive LMS log data analysis for the early prediction of course-agnostic student performance.Comput. Educ. 2021; 163: 104108-104128
- Improving type information inferred by decompilers with supervised machine learning.2021 (arXiv:2101.08116)
- Cnerator: A python application for the controlled stochastic generation of standard c source code.SoftwareX. 2021; 15: 100711-100717
- An efficient platform for the automatic extraction of patterns in native code.Sci. Program. 2017; 2017
- An efficient and scalable platform for java source code analysis using overlaid graph representations.IEEE Access. 2020; 8: 72239-72260
- Separating adaptable persistence attributes through computational reflection.IEEE Softw. 2004; 21
- Modularizing application and database evolution – an aspect-oriented framework for orthogonal persistence.Softw. Pract. Exp. 2017; 47: 193-221
- Visual zero: A persistent and interactive object-oriented programming environment.J. Vis. Lang. Comput. 2008; 19
Article info
Publication history
Footnotes
The code (and data) in this article has been certified as Reproducible by Code Ocean: (https://codeocean.com/). More information on the Reproducibility Badge Initiative is available at https://www.elsevier.com/physical-sciences-and-engineering/computer-science/journals.
Identification
Copyright
User license
Creative Commons Attribution (CC BY 4.0) |
Permitted
- Read, print & download
- Redistribute or republish the final article
- Text & data mine
- Translate the article
- Reuse portions or extracts from the article in other works
- Sell or re-use for commercial purposes
Elsevier's open access license policy