You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@trafficserver.apache.org by "Yunkai Zhang (JIRA)" <ji...@apache.org> on 2013/08/26 09:18:52 UTC

[jira] [Comment Edited] (TS-2156) Stats trap in threads created by spawn_event_threads() and spawn_thread()

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

Yunkai Zhang edited comment on TS-2156 at 8/26/13 7:18 AM:
-----------------------------------------------------------

I think stats is a very basic infrastructure for ATS, whatever type of threads should include this capability. Eache developer will benefit from this improvement. 

Remap processor thread maybe a slight different from stats(I'm not so familiar with it now), so let me give a patch to make stats in both type of threads transparent for upper layer developers firstly.

                
      was (Author: yunkai):
    I think stats is a very basic infrastructure for ATS, whatever type of threads should include this capability. Eache developer will benefit from this improvement.

So I'll give a patch to make it transparent for upper layer developers.

                  
> Stats trap in threads created by spawn_event_threads() and spawn_thread()
> -------------------------------------------------------------------------
>
>                 Key: TS-2156
>                 URL: https://issues.apache.org/jira/browse/TS-2156
>             Project: Traffic Server
>          Issue Type: Improvement
>          Components: Stats
>            Reporter: Yunkai Zhang
>             Fix For: 4.1.0
>
>
> There are two ways to create threads in ATS:
> 1) By EventProcessor::spawn_event_threads(), such as ET_NET threads.
> 2) By EventProcessor::spawn_thread(), such as flush thread.
> But I found that we can't stats the same things across these two type of threads.
> For example, I used the following statement in _checkout_write() to do stats before add to flusher queue:
> {code}
> LogBuffer *
> LogObject::_checkout_write(size_t * write_offset, size_t bytes_needed) {
>   ...
>   LOG_SUM_DYN_STAT(log_stat_bytes_add_to_flush_queue, buffer->header()->byte_count);  
>   m_buffer_manager[idx].add_to_flush_queue(buffer);
>   Log::preproc_notify[idx].signal();
>   ...
> }
> {code}
> As _checkout_write() function will be executed at ET_NET threads and flush thread, the stats value will be incomplete -- the value collected in flush thread will not be merged into the final result.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira