Antares Simulator
Power System Simulator
statistics.h
1 /*
2  * Copyright 2007-2025, RTE (https://www.rte-france.com)
3  * See AUTHORS.txt
4  * SPDX-License-Identifier: MPL-2.0
5  * This file is part of Antares-Simulator,
6  * Adequacy and Performance assessment for interconnected energy networks.
7  *
8  * Antares_Simulator is free software: you can redistribute it and/or modify
9  * it under the terms of the Mozilla Public Licence 2.0 as published by
10  * the Mozilla Foundation, either version 2 of the License, or
11  * (at your option) any later version.
12  *
13  * Antares_Simulator is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * Mozilla Public Licence 2.0 for more details.
17  *
18  * You should have received a copy of the Mozilla Public Licence 2.0
19  * along with Antares_Simulator. If not, see <https://opensource.org/license/mpl-2-0/>.
20  */
21 #ifndef __ANTARES_LIBS_IO_STATISTICS_H__
22 #define __ANTARES_LIBS_IO_STATISTICS_H__
23 
24 #include <yuni/yuni.h>
25 
26 namespace Antares::Statistics
27 {
31 uint64_t ReadFromDisk();
32 
36 uint64_t WrittenToDisk();
37 
41 uint64_t ReadFromDiskSinceStartup();
42 
46 uint64_t WrittenToDiskSinceStartup();
47 
51 uint64_t ReadFromNetwork();
52 
56 uint64_t WrittenToNetwork();
57 
61 uint64_t ReadFromNetworkSinceStartup();
62 
66 uint64_t WrittenToNetworkSinceStartup();
67 
71 void HasReadFromDisk(uint64_t size);
72 
76 void HasWrittenToDisk(uint64_t size);
77 
81 void HasReadFromNetwork(uint64_t size);
82 
86 void HasWrittenToNetwork(uint64_t size);
87 
91 void Reset();
92 
96 void DumpToLogs();
97 
98 class Updater final
99 {
100 public:
101  Updater()
102  {
103  Reset();
104  }
105 
106  ~Updater()
107  {
108  DumpToLogs();
109  }
110 };
111 
112 class LogsDumper final
113 {
114 public:
115  LogsDumper()
116  {
117  }
118 
119  ~LogsDumper()
120  {
121  DumpToLogs();
122  }
123 };
124 
125 } // namespace Antares::Statistics
126 
127 #endif // __ANTARES_LIBS_IO_STATISTICS_H__
Definition: statistics.h:113
Definition: statistics.h:99