hce-node application
1.4.3
HCE Hierarchical Cluster Engine node application
Main Page
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
DRCEResourceUsage.hpp
Go to the documentation of this file.
1
14
#ifndef DRCE_RESOURCE_USAGE_HPP
15
#define DRCE_RESOURCE_USAGE_HPP
16
17
#include <utility>
18
#include <stddef.h>
19
20
#include "
JsonSerializable.hpp
"
21
22
namespace
HCE
23
{
24
namespace
drce
25
{
26
//-----------------------------------------------------------------------------
27
struct
ResourceUsage
28
{
29
ResourceUsage
(
void
);
30
ResourceUsage
(
const
ResourceUsage
& rhs);
31
ResourceUsage
(
ResourceUsage
&& rhs);
32
33
ResourceUsage
&
operator=
(
const
ResourceUsage
& rhs);
34
ResourceUsage
&
operator=
(
ResourceUsage
&& rhs);
35
36
void
clear
(
void
);
37
38
double
cpu
;
39
double
iowait
;
40
41
size_t
vramUsed
;
42
double
vramUsedPercent
;
43
size_t
rramUsed
;
44
double
rramUsedPercent
;
45
size_t
diskUsed
;
46
double
diskUsedPercent
;
47
48
unsigned
int
processes
;
49
double
processesPercent
;
50
unsigned
int
threads
;
51
double
threadsPercent
;
52
53
double
loadAverage
;
54
};
55
//-----------------------------------------------------------------------------
56
//-----------------------------------------------------------------------------
57
class
ResourceUsageConverter
58
{
59
static
const
char
DELIMITER =
','
;
60
public
:
61
ResourceUsageConverter
(
void
);
62
explicit
ResourceUsageConverter
(
const
ResourceUsage
& rhs);
63
explicit
ResourceUsageConverter
(
const
std::string& rhs);
64
65
ResourceUsage
toObject
(
void
)
const
{
return
resourceUsage;}
66
std::string
toString
(
const
char
delimiter
=DELIMITER);
67
68
void
fromObject
(
const
ResourceUsage
& rhs);
69
void
fromString
(
const
std::string& rhs,
const
char
delimiter
=DELIMITER);
70
private
:
71
ResourceUsage
resourceUsage;
72
};
73
//-----------------------------------------------------------------------------
74
//-----------------------------------------------------------------------------
75
class
ResourceUsageSerializator
:
public
IJsonSerializable
76
{
77
public
:
78
explicit
ResourceUsageSerializator
(
ResourceUsage
& resourceUsage_);
79
ResourceUsageSerializator
(
ResourceUsage
& resourceUsage_,
const
std::string& json);
80
81
bool
serialize
(std::string& json);
82
bool
unserialize
(
const
std::string& json);
83
84
void
clear
(
void
);
85
private
:
86
ResourceUsage
& resourceUsage;
87
typedef
IJsonSerializable
inherited
;
88
};
89
//-----------------------------------------------------------------------------
90
//-----------------------------------------------------------------------------
91
}
// end namespace drce
92
}
// end namespace HCE
93
94
#endif // DRCE_RESOURCE_USAGE_HPP
sources
utils
DRCE
src
DRCEResourceUsage.hpp
Generated on Tue Jun 30 2015 19:42:11 for hce-node application by
1.8.1.2