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#
- Passing arguments to main in C using Eclipse
- kernel module does not print packet info
- error C2016 (C requires that a struct or union has at least one member) and structs typedefs
- Drawing with ncurses, sockets and fork
- How to catch delay-import dll errors (missing dll or symbol) in MinGW(-w64)?
- Configured TTL for A record(s) backing CNAME records
- Allocating memory for pointers inside structures in functions
- Finding articulation point of undirected graph by DFS
- C first fgets() is being skipped while the second runs
- C std library don't appear to be linked in object file
- gcc static library compilation
- How to do a case-insensitive string comparison?
- C programming: Create and write 2D array of files as function
- How to read a file then store to array and then print?
- Function timeouts in C and thread
Related Questions in MEMORY
- DataTable does not release memory
- Impala Resource Estimation for queries with Group by
- Is there any way to get a lru list in Linux kernel?
- C# console application - Unhandled exception while finding the Available and free Ram space.Getting exact answer in windows forms application
- Allowed memory size of 134217728 bytes exhausted (tried to allocate 32 bytes) in PHP
- C# equivalent of Java Memory mapping methods
- How to figure out the optimal fetch size for the select query
- Creating two arrays with malloc on the same line
- Using parse.com and having allocation memory issue
- error reading variable: cannot access memory at address
- CentOS memory availability
- Correct idiom for freeing repr(C) structs using Drop trait
- Find Ram/Memory manufacturer in Linux?
- Profiling memory usage on App Engine
- Access Violation: 0xC0000005, why is this happening?
Related Questions in CPU
- 1MiB = 1024KiB = 2^10. Nonetheless, why not use just 1000 byte instead 1024 to calculate size?
- What is the simplest Turing complete CPU instruction set which can execute code from ROM?
- How to get CPU utilization in % in terminal (mac)
- Avoiding CPU Contention
- Lots of cache miss, Sparse matrix multiplication
- CPU new features enabled in Linux kernel
- Are correct branch predictions free?
- NUMA support on which CPU? What are the current server configuration of this kind of CPU?
- How to deal with virtual address when trying to get memory access pattern statistics?
- On x86, does enabling paging cause an "unconditional jump" (since EIP is now a virtual address)?
- cpu load when setting textbox value
- CPU usage exceeding 100% in top command third line
- 32bit cpu: how much memory can it use?
- CMOS Scaling vs Die Shrink
- Meaning of cores and logical processors in intel icore
Related Questions in MONITORING
- How to get raw hadoop metrics
- Nodejs ZMQ monitoring sockets
- Ambari Monitoring raw data
- Monitoring an applications performance within Visual studio
- how to monitor mesos frameworks
- PDF report in zabbix 2.2.9
- See data that an app is secretly sending to web server in the background
- Monitor Hadoop Cluster using Collectl
- Questions Nagios Monitoring
- NewRelic says "No data reporting for this application"
- How to monitor API calls on EC2?
- IIS Monitoring Through Zabbix
- Hadoop and Spark Monitoring and alert tool(Open source tools)
- Centreon/Icinga: command by services
- New Relic not logging custom parameters on transactions
Related Questions in APPDOMAIN
- Isolate exceptions thrown in an AppDomain to not Crash the Application
- Static class variable across appdomain
- Call library in new AppDomain to prevent exceptions from propagating
- C# Separate instances running under same appdomain?
- getting root of wpf app as a string
- How to force to delete access denied file in c#
- Assembly Reference + Variable vs. Assembly.Load
- Dynamically loading assemblies which have references
- C# Launching another WPF program from a byte array
- Assembly.LoadFrom() or Assembly.Load() being able to delete file
- Why the `AppDomain.UnhandledException` event doesn't happen in my case?
- IRegisteredObject not working as expected
- Getting sub-Appdomain cpu usage, memory usage, and thread number in real-time
- How to separate webapi controllers in their own app domain?
- What is the minimum acceptible value for Idle Time-out(minutes) in IIS?
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 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.