System scope
The project consists of developing a profiler that utilizes the JVMTI interface. This interface enables us to create Agents that can be passed to the Java Virtual Machine for logging, analyzing, ...In the first phase the profiler should be able to:
- Selectively trace a program: Log the method- and/or return-calls with the option to select which packages/jars/files should or shouldn't be logged.
- Offer the option to log Object Identifiers.
- Optionally offer the possibility to log values of method parameters.
- Offer the option to log events per thread or everything at once.
- Enable/disable the various options.
- Visualize previously logged data.
- The actual logging should be as efficient as possible. For this buffered writing and compression should be used.
- The state of the threads, and immediate past.
- Stack/heap usage.
- The number of instances of the classes, and the memory they occupy.
- Apply filters on these views.
- Enable/disable these views on-the-fly.
- Optional: code coverage, cpu load: percentage/ms spent in a method, number of invocations, preferably shown as a tree structure. This shouldn't be done real-time, it may be determined for an existing log.
Risk analysis
-
Illness of project member
Probability: moderate
Impact: tolerable
Countermeasure: Include buffer periods after milestones to cope with lost time.
-
Lack of knowledge about the technology (JVMTI interface)
Probability: high
Impact: serious
Countermeasure: Study the interface in advance, and determin which parts we 're going to use.
-
Lack of time due to other projects
Probability: moderate
Impact: serious
Countermeasure: Make a good schedule, and update regularly.
-
We are working with a relatively new interface for which documentation and community experience may be low. Complex interfaces are understood more easily if you have tutorials and examples available.
Probability: high
Impact: tolerable to serious
Countermeasure: Because we will depend on Sun's specifications we should study the interface in advance to identify potential problems.
-
Bugs in the JVMTI interface
Probability: Low
Impact: very serious
Countermeasure: n/a
-
Platform-dependencies. The agent(s) have to be developed in c or c++. A lot of libraries are only available for a limited number of platforms.
e.g. WinSock, Unix Sockets, ...
Probability: moderate
Impact: serious
Countermeasure: Determin the target platforms in advance, and specify which libraries we are going to use. Search for alternatives (e.g. Apache Portable Runtime)
-
A computercrash with loss of data.
Probability: low
Impact: very serious
Countermeasure: Use CVS.
Use cases
Trace a new program (1)Starting a new session (1a)
Agent (1b)
Viewing a log (2)
Visualize the eventsequence (2a)
Generate a summary (2b)
Save a summary (2c)
Filters for log (3)
Aborting a trace (manually) (4)
Automaticly stop a trace when the log becomes to big (5)
Code coverage (6)
Monitor threads (7)
Monitor stack and heap (8)
Monitor memory usage (9)
* will open a new window
** usecases are written in Dutch
UML diagrams
Usecase diagram (phase 1)Usecase diagram (phase 2)
Class diagram (viewer)
Class diagram (agent)
State diagram (tracing)
Collaboration diagram (how the cache of the agent works)
Collaboration diagram (chain of responsibility for commchannel)
* will open a new window
** comments are in Dutch
Tests
Communication channel between the Agent and ViewerResponsibility for storage (viewer vs. agent)