• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

STEllAR-GROUP / hpx / #853

19 Dec 2022 01:01AM UTC coverage: 86.287% (+0.4%) from 85.912%
#853

push

StellarBot
Merge #6109

6109: Modernize serialization module r=hkaiser a=hkaiser

- flyby separate serialization of Boost types

working towards https://github.com/STEllAR-GROUP/hpx/issues/5497

Co-authored-by: Hartmut Kaiser <hartmut.kaiser@gmail.com>

53 of 53 new or added lines in 6 files covered. (100.0%)

173939 of 201582 relevant lines covered (86.29%)

1931657.12 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

65.85
/libs/full/performance_counters/src/server/raw_counter.cpp
1
//  Copyright (c) 2007-2021 Hartmut Kaiser
2
//
3
//  SPDX-License-Identifier: BSL-1.0
4
//  Distributed under the Boost Software License, Version 1.0. (See accompanying
5
//  file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
6

7
#include <hpx/config.hpp>
8
#include <hpx/async_distributed/continuation.hpp>
9
#include <hpx/functional/function.hpp>
10
#include <hpx/performance_counters/counters.hpp>
11
#include <hpx/performance_counters/server/raw_counter.hpp>
12
#include <hpx/runtime_components/derived_component_factory.hpp>
13
#include <hpx/runtime_local/runtime_local_fwd.hpp>
14
#include <hpx/timing/high_resolution_clock.hpp>
15

16
#include <cstdint>
17
#include <utility>
18

19
///////////////////////////////////////////////////////////////////////////////
20
typedef hpx::components::component<
21
    hpx::performance_counters::server::raw_counter>
22
    raw_counter_type;
23

24
HPX_REGISTER_DERIVED_COMPONENT_FACTORY(raw_counter_type, raw_counter,
19,713✔
25
    "base_performance_counter", hpx::components::factory_enabled)
26
HPX_DEFINE_GET_COMPONENT_TYPE(hpx::performance_counters::server::raw_counter)
1,198✔
27

28
///////////////////////////////////////////////////////////////////////////////
29
namespace hpx { namespace performance_counters { namespace server {
30

31
    raw_counter::raw_counter()
×
32
      : reset_(false)
×
33
    {
×
34
    }
×
35

36
    raw_counter::raw_counter(
58✔
37
        counter_info const& info, hpx::function<std::int64_t(bool)> f)
38
      : base_type_holder(info)
58✔
39
      , f_(HPX_MOVE(f))
58✔
40
      , reset_(false)
58✔
41
    {
174✔
42
        if (info.type_ != counter_type::raw &&
58✔
43
            info.type_ != counter_type::elapsed_time &&
24✔
44
            info.type_ != counter_type::aggregating &&
20✔
45
            info.type_ != counter_type::monotonically_increasing &&
20✔
46
            info.type_ != counter_type::average_count &&
×
47
            info.type_ != counter_type::average_timer)
×
48
        {
49
            HPX_THROW_EXCEPTION(hpx::error::bad_parameter,
×
50
                "raw_counter::raw_counter",
51
                "unexpected counter type specified for raw_counter");
52
        }
53
    }
58✔
54

55
    hpx::performance_counters::counter_value raw_counter::get_counter_value(
66✔
56
        bool reset)
57
    {
58
        hpx::performance_counters::counter_value value;
66✔
59
        value.value_ = f_(reset);    // gather the current value
66✔
60
        reset_ = false;
66✔
61
        value.scaling_ = 1;
66✔
62
        value.scale_inverse_ = false;
66✔
63
        value.status_ = counter_status::new_data;
66✔
64
        value.time_ = static_cast<std::int64_t>(hpx::get_system_uptime());
66✔
65
        value.count_ = ++invocation_count_;
66✔
66
        return value;
66✔
67
    }
68

69
    void raw_counter::reset_counter_value()
×
70
    {
71
        f_(true);
×
72
    }
×
73

74
    void raw_counter::finalize()
×
75
    {
76
        base_performance_counter::finalize();
×
77
        base_type::finalize();
×
78
    }
×
79

80
    naming::address raw_counter::get_current_address() const
58✔
81
    {
82
        return naming::address(
58✔
83
            naming::get_gid_from_locality_id(agas::get_locality_id()),
58✔
84
            components::get_component_type<raw_counter>(),
58✔
85
            const_cast<raw_counter*>(this));
58✔
86
    }
87
}}}    // namespace hpx::performance_counters::server
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc