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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]