LCOV - code coverage report
Current view: top level - tests - agmap_suite.cpp (source / functions) Hit Total Coverage
Test: wrtstat-coverage.info Lines: 22 22 100.0 %
Date: 2019-09-13 Functions: 11 11 100.0 %

          Line data    Source code
       1             : #include <fas/testing.hpp>
       2             : #include <wrtstat/manager/aggregator_map.hpp>
       3             : #include <wrtstat/manager/aggregator_hashmap.hpp>
       4             : #include <numeric>
       5             : 
       6             : namespace {
       7             :   
       8             : 
       9           3 : UNIT(agmap1, "")
      10             : {
      11             :   using namespace fas::testing;
      12             :   using namespace wrtstat;
      13             : 
      14           1 :   agmap_options opt;
      15           1 :   opt.resolution = resolutions::nanoseconds;
      16           1 :   opt.soiled_start_ts = 1000000000;
      17           1 :   opt.reducer_levels = 1;
      18           1 :   opt.reducer_limit  = 10;
      19           1 :   opt.aggregation_step_ts = 500000000;
      20           1 :   opt.outgoing_reduced_size = 13;
      21             :   
      22           1 :   aggregator_hashmap agh(opt);
      23             :   
      24           2 :   reduced_data rd;
      25           1 :   bool run = true;
      26      117704 :   while(run)
      27             :   {
      28      117702 :     rd.ts=aggregator::now_t<std::chrono::nanoseconds>();
      29      117702 :     rd.count = 1;
      30      117703 :     agh.push("xxx", rd, [&run, &t]( aggregator_hashmap::aggregated_ptr ag)
      31             :     {
      32           1 :       t << message("aggregator") << " cout=" << ag->count;
      33           1 :       run = false;
      34           1 :     });
      35             :   }
      36           2 :   t << nothing;
      37           1 : }
      38             : 
      39             : }
      40             : 
      41           1 : BEGIN_SUITE(agmap, "")
      42             :   ADD_UNIT(agmap1)
      43           7 : END_SUITE(agmap)

Generated by: LCOV version 1.10