xrootd
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
XrdCmsPerfMon.hh
Go to the documentation of this file.
1 #ifndef __CMS_PERFMON__
2 #define __CMS_PERFMON__
3 /******************************************************************************/
4 /* */
5 /* X r d C m s P e r f M o n . h h */
6 /* */
7 /* (c) 2019 by the Board of Trustees of the Leland Stanford, Jr., University */
8 /* All Rights Reserved */
9 /* Produced by Andrew Hanushevsky for Stanford University under contract */
10 /* DE-AC02-76-SFO0515 with the Department of Energy */
11 /* */
12 /* This file is part of the XRootD software suite. */
13 /* */
14 /* XRootD is free software: you can redistribute it and/or modify it under */
15 /* the terms of the GNU Lesser General Public License as published by the */
16 /* Free Software Foundation, either version 3 of the License, or (at your */
17 /* option) any later version. */
18 /* */
19 /* XRootD is distributed in the hope that it will be useful, but WITHOUT */
20 /* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or */
21 /* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public */
22 /* License for more details. */
23 /* */
24 /* You should have received a copy of the GNU Lesser General Public License */
25 /* along with XRootD in a file called COPYING.LESSER (LGPL license) and file */
26 /* COPYING (GPL license). If not, see <http://www.gnu.org/licenses/>. */
27 /* */
28 /* The copyright holder's institutional names and contributor's names may not */
29 /* be used to endorse or promote products derived from this software without */
30 /* specific prior written permission of the institution or contributor. */
31 /******************************************************************************/
32 
33 class XrdOucEnv;
34 class XrdSysLogger;
35 
36 /******************************************************************************/
37 /* c l a s s X r d C m s P e r f M o n */
38 /******************************************************************************/
39 
40 /* The XrdCmsPerfMon is used to report performance metrics. It is obtained
41  from the shared library loaded at run time and identified by the cms.perf
42  directive. The library should contain an implementation of this class.
43 */
44 
46 {
47 public:
48 
49 //------------------------------------------------------------------------------
63 //------------------------------------------------------------------------------
64 
65 virtual bool Configure(const char *cfn,
66  char *Parms,
67  XrdSysLogger &Logger,
68  XrdCmsPerfMon &cmsMon,
69  XrdOucEnv *EnvInfo,
70  bool isCMS)
71  {(void)cfn; (void)Parms; (void)Logger; (void)cmsMon;
72  (void)EnvInfo; (void)isCMS;
73  return false;
74  }
75 
76 //------------------------------------------------------------------------------
78 //------------------------------------------------------------------------------
79 
80 struct PerfInfo
81  {unsigned char cpu_load;
82  unsigned char mem_load;
83  unsigned char net_load;
84  unsigned char pag_load;
85  unsigned char xeq_load;
86  unsigned char xxx_load;
87  unsigned char yyy_load;
88  unsigned char zzz_load;
89 
91  xxx_load = yyy_load = zzz_load = 0;
92  }
93 
94  PerfInfo() {Clear();}
95  ~PerfInfo() {}
96  };
97 
98 //------------------------------------------------------------------------------
104 //------------------------------------------------------------------------------
105 
106 virtual void GetInfo(PerfInfo &info) {(void)info;}
107 
108 //------------------------------------------------------------------------------
118 //------------------------------------------------------------------------------
119 
120 virtual void PutInfo(PerfInfo &info, bool alert=false)
121  {(void)info; (void)alert;}
122 
123 //------------------------------------------------------------------------------
125 //------------------------------------------------------------------------------
126 
128 
129 virtual ~XrdCmsPerfMon() {}
130 };
131 
132 /******************************************************************************/
133 /* L i b r a r y X r d C m s P e r f M o n D e f i n i i o n */
134 /******************************************************************************/
135 
136 //------------------------------------------------------------------------------
143 //------------------------------------------------------------------------------
144 
145 //------------------------------------------------------------------------------
150 //------------------------------------------------------------------------------
151 
156 #endif
virtual bool Configure(const char *cfn, char *Parms, XrdSysLogger &Logger, XrdCmsPerfMon &cmsMon, XrdOucEnv *EnvInfo, bool isCMS)
Definition: XrdCmsPerfMon.hh:65
XrdCmsPerfMon()
Constructor &amp; Destructor.
Definition: XrdCmsPerfMon.hh:127
PerfInfo()
Definition: XrdCmsPerfMon.hh:94
unsigned char cpu_load
CPU 0 to 100 utilization.
Definition: XrdCmsPerfMon.hh:81
unsigned char pag_load
Paging 0 to 100 utilization.
Definition: XrdCmsPerfMon.hh:84
unsigned char xxx_load
Reserved.
Definition: XrdCmsPerfMon.hh:86
virtual ~XrdCmsPerfMon()
Definition: XrdCmsPerfMon.hh:129
virtual void PutInfo(PerfInfo &info, bool alert=false)
Definition: XrdCmsPerfMon.hh:120
unsigned char zzz_load
Reserved.
Definition: XrdCmsPerfMon.hh:88
unsigned char net_load
Network 0 to 100 utilization.
Definition: XrdCmsPerfMon.hh:83
Definition: XrdOucEnv.hh:41
j template void())
Definition: XrdOucJson.hh:4121
unsigned char mem_load
Memory 0 to 100 utilization.
Definition: XrdCmsPerfMon.hh:82
Definition: XrdSysLogger.hh:52
virtual void GetInfo(PerfInfo &info)
Definition: XrdCmsPerfMon.hh:106
void Clear()
Definition: XrdCmsPerfMon.hh:90
Structure used for reporting performance metrics.
Definition: XrdCmsPerfMon.hh:80
unsigned char yyy_load
Reserved.
Definition: XrdCmsPerfMon.hh:87
~PerfInfo()
Definition: XrdCmsPerfMon.hh:95
Definition: XrdCmsPerfMon.hh:45
unsigned char xeq_load
Other 0 to 100 utilization (arbitrary)
Definition: XrdCmsPerfMon.hh:85