<commit_before>#!/usr/bin/ruby

# Helper script to generate a priv/config file and start/stop scripts
# with num_nodes of unjoined nodes, all running on 127.0.0.1.  For
# example, to get a 100 node setup with 5 extra buckets, try...
#
#   ./gen_priv_config.rb 100 5
#
# The above will generate files like...
#
#   cluster_config
#   cluster_run.sh
#
# The node names will look like n_0@127.0.0.1, n_1@127.0.0.1, ...
#
# The extra buckets (which are in addition to the usual default
# bucket) will look like b_0, b_1, ...
#
require 'fileutils'

prefix = ARGV[2] || "cluster"

num_nodes = ARGV[0] || "10"
num_nodes = num_nodes.to_i

num_buckets = ARGV[1] || "0"
num_buckets = num_buckets.to_i

base_direct_port = (ENV['BASE_DIRECT_PORT'] || ENV['BASE_CACHE_PORT'] || "12000").to_i
base_api_port = (ENV['BASE_API_PORT'] || "9000").to_i

nodes = ""

num_nodes.times do |x|
  node_id = "'n_#{x + base_api_port - 9000}@127.0.0.1'"
  node_data = "./data/n_#{x + base_api_port - 9000}"
  FileUtils.mkdir_p node_data
  nodes = nodes + <<-END
    {{node, #{node_id}, rest},
      [{port, #{x + base_api_port}}]}.

    {{node, #{node_id}, memcached}, [
                 {port, #{(x * 2) + base_direct_port}},
                 {dbdir, "#{node_data}"},
                 {admin_user, "_admin"},
                 {admin_pass, <PASSWORD>"},
                 {bucket_engine, "./bin/bucket_engine/bucket_engine.so"},
                 {engine, "./bin/ep_engine/ep.so"},
                 {verbosity, ""}
                 ]}.

    {{node, #{node_id}, ns_log}, [{filename, "#{node_data}/logs.bin"}]}.<commit_msg>Add engines to single-host cluster test config<commit_after>#!/usr/bin/ruby

# Helper script to generate a priv/config file and start/stop scripts
# with num_nodes of unjoined nodes, all running on 127.0.0.1.  For
# example, to get a 100 node setup with 5 extra buckets, try...
#
#   ./gen_priv_config.rb 100 5
#
# The above will generate files like...
#
#   cluster_config
#   cluster_run.sh
#
# The node names will look like n_0@127.0.0.1, n_1@127.0.0.1, ...
#
# The extra buckets (which are in addition to the usual default
# bucket) will look like b_0, b_1, ...
#
require 'fileutils'

prefix = ARGV[2] || "cluster"

num_nodes = ARGV[0] || "10"
num_nodes = num_nodes.to_i

num_buckets = ARGV[1] || "0"
num_buckets = num_buckets.to_i

base_direct_port = (ENV['BASE_DIRECT_PORT'] || ENV['BASE_CACHE_PORT'] || "12000").to_i
base_api_port = (ENV['BASE_API_PORT'] || "9000").to_i

nodes = ""

num_nodes.times do |x|
  node_id = "'n_#{x + base_api_port - 9000}@127.0.0.1'"
  node_data = "./data/n_#{x + base_api_port - 9000}"
  FileUtils.mkdir_p node_data
  nodes = nodes + <<-END
    {{node, #{node_id}, rest},
      [{port, #{x + base_api_port}}]}.

    {{node, #{node_id}, memcached}, [
                 {port, #{(x * 2) + base_direct_port}},
                 {dbdir, "#{node_data}"},
                 {admin_user, "_admin"},
                 {admin_pass, <PASSWORD>"},
                 {bucket_engine, "./bin/bucket_engine/bucket_engine.so"},
                 {engines, [{membase, "./bin/ep_engine/ep.so"},
                            {memcached, "./bin/memcached/default_engine.so"}]},
                 {verbosity, ""}
                 ]}.

    {{node, #{node_id}, ns_log}, [{filename, "#{node_data}/logs.bin"}]}.
{'fraction_non_alphanumeric': 0.17034795763993948, 'fraction_numerical': 0.036308623298033284, 'mean_word_length': 2.722972972972973, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 8, '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': '940846', 'n_tokens_mistral': 1285, 'n_tokens_neox': 1202, 'n_words': 282}