Skip to content

Commit 29471f4

Browse files
authored
Merge pull request #1033 from evoskuil/master
Add warn dirty paging settings.
2 parents b83312a + c256e83 commit 29471f4

3 files changed

Lines changed: 16 additions & 10 deletions

File tree

include/bitcoin/node/settings.hpp

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ class BCN_API settings
3434
settings(system::chain::selection context) NOEXCEPT;
3535

3636
/// Properties.
37+
uint32_t threads;
3738
bool delay_inbound;
3839
bool headers_first;
3940
bool thread_priority;
@@ -47,14 +48,15 @@ class BCN_API settings
4748
float minimum_bump_rate;
4849
uint16_t announcement_cache;
4950
uint16_t fee_estimate_horizon;
50-
////uint64_t snapshot_bytes;
51-
////uint32_t snapshot_valid;
52-
////uint32_t snapshot_confirm;
5351
uint32_t maximum_height;
5452
uint32_t maximum_concurrency;
5553
uint16_t sample_period_seconds;
5654
uint32_t currency_window_minutes;
57-
uint32_t threads;
55+
uint16_t warn_dirty_background_ratio;
56+
uint16_t warn_dirty_ratio;
57+
////uint64_t snapshot_bytes;
58+
////uint32_t snapshot_valid;
59+
////uint32_t snapshot_confirm;
5860

5961
/// Helpers.
6062
virtual size_t threads_() const NOEXCEPT;

src/settings.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@ namespace libbitcoin {
3030
namespace node {
3131

3232
settings::settings() NOEXCEPT
33-
: delay_inbound{ true },
33+
: threads{ 1 },
34+
delay_inbound{ true },
3435
headers_first{ true },
3536
memory_priority{ true },
3637
thread_priority{ true },
@@ -50,7 +51,8 @@ settings::settings() NOEXCEPT
5051
maximum_concurrency{ 50'000 },
5152
sample_period_seconds{ 10 },
5253
currency_window_minutes{ 1440 },
53-
threads{ 1 }
54+
warn_dirty_background_ratio{ 90_u16 },
55+
warn_dirty_ratio{ 90_u16 }
5456
{
5557
}
5658

test/settings.cpp

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ BOOST_AUTO_TEST_CASE(settings__node__default_context__expected)
3030
using namespace network;
3131

3232
const node::settings node{};
33+
BOOST_REQUIRE_EQUAL(node.threads, 1_u32);
3334
BOOST_REQUIRE_EQUAL(node.delay_inbound, true);
3435
BOOST_REQUIRE_EQUAL(node.headers_first, true);
3536
BOOST_REQUIRE_EQUAL(node.memory_priority, true);
@@ -43,16 +44,17 @@ BOOST_AUTO_TEST_CASE(settings__node__default_context__expected)
4344
BOOST_REQUIRE_EQUAL(node.allowed_deviation, 1.5);
4445
BOOST_REQUIRE_EQUAL(node.announcement_cache, 42_u16);
4546
BOOST_REQUIRE_EQUAL(node.fee_estimate_horizon, 0u);
46-
////BOOST_REQUIRE_EQUAL(node.snapshot_bytes, 200'000'000'000_u64);
47-
////BOOST_REQUIRE_EQUAL(node.snapshot_valid, 250'000_u32);
48-
////BOOST_REQUIRE_EQUAL(node.snapshot_confirm, 500'000_u32);
4947
BOOST_REQUIRE_EQUAL(node.maximum_height, 0_u32);
5048
BOOST_REQUIRE_EQUAL(node.maximum_height_(), max_size_t);
5149
BOOST_REQUIRE_EQUAL(node.maximum_concurrency, 50000_u32);
5250
BOOST_REQUIRE_EQUAL(node.maximum_concurrency_(), 50000_size);
5351
BOOST_REQUIRE_EQUAL(node.sample_period_seconds, 10_u16);
5452
BOOST_REQUIRE_EQUAL(node.currency_window_minutes, 1440_u32);
55-
BOOST_REQUIRE_EQUAL(node.threads, 1_u32);
53+
BOOST_REQUIRE_EQUAL(node.warn_dirty_background_ratio, 90_u16);
54+
BOOST_REQUIRE_EQUAL(node.warn_dirty_ratio, 90_u16);
55+
////BOOST_REQUIRE_EQUAL(node.snapshot_bytes, 200'000'000'000_u64);
56+
////BOOST_REQUIRE_EQUAL(node.snapshot_valid, 250'000_u32);
57+
////BOOST_REQUIRE_EQUAL(node.snapshot_confirm, 500'000_u32);
5658

5759
BOOST_REQUIRE_EQUAL(node.threads_(), one);
5860
BOOST_REQUIRE_EQUAL(node.maximum_height_(), max_size_t);

0 commit comments

Comments
 (0)