[ 
https://issues.apache.org/jira/browse/BOOKKEEPER-862?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14695287#comment-14695287
 ] 

Rakesh R commented on BOOKKEEPER-862:
-------------------------------------

Thanks [~hustlmsp], [~l4stewar], nice improvement!

Just few thoughts:
# Since OrderedSafeExecutor#Builder is added I think we can either remove the 
{{public OrderedSafeExecutor(int numThreads, String threadName)}} or deprecate 
it.
#  
[BookieClient.java#L321|https://github.com/apache/bookkeeper/blob/master/bookkeeper-server/src/main/java/org/apache/bookkeeper/proto/BookieClient.java#L321]
 also use {{new OrderedSafeExecutor(1);}}. Could you please modify this to 
{{OrderedSafeExecutor.newBuilder()}} pattern.
# This is just a suggestion, feel free to ignore. If some creator of new 
SafeRunnable() object miss to override #toString() method, it will print Object 
representation. One imprv I can think is define {{abstract String getName()}} 
method in SafeRunnable.java, so that creators will be forced to give meaningful 
name and while logging use {{runnable#getName}}.
{code}
+logger.warn("Runnable {}:{} took too long {} micros to execute.",
+                            new Object[] { runnable, runnable.getClass(), 
elapsedMicroSec });
{code}

> Add tracing and stats to OrderedSafeExecutor for debugging slow tasks
> ---------------------------------------------------------------------
>
>                 Key: BOOKKEEPER-862
>                 URL: https://issues.apache.org/jira/browse/BOOKKEEPER-862
>             Project: Bookkeeper
>          Issue Type: Improvement
>          Components: bookkeeper-server
>            Reporter: Leigh Stewart
>            Assignee: Leigh Stewart
>            Priority: Minor
>             Fix For: 4.4.0
>
>         Attachments: ose_stats-rebase.patch, ose_stats.patch
>
>
> Porting a change form the Twitter branch to improve stats and logging in 
> OrderedSafeExecutor
> These changes have been helpful for us in debugging latency issues in 
> Bookkeeper server/client 
> Summary of changes is
> * add a config option for op stats
> * add stats for task execution time, task pending time
> * add a config option for logging a warning when an op takes longer than x 
> micros
> * add toString implementations for submitted tasks so make it easier to track 
> down slow ops
> * start using Builder for OrderedSafeExecutor
> * add a very simple test to make sure that the slow op logging path is 
> exercised
> Most of this came from Sijie originally, with some changes from me
>  



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to