<commit_before>from dtest import Tester, debug
from assertions import *
from tools import *

from os.path import getsize
import time

class TestCounters(Tester):

    def split_test(self):
        """
        Check that after running compaction, sstablessplit can succesfully split
        The resultant sstable.  Check that split is reversable and that data is readable
        after carrying out these operations.
        """
        cluster = self.cluster
        cluster.populate(1).start()
        node = cluster.nodelist()[0]
        debug("Run stress to insert data")
        if cluster.version() < "2.1":
            node.stress( ['-o', 'insert'] )
        else:
            node.stress( ['write', 'n=1000000'] )
        
        self._do_compaction(node)
        self._do_split(node)
        self._do_compaction(node)
        self._do_split(node)

        debug("Run stress to ensure data is readable")
        if cluster.version() < "2.1":
            node.stress( ['-o', 'read'] )
        else:
            node.stress( ['read', 'n=1000000', '-rate', 'threads=8'] )

    def _do_compaction(self, node):
        debug("Compact sstables.")
        node.compact()<commit_msg>Use 8 threads on write, otherwise default is 50<commit_after>from dtest import Tester, debug
from assertions import *
from tools import *

from os.path import getsize
import time

class TestCounters(Tester):

    def split_test(self):
        """
        Check that after running compaction, sstablessplit can succesfully split
        The resultant sstable.  Check that split is reversable and that data is readable
        after carrying out these operations.
        """
        cluster = self.cluster
        cluster.populate(1).start()
        node = cluster.nodelist()[0]
        debug("Run stress to insert data")
        if cluster.version() < "2.1":
            node.stress( ['-o', 'insert'] )
        else:
            node.stress( ['write', 'n=1000000', '-rate', 'threads=8'] )
        
        self._do_compaction(node)
        self._do_split(node)
        self._do_compaction(node)
        self._do_split(node)

        debug("Run stress to ensure data is readable")
        if cluster.version() < "2.1":
            node.stress( ['-o', 'read'] )
        else:
            node.stress( ['read', 'n=1000000', '-rate', 'threads=8'] )

    def _do_compaction(self, node):
        debug("Compact sstables.")
        node.compact()
{'fraction_non_alphanumeric': 0.11767134599504542, 'fraction_numerical': 0.018992568125516102, 'mean_word_length': 2.28319783197832, 'pattern_counts': {'":': 4, '<': 7, '<?xml version=': 0, '>': 3, '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': '471700', 'n_tokens_mistral': 737, 'n_tokens_neox': 685, 'n_words': 203}