A better way to do thread renaming

"이희승 (Trustin Lee)" trustin at gmail.com
Wed Aug 25 06:53:08 EDT 2010


Hi Neil,

Glad that you like the change.  You could replace the default
ThreadNameDeterminer to do that.  Please refer to the source code and
feel free to adapt it to your taste:


http://fisheye.jboss.org/browse/Netty/trunk/src/main/java/org/jboss/netty/util/ThreadNameDeterminer.java?r=2349

Cheers,
Trustin

On 08/25/2010 03:17 PM, Neil Avery wrote:
> Hi Trustin,
> Thats great to hear - netty keeps on getting better.
> 
> Is is possible to have a '-' delimiter between the name parts?
> 
> Regards,
> Neil.
> 
> On Wed, Aug 25, 2010 at 3:34 AM, "이희승 (Trustin Lee)"
> <trustin at gmail.com <mailto:trustin at gmail.com>> wrote:
> 
> 
> 
>     On 07/14/2010 04:46 PM, Galder Zamarreño wrote:
>     >
>     > On Jul 2, 2010, at 9:59 AM, 이희승 (Trustin Lee) wrote:
>     >
>     >> Service: New I/O, Old I/O, ...
>     >> Category: server boss, server worker, client boss, client worker, ...
>     >> Comment: local address, remote address, channel ID, ... (depending on
>     >> transport)
>     >>
>     >> It might be a better idea to limit the allowed characters for
>     service,
>     >> category, and thread ID (no whitespace for example.)
>     >
>     > That's definitely a good idea. Think about grep. Quite often I
>     grep by thread name and if it contains spaces, you have to start
>     putting double quotes.
> 
>     netty-trunk now allows only [a-zA-Z0-9]* for service/category names.
> 
>     Thread ID has been split into parentId and id and each allows only
>     [a-zA-Z0-9]* likewise.  The resulting default thread name looks like
>     this:
> 
>        "NewIO ServerBoss #1 ([id: 0x00785d65, /0:0:0:0:0:0:0:0:8080])"
>        "NewIO ServerWorker #1:1"
> 
>     There's no restriction on comments - I thought it will be too much since
>     it's for human primarily.
> 
>     Please feel free to let me know if you have more nice ideas.
> 
>     Cheers,
>     Trustin
> 
>     --
>     what we call human nature in actuality is human habit
>     http://gleamynode.net/
>     _______________________________________________
>     netty-users mailing list
>     netty-users at lists.jboss.org <mailto:netty-users at lists.jboss.org>
>     https://lists.jboss.org/mailman/listinfo/netty-users
> 
> 
> 
> 
> -- 
> 
> www.liquidlabs.co.uk <http://www.liquidlabs.co.uk>
> 
> 
> 
> _______________________________________________
> netty-users mailing list
> netty-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/netty-users

-- 
what we call human nature in actuality is human habit
http://gleamynode.net/

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 293 bytes
Desc: OpenPGP digital signature
Url : http://lists.jboss.org/pipermail/netty-users/attachments/20100825/f6477d76/attachment.bin 


More information about the netty-users mailing list