You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by GitBox <gi...@apache.org> on 2021/08/16 12:26:47 UTC

[GitHub] [incubator-doris] BiteTheDDDDt opened a new issue #6458: [Bug]Wrong use on SCOPED_RAW_TIMER

BiteTheDDDDt opened a new issue #6458:
URL: https://github.com/apache/incubator-doris/issues/6458


   **Describe the bug**
   `SCOPED_RAW_TIMER` can be used to calculate the time usage in the life cycle. 
   It will only update the time when it is destruct.
   I found it was used incorrectly in some places.
   ```cpp
       std::vector<scoped_refptr<Thread>> threads(1000);
       {
           int64_t thread_creation_ns = 0;
           SCOPED_RAW_TIMER(&thread_creation_ns);
           for (auto& t : threads) {
               Status status = Thread::create("test", "TestCallOnExit", SleepFor,
                                              MonoDelta::FromSeconds(0), &t);
               ASSERT_TRUE(status.ok());
           }
           std::cout << "create 1000 threads use:" << thread_creation_ns << "ns" << std::endl;
       }
   ```
   Like here, the output result will always be 0.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[GitHub] [incubator-doris] yangzhg closed issue #6458: [Bug]Wrong use on SCOPED_RAW_TIMER

Posted by GitBox <gi...@apache.org>.
yangzhg closed issue #6458:
URL: https://github.com/apache/incubator-doris/issues/6458


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[GitHub] [incubator-doris] yangzhg closed issue #6458: [Bug]Wrong use on SCOPED_RAW_TIMER

Posted by GitBox <gi...@apache.org>.
yangzhg closed issue #6458:
URL: https://github.com/apache/incubator-doris/issues/6458


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org