Uploaded image for project: 'Traffic Server'
  1. Traffic Server
  2. TS-2156

Stats trap in threads created by spawn_event_threads() and spawn_thread()

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 4.1.2
    • Component/s: Metrics
    • Labels:
      None

      Description

      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:

      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();
        ...
      }
      

      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.

        Attachments

          Activity

            People

            • Assignee:
              yunkai Yunkai Zhang
              Reporter:
              yunkai Yunkai Zhang
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: