You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: statistics.rs
    path of file: ./repos/prisma-engines/schema-engine/connectors/mongodb-schema-connector/src/sampler
    
    the code of the file until where you have to start completion: mod indices;
mod name;

pub(crate) use name::Name;
use renderer::{
    datamodel::{IdFieldDefinition, UniqueFieldAttribute},
    value::Function,
};
use schema_connec
    
    fn percentages(&self) -> FieldPercentages {
        let total = self.types.iter().fold(0, |acc, (_, count)| acc + count);
        let mut data = BTreeMap::new();

        for (typ, count) in self.types.iter() {
            let p = data.entry(typ.clone()).or_default();
            *p = (*count as f64) / (total as f64);
        }

        FieldPercentages { data }
    }