• 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

0.0
/libs/full/performance_counters/src/agas_namespace_action_code.cpp
1
//  Copyright (c) 2012-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/modules/errors.hpp>
8
#include <hpx/performance_counters/agas_namespace_action_code.hpp>
9
#include <hpx/performance_counters/counters.hpp>
10

11
#include <cstddef>
12
#include <string>
13

14
namespace hpx { namespace agas { namespace detail {
15

16
    // get action code from counter type
17
    namespace_action_code retrieve_action_code(
×
18
        std::string const& name, error_code& ec)
19
    {
20
        performance_counters::counter_path_elements p;
×
21
        performance_counters::get_counter_path_elements(name, p, ec);
×
22
        if (ec)
×
23
            return invalid_request;
×
24

25
        if (p.objectname_ != "agas")
×
26
        {
27
            HPX_THROWS_IF(ec, hpx::error::bad_parameter, "retrieve_action_code",
×
28
                "unknown performance counter (unrelated to AGAS)");
29
            return invalid_request;
×
30
        }
31

32
        // component_ns
33
        for (std::size_t i = 0; i != num_component_namespace_services; ++i)
×
34
        {
35
            if (p.countername_ == component_namespace_services[i].name_)
×
36
                return component_namespace_services[i].code_;
×
37
        }
×
38

39
        // locality_ns
40
        for (std::size_t i = 0; i != num_locality_namespace_services; ++i)
×
41
        {
42
            if (p.countername_ == locality_namespace_services[i].name_)
×
43
                return locality_namespace_services[i].code_;
×
44
        }
×
45

46
        // primary_ns
47
        for (std::size_t i = 0; i != num_primary_namespace_services; ++i)
×
48
        {
49
            if (p.countername_ == primary_namespace_services[i].name_)
×
50
                return primary_namespace_services[i].code_;
×
51
        }
×
52

53
        // symbol_ns
54
        for (std::size_t i = 0; i != num_symbol_namespace_services; ++i)
×
55
        {
56
            if (p.countername_ == symbol_namespace_services[i].name_)
×
57
                return symbol_namespace_services[i].code_;
×
58
        }
×
59

60
        HPX_THROWS_IF(ec, hpx::error::bad_parameter, "retrieve_action_code",
×
61
            "unknown performance counter (unrelated to AGAS)");
62
        return invalid_request;
×
63
    }
×
64

65
    // get service action code from counter type
66
    namespace_action_code retrieve_action_service_code(
×
67
        std::string const& name, error_code& ec)
68
    {
69
        performance_counters::counter_path_elements p;
×
70
        performance_counters::get_counter_path_elements(name, p, ec);
×
71
        if (ec)
×
72
            return invalid_request;
×
73

74
        if (p.objectname_ != "agas")
×
75
        {
76
            HPX_THROWS_IF(ec, hpx::error::bad_parameter,
×
77
                "retrieve_action_service_code",
78
                "unknown performance counter (unrelated to AGAS)");
79
            return invalid_request;
×
80
        }
81

82
        // component_ns
83
        for (std::size_t i = 0; i != num_component_namespace_services; ++i)
×
84
        {
85
            if (p.countername_ == component_namespace_services[i].name_)
×
86
                return component_namespace_services[i].service_code_;
×
87
        }
×
88

89
        // locality_ns
90
        for (std::size_t i = 0; i != num_locality_namespace_services; ++i)
×
91
        {
92
            if (p.countername_ == locality_namespace_services[i].name_)
×
93
                return locality_namespace_services[i].service_code_;
×
94
        }
×
95

96
        // primary_ns
97
        for (std::size_t i = 0; i != num_primary_namespace_services; ++i)
×
98
        {
99
            if (p.countername_ == primary_namespace_services[i].name_)
×
100
                return primary_namespace_services[i].service_code_;
×
101
        }
×
102

103
        // symbol_ns
104
        for (std::size_t i = 0; i != num_symbol_namespace_services; ++i)
×
105
        {
106
            if (p.countername_ == symbol_namespace_services[i].name_)
×
107
                return symbol_namespace_services[i].service_code_;
×
108
        }
×
109

110
        HPX_THROWS_IF(ec, hpx::error::bad_parameter,
×
111
            "retrieve_action_service_code",
112
            "unknown performance counter (unrelated to AGAS)");
113
        return invalid_request;
×
114
    }
×
115
}}}    // namespace hpx::agas::detail
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