xrootd
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() {
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  {
47 
48  m_MutexXfc.Lock();
49  m_BytesDisk += Src.m_BytesDisk;
50  m_BytesRam += Src.m_BytesRam;
51  m_BytesMissed += Src.m_BytesMissed;
52 
54  }
55 
56  private:
58  };
59 }
60 
61 #endif
Statistics of disk cache utilisation.
Definition: XrdFileCacheStats.hh:30
Definition: XrdFileCache.hh:30
void Add(XrdOucCacheStats &Src)
Definition: XrdOucCache.hh:117
XrdSysMutex m_MutexXfc
Definition: XrdFileCacheStats.hh:57
Definition: XrdSysPthread.hh:140
long long m_BytesMissed
number of bytes served directly from XrdCl
Definition: XrdFileCacheStats.hh:42
void AddStat(Stats &Src)
Definition: XrdFileCacheStats.hh:44
long long m_BytesDisk
number of bytes served from disk cache
Definition: XrdFileCacheStats.hh:40
void Lock()
Definition: XrdSysPthread.hh:149
Stats()
Constructor.
Definition: XrdFileCacheStats.hh:36
Definition: XrdOucCache.hh:93
void UnLock()
Definition: XrdSysPthread.hh:151
long long m_BytesRam
number of bytes served from RAM cache
Definition: XrdFileCacheStats.hh:41