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

STEllAR-GROUP / hpx / #882

31 Aug 2023 07:44PM UTC coverage: 41.798% (-44.7%) from 86.546%
#882

push

19442 of 46514 relevant lines covered (41.8%)

126375.38 hits per line

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

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

8
#include <hpx/config.hpp>
9
#include <hpx/agas/addressing_service.hpp>
10
#include <hpx/modules/functional.hpp>
11
#include <hpx/performance_counters/agas_counter_types.hpp>
12
#include <hpx/performance_counters/component_namespace_counters.hpp>
13
#include <hpx/performance_counters/counter_creators.hpp>
14
#include <hpx/performance_counters/locality_namespace_counters.hpp>
15
#include <hpx/performance_counters/manage_counter_type.hpp>
16
#include <hpx/performance_counters/primary_namespace_counters.hpp>
17
#include <hpx/performance_counters/symbol_namespace_counters.hpp>
18

19
#include <cstdint>
20

21
namespace hpx { namespace performance_counters {
22

23
    /// Install performance counter types exposing properties from the local cache.
24
    void register_agas_counter_types(agas::addressing_service& client)
25
    {
26
        // install
32✔
27
        hpx::function<std::int64_t(bool)> cache_entries(hpx::bind_front(
28
            &agas::addressing_service::get_cache_entries, &client));
29
        hpx::function<std::int64_t(bool)> cache_hits(hpx::bind_front(
30
            &agas::addressing_service::get_cache_hits, &client));
31
        hpx::function<std::int64_t(bool)> cache_misses(hpx::bind_front(
32
            &agas::addressing_service::get_cache_misses, &client));
33
        hpx::function<std::int64_t(bool)> cache_evictions(hpx::bind_front(
34
            &agas::addressing_service::get_cache_evictions, &client));
35
        hpx::function<std::int64_t(bool)> cache_insertions(hpx::bind_front(
36
            &agas::addressing_service::get_cache_insertions, &client));
37

38
        hpx::function<std::int64_t(bool)> cache_get_entry_count(hpx::bind_front(
39
            &agas::addressing_service::get_cache_get_entry_count, &client));
40
        hpx::function<std::int64_t(bool)> cache_insertion_count(hpx::bind_front(
41
            &agas::addressing_service::get_cache_insertion_entry_count,
42
            &client));
43
        hpx::function<std::int64_t(bool)> cache_update_entry_count(
44
            hpx::bind_front(
45
                &agas::addressing_service::get_cache_update_entry_count,
46
                &client));
47
        hpx::function<std::int64_t(bool)> cache_erase_entry_count(
48
            hpx::bind_front(
49
                &agas::addressing_service::get_cache_erase_entry_count,
50
                &client));
51

52
        hpx::function<std::int64_t(bool)> cache_get_entry_time(hpx::bind_front(
53
            &agas::addressing_service::get_cache_get_entry_time, &client));
54
        hpx::function<std::int64_t(bool)> cache_insertion_time(hpx::bind_front(
55
            &agas::addressing_service::get_cache_insertion_entry_time,
56
            &client));
57
        hpx::function<std::int64_t(bool)> cache_update_entry_time(
58
            hpx::bind_front(
59
                &agas::addressing_service::get_cache_update_entry_time,
60
                &client));
61
        hpx::function<std::int64_t(bool)> cache_erase_entry_time(
62
            hpx::bind_front(
63
                &agas::addressing_service::get_cache_erase_entry_time,
64
                &client));
65

66
        using placeholders::_1;
67
        using placeholders::_2;
68
        performance_counters::generic_counter_type_data const counter_types[] =
69
            {
70
                {"/agas/count/cache/entries",
71
                    performance_counters::counter_type::raw,
72
                    "returns the number of cache entries in the AGAS cache",
73
                    HPX_PERFORMANCE_COUNTER_V1,
74
                    hpx::bind(
75
                        &performance_counters::locality_raw_counter_creator, _1,
76
                        cache_entries, _2),
32✔
77
                    &performance_counters::locality_counter_discoverer, ""},
78
                {"/agas/count/cache/hits",
79
                    performance_counters::counter_type::
32✔
80
                        monotonically_increasing,
81
                    "returns the number of cache hits while accessing the AGAS "
82
                    "cache",
83
                    HPX_PERFORMANCE_COUNTER_V1,
84
                    hpx::bind(
85
                        &performance_counters::locality_raw_counter_creator, _1,
86
                        cache_hits, _2),
32✔
87
                    &performance_counters::locality_counter_discoverer, ""},
88
                {"/agas/count/cache/misses",
89
                    performance_counters::counter_type::
32✔
90
                        monotonically_increasing,
91
                    "returns the number of cache misses while accessing the "
92
                    "AGAS cache",
93
                    HPX_PERFORMANCE_COUNTER_V1,
94
                    hpx::bind(
95
                        &performance_counters::locality_raw_counter_creator, _1,
96
                        cache_misses, _2),
32✔
97
                    &performance_counters::locality_counter_discoverer, ""},
98
                {"/agas/count/cache/evictions",
99
                    performance_counters::counter_type::
32✔
100
                        monotonically_increasing,
101
                    "returns the number of cache evictions from the AGAS cache",
102
                    HPX_PERFORMANCE_COUNTER_V1,
103
                    hpx::bind(
104
                        &performance_counters::locality_raw_counter_creator, _1,
105
                        cache_evictions, _2),
32✔
106
                    &performance_counters::locality_counter_discoverer, ""},
107
                {"/agas/count/cache/insertions",
108
                    performance_counters::counter_type::
32✔
109
                        monotonically_increasing,
110
                    "returns the number of cache insertions into the AGAS "
111
                    "cache",
112
                    HPX_PERFORMANCE_COUNTER_V1,
113
                    hpx::bind(
114
                        &performance_counters::locality_raw_counter_creator, _1,
115
                        cache_insertions, _2),
32✔
116
                    &performance_counters::locality_counter_discoverer, ""},
117
                {"/agas/count/cache/get_entry",
118
                    performance_counters::counter_type::
32✔
119
                        monotonically_increasing,
120
                    "returns the number of invocations of get_entry function "
121
                    "of the AGAS cache",
122
                    HPX_PERFORMANCE_COUNTER_V1,
123
                    hpx::bind(
124
                        &performance_counters::locality_raw_counter_creator, _1,
125
                        cache_get_entry_count, _2),
32✔
126
                    &performance_counters::locality_counter_discoverer, ""},
127
                {"/agas/count/cache/insert_entry",
128
                    performance_counters::counter_type::
32✔
129
                        monotonically_increasing,
130
                    "returns the number of invocations of insert function of "
131
                    "the AGAS cache",
132
                    HPX_PERFORMANCE_COUNTER_V1,
133
                    hpx::bind(
134
                        &performance_counters::locality_raw_counter_creator, _1,
135
                        cache_insertion_count, _2),
32✔
136
                    &performance_counters::locality_counter_discoverer, ""},
137
                {"/agas/count/cache/update_entry",
138
                    performance_counters::counter_type::
32✔
139
                        monotonically_increasing,
140
                    "returns the number of invocations of update_entry "
141
                    "function of the AGAS cache",
142
                    HPX_PERFORMANCE_COUNTER_V1,
143
                    hpx::bind(
144
                        &performance_counters::locality_raw_counter_creator, _1,
145
                        cache_update_entry_count, _2),
32✔
146
                    &performance_counters::locality_counter_discoverer, ""},
147
                {"/agas/count/cache/erase_entry",
148
                    performance_counters::counter_type::
32✔
149
                        monotonically_increasing,
150
                    "returns the number of invocations of erase_entry function "
151
                    "of the AGAS cache",
152
                    HPX_PERFORMANCE_COUNTER_V1,
153
                    hpx::bind(
154
                        &performance_counters::locality_raw_counter_creator, _1,
155
                        cache_erase_entry_count, _2),
32✔
156
                    &performance_counters::locality_counter_discoverer, ""},
157
                {"/agas/time/cache/get_entry",
158
                    performance_counters::counter_type::
32✔
159
                        monotonically_increasing,
160
                    "returns the overall time spent executing of the get_entry "
161
                    "API function of the AGAS cache",
162
                    HPX_PERFORMANCE_COUNTER_V1,
163
                    hpx::bind(
164
                        &performance_counters::locality_raw_counter_creator, _1,
165
                        cache_get_entry_time, _2),
32✔
166
                    &performance_counters::locality_counter_discoverer, "ns"},
167
                {"/agas/time/cache/insert_entry",
168
                    performance_counters::counter_type::
32✔
169
                        monotonically_increasing,
170
                    "returns the overall time spent executing of the "
171
                    "insert_entry API function of the AGAS cache",
172
                    HPX_PERFORMANCE_COUNTER_V1,
173
                    hpx::bind(
174
                        &performance_counters::locality_raw_counter_creator, _1,
175
                        cache_insertion_time, _2),
32✔
176
                    &performance_counters::locality_counter_discoverer, ""},
177
                {"/agas/time/cache/update_entry",
178
                    performance_counters::counter_type::
32✔
179
                        monotonically_increasing,
180
                    "returns the overall time spent executing of the "
181
                    "update_entry API function of the AGAS cache",
182
                    HPX_PERFORMANCE_COUNTER_V1,
183
                    hpx::bind(
184
                        &performance_counters::locality_raw_counter_creator, _1,
185
                        cache_update_entry_time, _2),
32✔
186
                    &performance_counters::locality_counter_discoverer, "ns"},
187
                {"/agas/time/cache/erase_entry",
188
                    performance_counters::counter_type::
32✔
189
                        monotonically_increasing,
190
                    "returns the overall time spent executing of the "
191
                    "erase_entry API function of the AGAS cache",
192
                    HPX_PERFORMANCE_COUNTER_V1,
193
                    hpx::bind(
194
                        &performance_counters::locality_raw_counter_creator, _1,
195
                        cache_erase_entry_time, _2),
×
196
                    &performance_counters::locality_counter_discoverer, ""},
197
            };
198

32✔
199
        performance_counters::install_counter_types(
416✔
200
            counter_types, sizeof(counter_types) / sizeof(counter_types[0]));
201

32✔
202
        // install counters for services
203
        agas::primary_namespace_register_counter_types();
204
        if (client.is_bootstrap())
205
        {
32✔
206
            agas::component_namespace_register_counter_types();
32✔
207
            agas::locality_namespace_register_counter_types();
208
        }
29✔
209
        agas::symbol_namespace_register_counter_types();
29✔
210
    }
211
}}    // namespace hpx::performance_counters
32✔
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