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 2022/12/02 07:53:37 UTC

[GitHub] [doris] yiguolei commented on a diff in pull request #14742: [enhancement](memory) Add tablet schema cache metrics

yiguolei commented on code in PR #14742:
URL: https://github.com/apache/doris/pull/14742#discussion_r1037870333


##########
be/src/olap/tablet_schema_cache.h:
##########
@@ -49,6 +50,9 @@ class TabletSchemaCache {
             pb.ParseFromString(key);
             tablet_schema_ptr->init_from_pb(pb);
             _cache[key] = tablet_schema_ptr;
+            DorisMetrics::instance()->tablet_schema_cache_count->increment(1);
+            DorisMetrics::instance()->tablet_schema_cache_memory_bytes->increment(
+                    tablet_schema_ptr->mem_size());

Review Comment:
   mem_size method is not accurate. And I find it is very tick.
      std::vector<TabletColumn> _cols;
       std::vector<TabletIndex> _indexes;
       std::unordered_map<std::string, int32_t> _field_name_to_index;
       std::unordered_map<int32_t, int32_t> _field_id_to_index;
   
   TableSchema has a lot of properties. 
   
   I think you could add a property in TabletSchema and using scoped_mem_tracker to set its size during init_from_pb.
   
   And you could remove all mem_size method. I find it is useless before.



-- 
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