<commit_before><?php
/**
 * @group Benchmark
 */
class Kwf_Benchmark_CounterTest extends Kwf_Test_TestCase
{
    public function testMemcache()
    {
        $this->_test(new Kwf_Benchmark_Counter_Memcache());
    }

    public function testFile()
    {
        $this->_test(new Kwf_Benchmark_Counter_File());
    }

    private function _test($counter)
    {<commit_msg>skip test if memcache is not installed<commit_after><?php
/**
 * @group Benchmark
 */
class Kwf_Benchmark_CounterTest extends Kwf_Test_TestCase
{
    public function testMemcache()
    {
        if (!class_exists('Memcache')) {
            $this->markTestSkipped();
        }
        $this->_test(new Kwf_Benchmark_Counter_Memcache());
    }

    public function testFile()
    {
        $this->_test(new Kwf_Benchmark_Counter_File());
    }

    private function _test($counter)
    {
{'fraction_non_alphanumeric': 0.1133177570093458, 'fraction_numerical': 0.0, 'mean_word_length': 3.1004784688995217, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 8, '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': '4134448', 'n_tokens_mistral': 281, 'n_tokens_neox': 269, 'n_words': 49}