Arcane  4.1.12.0
Developer documentation
Loading...
Searching...
No Matches
IPerformanceCounterService.h
1// -*- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature -*-
2//-----------------------------------------------------------------------------
3// Copyright 2000-2026 CEA (www.cea.fr) IFPEN (www.ifpenergiesnouvelles.com)
4// See the top-level COPYRIGHT file for details.
5// SPDX-License-Identifier: Apache-2.0
6//-----------------------------------------------------------------------------
7/*---------------------------------------------------------------------------*/
8/* IPerformanceCounterService.h (C) 2000-2022 */
9/* */
10/* Interface of a service for accessing performance counters. */
11/*---------------------------------------------------------------------------*/
12#ifndef ARCANE_UTILS_IPERFORMANCECOUNTERSERVICE_H
13#define ARCANE_UTILS_IPERFORMANCECOUNTERSERVICE_H
14/*---------------------------------------------------------------------------*/
15/*---------------------------------------------------------------------------*/
16
18
19/*---------------------------------------------------------------------------*/
20/*---------------------------------------------------------------------------*/
21
22namespace Arcane
23{
24
25/*---------------------------------------------------------------------------*/
26/*---------------------------------------------------------------------------*/
27
31class ARCANE_UTILS_EXPORT IPerformanceCounterService
32{
33 public:
34
36 static const int MIN_COUNTER_SIZE = 8;
37
38 public:
39
40 virtual ~IPerformanceCounterService() = default;
41
42 public:
43
45 virtual void initialize() = 0;
46
52 virtual void start() = 0;
53
59 virtual void stop() = 0;
60
62 virtual bool isStarted() const = 0;
63
89 virtual Int32 getCounters(Int64ArrayView counters, bool do_substract) = 0;
90
96 virtual Int64 getCycles() = 0;
97};
98
99/*---------------------------------------------------------------------------*/
100/*---------------------------------------------------------------------------*/
101
102} // End namespace Arcane
103
104/*---------------------------------------------------------------------------*/
105/*---------------------------------------------------------------------------*/
106
107#endif
Declarations of types used in Arcane.
Interface of a service for accessing performance counters.
virtual bool isStarted() const =0
Indicates if the service has started (start() has been called).
static const int MIN_COUNTER_SIZE
Minimum size of the view for getCounters().
virtual Int32 getCounters(Int64ArrayView counters, bool do_substract)=0
Retrieves the current values of the counters.
virtual void stop()=0
Stops tracking performance counters.
virtual void start()=0
Starts tracking performance counters.
virtual void initialize()=0
Initializes the service.
virtual Int64 getCycles()=0
Value of the counter for the number of CPU cycles.
-- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature --
ArrayView< Int64 > Int64ArrayView
C equivalent of a 1D array of 64-bit integers.
Definition UtilsTypes.h:451
std::int64_t Int64
Signed integer type of 64 bits.
std::int32_t Int32
Signed integer type of 32 bits.