The class java.lang.ThreadInfo provides some very useful methods which provide statistic concerning synchronization in Java. For instance:
getBlockedTime() Returns the approximate accumulated elapsed time (in milliseconds) that the thread associated with this ThreadInfo has blocked to enter or reenter a monitor since thread contention monitoring is enabled. [...]
getWaitedCount() Returns the total number of times that the thread associated with this ThreadInfo waited for notification. [...]
I cannot find functions to access these information from the JVMTI API. Do I overlook it or do I have to collect these information myself?
Besides from synchronization statistic, it seems you cannot even get a Threads id, which can be obtained by using Thread.currentThread().getId();