xrootd
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
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
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 AddStats(Stats &Src)
45  {
46  m_MutexXfc.Lock();
47 
48  m_BytesDisk += Src.m_BytesDisk;
49  m_BytesRam += Src.m_BytesRam;
51 
53  }
54 
56  {
57  Stats ret;
58  m_MutexXfc.Lock();
59  ret = *this;
61  return ret;
62  }
63 
64 private:
66 };
67 }
68 
69 #endif
70 
Statistics of disk cache utilisation.
Definition: XrdFileCacheStats.hh:30
void AddStats(Stats &Src)
Definition: XrdFileCacheStats.hh:44
XrdSysMutex m_MutexXfc
Definition: XrdFileCacheStats.hh:65
Definition: XrdSysPthread.hh:165
long long m_BytesMissed
number of bytes served directly from XrdCl
Definition: XrdFileCacheStats.hh:42
Stats Clone()
Definition: XrdFileCacheStats.hh:55
long long m_BytesDisk
number of bytes served from disk cache
Definition: XrdFileCacheStats.hh:40
void Lock()
Definition: XrdSysPthread.hh:220
Stats()
Constructor.
Definition: XrdFileCacheStats.hh:36
void UnLock()
Definition: XrdSysPthread.hh:222
long long m_BytesRam
number of bytes served from RAM cache
Definition: XrdFileCacheStats.hh:41