Line data Source code
1 : /*
2 : * If not stated otherwise in this file or this component's LICENSE file the
3 : * following copyright and licenses apply:
4 : *
5 : * Copyright 2026 Sky UK
6 : *
7 : * Licensed under the Apache License, Version 2.0 (the "License");
8 : * you may not use this file except in compliance with the License.
9 : * You may obtain a copy of the License at
10 : *
11 : * http://www.apache.org/licenses/LICENSE-2.0
12 : *
13 : * Unless required by applicable law or agreed to in writing, software
14 : * distributed under the License is distributed on an "AS IS" BASIS,
15 : * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 : * See the License for the specific language governing permissions and
17 : * limitations under the License.
18 : */
19 :
20 : #ifndef FIREBOLT_RIALTO_SERVER_I_METRICS_COLLECTOR_CLIENT_H_
21 : #define FIREBOLT_RIALTO_SERVER_I_METRICS_COLLECTOR_CLIENT_H_
22 :
23 : #include <cstdint>
24 :
25 : namespace firebolt::rialto::server
26 : {
27 : /**
28 : * @brief Reason for a metrics sample request, mirroring the proto enum.
29 : */
30 : enum class MetricsSampleReason
31 : {
32 : UNKNOWN,
33 : CONNECTED,
34 : PERIODIC,
35 : STATE_TRANSITION
36 : };
37 :
38 : /**
39 : * @brief Callback interface used by MetricsCollector (server/main) to send
40 : * sample requests back through the IPC layer to the client.
41 : */
42 : class IMetricsCollectorClient
43 : {
44 : public:
45 15 : IMetricsCollectorClient() = default;
46 15 : virtual ~IMetricsCollectorClient() = default;
47 :
48 : IMetricsCollectorClient(const IMetricsCollectorClient &) = delete;
49 : IMetricsCollectorClient(IMetricsCollectorClient &&) = delete;
50 : IMetricsCollectorClient &operator=(const IMetricsCollectorClient &) = delete;
51 : IMetricsCollectorClient &operator=(IMetricsCollectorClient &&) = delete;
52 :
53 : /**
54 : * @brief Request that the client send a metrics sample.
55 : *
56 : * @param clientId The client to request from.
57 : * @param sampleId Unique sample identifier for correlation.
58 : * @param reason Why the sample is being requested.
59 : */
60 : virtual void requestMetricsSample(int clientId, std::uint64_t sampleId, MetricsSampleReason reason) = 0;
61 : };
62 : } // namespace firebolt::rialto::server
63 :
64 : #endif // FIREBOLT_RIALTO_SERVER_I_METRICS_COLLECTOR_CLIENT_H_
|