this repo has no description
2
fork

Configure Feed

Select the types of activity you want to include in your feed.

Run Hobbes against an actual disk (!!!)

garrison 981a5d7c 02d9170e

+48 -8
+11 -8
lib/sandbox.ex
··· 29 29 defp default_slots(path) when is_binary(path) do 30 30 [ 31 31 stateless: 6, 32 - tlog: 1..1 |> Enum.map(&"#{path}/tlog#{&1}"), 32 + tlog: 1..1 |> Enum.map(&"#{path}/tlog_#{&1}"), 33 33 storage: 1..4 |> Enum.map(&"#{path}/storage_#{&1}"), 34 34 ] 35 35 end ··· 80 80 String.to_atom("coordinator-#{i}") 81 81 end) 82 82 83 - cluster_path = Keyword.get(opts, :path, :memory) 84 - in_memory? = cluster_path == :memory 85 - if cluster_path != :memory, do: assert(is_binary(cluster_path)) 86 - 87 83 coordinators 88 84 |> Enum.with_index() 89 85 |> Enum.each(fn {_name, i} -> 90 - coordinator_path = case cluster_path do 86 + cluster_node_path = case Keyword.get(opts, :path, :memory) do 87 + :memory -> :memory 88 + path when is_binary(path) -> Path.join(path, "/cluster_node_#{i}") 89 + end 90 + in_memory? = cluster_node_path == :memory 91 + 92 + coordinator_path = case cluster_node_path do 91 93 :memory -> :memory 92 - path -> "#{path}/coordinator_#{i}" 94 + path when is_binary(path) -> Path.join(path, "coordinator-#{i}") 93 95 end 96 + 94 97 node_config = [ 95 98 cluster: Keyword.fetch!(opts, :cluster_name), 96 99 coordinators: coordinators, ··· 100 103 101 104 in_memory?: in_memory?, 102 105 # TODO: configurable 103 - slots: default_slots(cluster_path), 106 + slots: default_slots(cluster_node_path), 104 107 ] 105 108 106 109 ClusterNode.start_link(node_config)
+5
lib/xks/xks.ex
··· 128 128 def new(kw_opts \\ []) do 129 129 opts = parse_opts(kw_opts) 130 130 131 + if not Sim.simulated?() and Keyword.get(kw_opts, :path, :memory) != :memory do 132 + require Logger 133 + Logger.warning("Creating XKS: #{Keyword.fetch!(kw_opts, :path)}") 134 + end 135 + 131 136 block_store = 132 137 case Keyword.get(kw_opts, :path, :memory) do 133 138 :memory -> {:memory, MemoryStore.new(opts.block_size)}
+32
test/hobbes_test.exs
··· 338 338 ])) 339 339 end 340 340 end 341 + 342 + defmodule ReadWriteDiskWorkloadTest do 343 + use ExUnit.Case, async: true 344 + @tag :disk_rw 345 + @tag :disable 346 + @tag :tmp_dir 347 + 348 + test "ReadWrite", %{test: test, tmp_dir: tmp_dir} do 349 + cluster_path = Path.join(tmp_dir, "hobbes_cluster") 350 + 351 + # Disable debug logs outside of sim 352 + # TODO: should have a better way of doing this 353 + Logger.configure(level: :info) 354 + Workloads.run([ 355 + {Workloads.ReadWrite, [ 356 + clients: 100, 357 + client_tick_ms: 1, 358 + duration_ms: 10_000, 359 + profiling: true, 360 + check: false, 361 + ]}, 362 + ], HobbesTest.SimOpts.sim_opts(name: test, simulated: false, count: 1, cluster_opts: [ 363 + path: cluster_path, 364 + num_coordinators: 3, 365 + num_commit_buffers: 1, 366 + num_tlog_teams: 1, 367 + num_storage_teams: 1, 368 + replication_factor: 1, 369 + initial_shards: [""], 370 + ])) 371 + end 372 + end 341 373 end