<commit_before>use std::collections::HashMap;

use metric::Metric;
use std::rc::Rc;
use registry::Registry;
use counter::Counter;
use ewma::EWMA;
use gauge::Gauge;
use meter::Meter;

pub trait Reporter {
    fn report(self, report_card: ReportCard);

    fn get_unique_reporter_name(&self) -> &'static str;
}

pub struct ReportCard {
    metrics: HashMap<String, Box<Metric>>,
}

impl Reporter for ConsoleReporter {
    fn report(self, report_card: ReportCard ) {

    }

    fn get_unique_reporter_name(&self) -> &'static str {
        "console-reporter"
    }
}


pub struct ConsoleReporter;
/*

impl<'a> ConsoleReporter<'a> {
    pub fn new(registry_to_report_to_console:Rc<Registry<'a>>) -> ConsoleReporter<'a> {
        ConsoleReporter {registry: registry_to_report_to_console}
    }
}


#[cfg(test)]
mod test {
    use meter::StdMeter;
    use registry::{Registry, StdRegistry};

    #[test]
    fn meter() {
        let mut r: StdRegistry = StdRegistry::new();
        let m: StdMeter = StdMeter::new();

        r.insert("foo", m);
        r.get("foo");
    }
}
*/
<commit_msg>Allow the reporter name to be configurable<commit_after>use std::collections::HashMap;

use metric::Metric;
use std::rc::Rc;
use registry::Registry;
use counter::Counter;
use ewma::EWMA;
use gauge::Gauge;
use meter::Meter;

pub trait Reporter {
    fn report(self, report_card: ReportCard);

    fn get_unique_reporter_name(&self) -> &'static str;
}

pub struct ReportCard {
    metrics: HashMap<String, Box<Metric>>,
}

impl Reporter for ConsoleReporter {
    fn report(self, report_card: ReportCard ) {

    }

    fn get_unique_reporter_name(&self) -> &'static str {
        self.reporter_name
    }
}


pub struct ConsoleReporter {
    reporter_name : & 'static str
}


impl ConsoleReporter {
    pub fn new(reporter_name: & 'static str) -> ConsoleReporter {
        ConsoleReporter {reporter_name : reporter_name}
    }
}

/*
#[cfg(test)]
mod test {
    use meter::StdMeter;
    use registry::{Registry, StdRegistry};

    #[test]
    fn meter() {
        let mut r: StdRegistry = StdRegistry::new();
        let m: StdMeter = StdMeter::new();

        r.insert("foo", m);
        r.get("foo");
    }
}
*/

{'fraction_non_alphanumeric': 0.13752276867030966, 'fraction_numerical': 0.0, 'mean_word_length': 3.502049180327869, 'pattern_counts': {'":': 0, '<': 12, '<?xml version=': 0, '>': 18, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4177515', 'n_tokens_mistral': 760, 'n_tokens_neox': 752, 'n_words': 173}