blob: 708631ecb6b75e85d440ba86223f58b90145973d (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
|
// **********************************************************************
//
// Copyright (c) 2003-2006 ZeroC, Inc. All rights reserved.
//
// This copy of Ice is licensed to you under the terms described in the
// ICE_LICENSE file included in this distribution.
//
// **********************************************************************
#ifndef ICE_GRID_PLATFORM_INFO_H
#define ICE_GRID_PLATFORM_INFO_H
#include <IceGrid/Internal.h>
#ifdef _WIN32
# include <pdh.h> // Performance data helper API
# include <deque>
#endif
namespace IceGrid
{
class TraceLevels;
typedef IceUtil::Handle<TraceLevels> TraceLevelsPtr;
class PlatformInfo
{
public:
PlatformInfo(const Ice::CommunicatorPtr&, const TraceLevelsPtr&);
~PlatformInfo();
NodeInfo getNodeInfo() const;
LoadInfo getLoadInfo();
std::string getHostname() const;
std::string getDataDir() const;
private:
#if defined(_WIN32)
void initQuery();
#endif
const TraceLevelsPtr _traceLevels;
NodeInfo _info;
std::string _hostname;
#if defined(_WIN32)
HQUERY _query;
HCOUNTER _counter;
std::deque<int> _usages1;
std::deque<int> _usages5;
std::deque<int> _usages15;
int _last1Total;
int _last5Total;
int _last15Total;
#elif defined(_AIX)
int _kmem;
#endif
};
};
#endif
|