add bits per element info on hover

This commit is contained in:
silverweed 2024-08-22 15:10:04 +02:00
parent c06b23e0e7
commit b3620a4651
2 changed files with 4 additions and 1 deletions

View file

@ -124,6 +124,7 @@ void gather_ntuple_metadata(Arena *arena, RMicroFileReader &reader, const RNTupl
assert(cluster_desc.GetId() <= UINT_MAX);
pinfo->cluster_id = cluster_desc.GetId();
pinfo->elem_type_name = push_str8f(arena, "%s", elem_type_name.c_str());
pinfo->bits_per_elem = col_descriptor.GetBitsOnStorage();
Cluster_Info &cluster = clusters[pinfo->cluster_id];
if (!cluster.first_page || pinfo->range.start < cluster.first_page->range.start) {
@ -807,7 +808,8 @@ Sec_Hover_Info get_section_hover_info(Arena *arena, Section section, u64 off, co
String8 sec_name = section_names[section.id];
if (section.id == Sec_Page && section.info) {
Page_Info_Node *pinfo = (Page_Info_Node *)section.info;
info.desc = push_str8_node(arena, nullptr, "%s [%s, n.elems: %d]", sec_name.c(), pinfo->elem_type_name.c(), abs(pinfo->n_elems));
info.desc = push_str8_node(arena, nullptr, "%s [%s, n.elems: %d (%u b)]",
sec_name.c(), pinfo->elem_type_name.c(), abs(pinfo->n_elems), pinfo->bits_per_elem);
} else {
info.desc = push_str8_node(arena, nullptr, "%s", sec_name.c());
}

View file

@ -18,6 +18,7 @@ struct Page_Info_Node {
u32 cluster_id;
b8 is_first_in_cluster;
u8 bits_per_elem;
String8 elem_type_name;
inline u64 checksum_size() const {