3-sub appdomain created in a process(main appdomain), and how to get sub-Appdomain cpu usage, memory usage, and the thread number in real-time?
Getting sub-Appdomain cpu usage, memory usage, and thread number in real-time
1.6k Views Asked by taotao At
2
There are 2 best solutions below
0
taotao
On
Using the following method, the acquired values seems incorrect.
public static double GetAppDomainCpuUsage(AppDomain hostDomain)
{
if (Process.GetCurrentProcess().TotalProcessorTime.TotalMilliseconds > 0)
return hostDomain.MonitoringTotalProcessorTime.TotalMilliseconds * 100 / Process.GetCurrentProcess().TotalProcessorTime.TotalMilliseconds;
return 0;
}
public static double GetAppDomainMemoryUsage(AppDomain hostDomain)
{
if (AppDomain.MonitoringSurvivedProcessMemorySize > 0)
return (double)hostDomain.MonitoringSurvivedMemorySize * 100 / (double)AppDomain.MonitoringSurvivedProcessMemorySize;
return 0;
}
AppDomain.MonitoringIsEnabled = true;
Related Questions in C#
- How to call a C language function from x86 assembly code?
- What does: "char *argv[]" mean?
- User input sanitization program, which takes a specific amount of arguments and passes the execution to a bash script
- How to crop a BMP image in half using C
- How can I get the difference in minutes between two dates and hours?
- Why will this code compile although it defines two variables with the same name?
- Compiling eBPF program in Docker fails due to missing '__u64' type
- Why can't I use the file pointer after the first read attempt fails?
- #include Header files in C with definition too
- OpenCV2 on CLion
- What is causing the store latency in this program?
- How to refer to the filepath of test data in test sourcecode?
- 9 Digit Addresses in Hexadecimal System in MacOS
- My server TCP doesn't receive messages from the client in C
- Printing the characters obtained from the array s using printf?
Related Questions in MEMORY
- 9 Digit Addresses in Hexadecimal System in MacOS
- Memory location changing from 0 to 1 consistently on Mac
- Would event listeners prevent garbage collecting objects referenced in outer function scopes?
- tensorrt inference problem: CPU memory leak
- How to estimate the memory size of a binary voxelized geometry?
- Java Memory UTF-16 Vs UTF-8
- Spring Boot application container memory footprint (Java 21)
- Low memory Windows CE
- How to throw an error when a program acesses a block of memory created by you that has been deallocated by a call of free?
- Golang bufio.Scanner: token too long
- Get the address and size of a loaded shared object on memory from C
- In Redis Databases how do we need to calculate the table size
- ClickHouse Materialized View consuming a lot of Memory and CPU
- How to reduce memory usage for large matrix calculations?
- How to use memray with Gunicorn or flask dev server?
Related Questions in CPU
- the end of the I/O operation is notified to the system by an interrupt.how much system time do the mentioned operations occupy?
- Python process CPU usage going high suddenly. how to detect the place?
- Problem on CPU scheduling algorithms in OS
- Will a processor with such a defect work?
- Google Chrome is consuming a lot of CPU on a video call?
- access fan and it's speed, in linux mint on acer predator helios 300
- I am trying to calculate the cpu percentage a certain process take but the values are very differnt than that of the task manger
- Can out-of-order execution of CPU affect the order of new operator in C++?
- Unexpected OS Shutdown
- Maximum CPU Voltage reading
- ClickHouse Materialized View consuming a lot of Memory and CPU
- Use of OpenVINO on a computer with 2 physical cpus
- How is cpu's state saved by os without altering it?
- why the CPU utilization and other indicators collected by glances are larger than those collected?
- Python serial communication causing high CPU Usage when baudrate is 1000000
Related Questions in MONITORING
- Monitoring Thread pool metrics through promethues
- Filter input metrics in vmagent (prometheus)
- Trying to get net.if.in and net.if.out values with zabbix api python
- Global event monitoring with WPF
- database "telegraf" creation failed: 401 Unauthorized
- Zabbix parsing macros value
- Is it possible for my prometheus container to pull metrics from Azure Monitor?
- APM Open source : Angular + Java Spring + Postgresql
- Poller is not picking up the Queued tasks, the Host and Service checks are getting timed out
- Can I monitor progress of spacy parsing?
- What's the difference between every 1m, group_by in MQL Alert vs rolling window in Google alerting
- Objective tools for monitoring WCF APIs for latency, failures, and breakdowns?
- Retain Metric Values in Prometheus TSDB Across Application Restarts?
- Grafana Base64 Image/Video/Audio/PDF plugins unable to display
- How do I measure pagespeed scores on my pages using datadog? Or rather, is it even possible to keep track of pagespeed scores?
Related Questions in APPDOMAIN
- Search web address from IP
- Why .NET Framework assemblies are not loaded inside same AppDomain of calling module?
- Is there a way in .Net Framwork to reference an object cross AppDomains without Serialization?
- configure phpmyadmin using nginx, access phpmyadmin remotely
- In-Memory Assembly Resolve
- How to handle events from Usercontrol in separate AppDomain
- How to Delete Managed Code Libraries from Inno Setup Temp Directory at DeInitializeSetup
- Creating many Serilog Instances
- Which is an appropriate location to create a Folder in c# console application for reading and writing to files?
- Access my own domain url from my office System. Any unknown urls are blocked by my company
- Creation of secondary AppDomains not supported
- Assembly loading by reflection c# causes type comparison problem
- Can I create a new AppDomain without remoting call context?
- In .NET Framework, how to prevent an assembly loaded into a DIFFERENT app domain from expiring?
- Connect local domain to Django
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular # Hahtags
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
CPU usage and other related information does no really apply to .Net AppDomain and it only exists at CLR level and not at OS level. So, by default you can only track these details at a process level.
Since .Net 4.0, AppDomiain has static property called
MonitoringIsEnabled. Once this is set, you can track the details using other properties (AppDomain.Monitor<XXXX>). Note that this is still not real time. This might be a good start.