1. Use configuration file to define the monitored functions at startup time
1. set environment variable SimpleMonitorYaml="the location of the conf"
2. the configuration file is in Yaml format
class.name1:
- function1
- function2
class.name2:
- function1
- function2
2. Use OSGI WeavingHook to wrap a try/finally block around the monitored function body
3. Collect stats in working thread w/o any lock, save the stats on ThreadLocal map
4. A seperate aggregation thread will consolidate the result and dump to the console
+--------------+
|Thread 1 |
| +-------+
| |stats 1|<----+-
+------+-------+ | +--------------------+
| | Aggregation Thread |
+--------------+ | |--------------------|
|Thread 2 | +------+ |
| +-------+ | final_stats |
| |stats 2|<-----------+ for stat in 1..n |
+------+-------+ | final_stats |
| += stat |
+ | reset stat |
| | |
| | log(final_stats) |
+ | |
+--------------+ +------+ |
|Thread n | | +--------------------+
| +-------+ |
| |stats n|<----+
+------+-------+
-
Notifications
You must be signed in to change notification settings - Fork 0
rleiwang/simple-java-monitor
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
This is a simple monitor to collect run time stats of Java applications
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published