dummy app for getting the sizes of various types related to keys

This commit is contained in:
Toby Lawrence 2020-11-02 19:57:37 -05:00
parent e926a6b6c6
commit d72a744a76
1 changed files with 13 additions and 0 deletions

13
metrics/examples/sizes.rs Normal file
View File

@ -0,0 +1,13 @@
//! This example is purely for development.
use std::borrow::Cow;
use metrics::{Key, KeyData, NameParts, Label, SharedString};
fn main() {
println!("KeyData: {} bytes", std::mem::size_of::<KeyData>());
println!("Key: {} bytes", std::mem::size_of::<Key>());
println!("NameParts: {} bytes", std::mem::size_of::<NameParts>());
println!("Label: {} bytes", std::mem::size_of::<Label>());
println!("Cow<'static, [Label]>: {} bytes", std::mem::size_of::<Cow<'static, [Label]>>());
println!("Vec<SharedString>: {} bytes", std::mem::size_of::<Vec<SharedString>>());
println!("[Option<SharedString>; 2]: {} bytes", std::mem::size_of::<[Option<SharedString>; 2]>());
}