xrootd
Main Page
Namespaces
Classes
Files
File List
File Members
src
XrdFileCache
XrdFileCacheStats.hh
Go to the documentation of this file.
1
#ifndef __XRDFILECACHE_STATS_HH__
2
#define __XRDFILECACHE_STATS_HH__
3
4
//----------------------------------------------------------------------------------
5
// Copyright (c) 2014 by Board of Trustees of the Leland Stanford, Jr., University
6
// Author: Alja Mrak-Tadel, Matevz Tadel, Brian Bockelman
7
//----------------------------------------------------------------------------------
8
// XRootD is free software: you can redistribute it and/or modify
9
// it under the terms of the GNU Lesser General Public License as published by
10
// the Free Software Foundation, either version 3 of the License, or
11
// (at your option) any later version.
12
//
13
// XRootD 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
// GNU General Public License for more details.
17
//
18
// You should have received a copy of the GNU Lesser General Public License
19
// along with XRootD. If not, see <http://www.gnu.org/licenses/>.
20
//----------------------------------------------------------------------------------
21
22
#include "
XrdOuc/XrdOucCache.hh
"
23
#include "
XrdSys/XrdSysPthread.hh
"
24
25
namespace
XrdFileCache
26
{
27
//----------------------------------------------------------------------------
29
//----------------------------------------------------------------------------
30
class
Stats
:
public
XrdOucCacheStats
31
{
32
public
:
33
//----------------------------------------------------------------------
35
//----------------------------------------------------------------------
36
Stats
() {
37
m_BytesDisk
=
m_BytesRam
=
m_BytesMissed
= 0;
38
}
39
40
long
long
m_BytesDisk
;
41
long
long
m_BytesRam
;
42
long
long
m_BytesMissed
;
43
44
inline
void
AddStat
(
Stats
&Src)
45
{
46
XrdOucCacheStats::Add
(Src);
47
48
m_MutexXfc
.
Lock
();
49
m_BytesDisk
+= Src.
m_BytesDisk
;
50
m_BytesRam
+= Src.
m_BytesRam
;
51
m_BytesMissed
+= Src.
m_BytesMissed
;
52
53
m_MutexXfc
.
UnLock
();
54
}
55
56
private
:
57
XrdSysMutex
m_MutexXfc
;
58
};
59
}
60
61
#endif
Generated by
1.8.3.1