@@ -31,15 +31,50 @@ using namespace network;
3131using namespace system ;
3232
3333// arbitrary testing (const).
34+
35+ void executor::read_test (const hash_digest&) const
36+ {
37+ logger (" Wire size computation." );
38+ const auto start = fine_clock::now ();
39+ const auto last = metadata_.configured .node .maximum_height_ ();
40+ const auto concurrency = metadata_.configured .node .maximum_concurrency_ ();
41+
42+ size_t size{};
43+ for (auto height = zero; !cancel_ && height <= last; ++height)
44+ {
45+ const auto link = query_.to_candidate (height);
46+ if (link.is_terminal ())
47+ {
48+ logger (format (" Max candidate height is (%1%)." ) % sub1 (height));
49+ return ;
50+ }
51+
52+ const auto bytes = query_.get_block_size (link);
53+ if (is_zero (bytes))
54+ {
55+ logger (format (" Block (%1%) is not associated." ) % height);
56+ return ;
57+ }
58+
59+ size += bytes;
60+ if (is_zero (height % concurrency))
61+ {
62+ const auto span = duration_cast<milliseconds>(fine_clock::now () - start);
63+ logger (format (" Wire size (%1%) at (%2%) in (%3%) ms." ) %
64+ size % height % span.count ());
65+ }
66+ }
67+ }
68+
69+ #if defined(UNDEFINED)
70+
3471void executor::read_test (const hash_digest&) const
3572{
3673 logger (format (" Point table body searches: %1% / (%2% + %1%)" ) %
3774 store_.point .positive_search_count () %
3875 store_.point .negative_search_count ());
3976}
4077
41- #if defined(UNDEFINED)
42-
4378void executor::read_test (const hash_digest&) const
4479{
4580 using namespace database ;
@@ -280,37 +315,6 @@ void executor::read_test(const hash_digest&) const
280315 query_.get_height (link));
281316}
282317
283- void executor::read_test (const hash_digest&) const
284- {
285- logger (" Wire size computation." );
286- const auto start = fine_clock::now ();
287- const auto last = metadata_.configured .node .maximum_height ;
288-
289- size_t size{};
290- for (auto height = zero; !cancel_ && height <= last; ++height)
291- {
292- const auto link = query_.to_candidate (height);
293- if (link.is_terminal ())
294- {
295- logger (format (" Max candidate height is (%1%)." ) % sub1 (height));
296- return ;
297- }
298-
299- const auto bytes = query_.get_block_size (link);
300- if (is_zero (bytes))
301- {
302- logger (format (" Block (%1%) is not associated." ) % height);
303- return ;
304- }
305-
306- size += bytes;
307- }
308-
309- const auto span = duration_cast<milliseconds>(fine_clock::now () - start);
310- logger (format (" Wire size (%1%) at (%2%) in (%3%) ms." ) %
311- size % last % span.count ());
312- }
313-
314318void executor::read_test (const hash_digest&) const
315319{
316320 auto start = fine_clock::now ();
0 commit comments