Hi all,
after having a first code review, it has been suggested to do following
changes.

   1. rename the class name according to the purpose
   2. change pid to integer type variable
   3. use enum values provided by the API where its possible
   4. mbeanobject return set, but returns only one object
   5. change methods to use query filter and not
   6. no need to return list in getThreadmxbeanobjects
   7. pass the thread type as a parameter
   8. getallthreadids - pass the bean as a parameter to filter inside the
   method
   9. change parameter <name> as <threadname> in the getthreadcount method
   10. rename input parameters in methods to meaningful names
   11. getthreaddump public
   12. overload gethreaddump method/ use this where ever can be used
   13. save the original thread dump, do not append additional info
   14. do not override the dump file with same name, append the time stamp
   15. move file-name to global parameter
   16. close the streams in finnaly block
   17. assign fullthreaddump to null after finish process
   18. getdeadlockthreads public
   19. check for null value in createthreaddumpfile.

now i'm currently working on this.
thanks.

On Tue, Jan 6, 2015 at 10:16 AM, Buddhi Senarathna <[email protected]> wrote:

> hi all,
>
>
> My task of creating a tool to take thread dumps and analyze thread info as 
> test
> framework utility is almost finished.
>
> to had cover these task.
>
>    1. access to a process remotely using process id.
>    2. get thread dump of that remote process .
>    3. expose necessary informations of thread dump using some methods in
>    realtime.
>    4. give a method to write thread dump into a file.
>
> to do this I used JMX Api and tools.jar library which provides JDK. used
> java version is 1.6.0_32.
>
> thank you.
>
> On Wed, Dec 24, 2014 at 11:23 AM, Buddhi Senarathna <[email protected]>
> wrote:
>
>> Hi krishantha,
>> noted and will change it in next update.
>>
>> thanks
>>
>> On Wed, Dec 24, 2014 at 11:21 AM, Buddhi Senarathna <[email protected]>
>> wrote:
>>
>>> Hi hasitha,
>>> thanks a lot, but i'm using JMX api for this. j
>>>
>>> On Tue, Dec 23, 2014 at 6:27 PM, Hasitha Aravinda <[email protected]>
>>> wrote:
>>>
>>>> Hi Buddi,
>>>>
>>>> Are you using JStack ? By default, java thread dump does not record
>>>> lock owners for locks. If you use jstack, use "-l" parameter as well
>>>> [1]. (eg: jstack -l "pid"  ). This params records lock owner
>>>> information only for synchronized blocks. Which is usefull to detect
>>>> possible deadlocks.
>>>>
>>>> [1] -
>>>> http://docs.oracle.com/javase/7/docs/technotes/tools/share/jstack.html
>>>>
>>>> Thanks,
>>>> Hasitha.
>>>>
>>>> On Tue, Dec 23, 2014 at 6:02 PM, Buddhi Senarathna <[email protected]>
>>>> wrote:
>>>>
>>>>> hi all,
>>>>>
>>>>> I'm working on creating a tool to take thread dumps and analyze thread
>>>>> info as carbon test utility.
>>>>>
>>>>> to do that i have to cover these task.
>>>>>
>>>>>    1. access to a process remotely using process id.
>>>>>    2. get thread dump of that remote process .
>>>>>    3. expose necessary informations of thread dump using some methods
>>>>>    in realtime.
>>>>>    4. give a method to write thread dump into a file.
>>>>>
>>>>>
>>>>> Note: currently 1st and 2nd tasks are completed.
>>>>>
>>>>> thank you.
>>>>>
>>>>>
>>>>> --
>>>>>
>>>>> *Buddhi Chathuranga Senarathna*
>>>>>
>>>>>
>>>>> *InternWSO2, Inc. *
>>>>> *Mob: +94 755 446 685 <%2B94%20755%20446%20685>*
>>>>>
>>>>> _______________________________________________
>>>>> Dev mailing list
>>>>> [email protected]
>>>>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>>>>
>>>>>
>>>>
>>>>
>>>> --
>>>> Hasitha Aravinda,
>>>> Software Engineer,
>>>> WSO2 Inc.
>>>> Email: [email protected]
>>>> Mobile: +94 71 8 210 200
>>>>
>>>>
>>>
>>>
>>> --
>>>
>>> *Buddhi Chathuranga Senarathna*
>>>
>>>
>>> *InternWSO2, Inc. *
>>> *Mob: +94 755 446 685 <%2B94%20755%20446%20685>*
>>>
>>
>>
>>
>> --
>>
>> *Buddhi Chathuranga Senarathna*
>>
>>
>> *InternWSO2, Inc. *
>> *Mob: +94 755 446 685 <%2B94%20755%20446%20685>*
>>
>
>
>
> --
>
> *Buddhi Chathuranga Senarathna*
>
>
> *InternWSO2, Inc. *
> *Mob: +94 755 446 685 <%2B94%20755%20446%20685>*
>



-- 

*Buddhi Chathuranga Senarathna*


*InternWSO2, Inc. *
*Mob: +94 755 446 685*
_______________________________________________
Dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to