@@ -135,6 +135,48 @@ for _, pair := range pairs {
135135}
136136```
137137
138+ ### Column Family Statistics
139+ You can retrieve detailed statistics about a column family using the ` GetColumnFamilyStat ` method.
140+
141+ ``` go
142+ stat , err := db.GetColumnFamilyStat (" example_cf" )
143+ if err != nil {
144+ ...
145+ }
146+
147+ // Access various statistics about the column family
148+ fmt.Printf (" Column Family: %s \n " , stat.Name )
149+ fmt.Printf (" Memtable Size: %d bytes\n " , stat.MemtableSize )
150+ fmt.Printf (" Memtable Entries: %d \n " , stat.MemtableEntryCount )
151+ fmt.Printf (" Number of SSTables: %d \n " , stat.NumSSTables )
152+ fmt.Printf (" Incremental Merging: %t \n " , stat.IncrementalMerging )
153+
154+ // Access configuration details
155+ fmt.Printf (" Flush Threshold: %d \n " , stat.Config .FlushThreshold )
156+ fmt.Printf (" Max Level: %d \n " , stat.Config .MaxLevel )
157+ fmt.Printf (" Probability: %f \n " , stat.Config .Probability )
158+ fmt.Printf (" Compressed: %t \n " , stat.Config .Compressed )
159+ fmt.Printf (" Bloom Filter: %t \n " , stat.Config .BloomFilter )
160+
161+ // Access SSTable statistics
162+ for i , sstStat := range stat.SSTableStats {
163+ fmt.Printf (" SSTable %d - Path: %s , Size: %d bytes, Blocks: %d \n " ,
164+ i, sstStat.Path , sstStat.Size , sstStat.NumBlocks )
165+ }
166+ ```
167+
168+ ### Listing Column Families
169+ You can retrieve a list of all column families.
170+ ``` go
171+ cfList , err := db.ListColumnFamilies ()
172+ if err != nil {
173+ ...
174+ }
175+
176+ fmt.Println (" Available column families:" , cfList)
177+ ```
178+
179+
138180### Compaction
139181Compaction is done manually or in background incrementally.
140182
0 commit comments