Loading...
Searching...
No Matches
XrdThrottle::Configuration Class Reference

`#include <XrdThrottleConfig.hh>`

Collaboration diagram for XrdThrottle::Configuration:

## Public Member Functions

| Configuration (XrdSysError &log, XrdOucEnv *env)
int | Configure (const std::string &config_file)
const std::string & | GetFileSystemLibrary () const
long long | GetLoadshedFreq () const
const std::string & | GetLoadshedHost () const
long long | GetLoadshedPort () const
long long | GetMaxConn () const
long long | GetMaxOpen () const
long long | GetMaxWait () const
long long | GetThrottleConcurrency () const
long long | GetThrottleDataRate () const
long long | GetThrottleIOPSRate () const
long long | GetThrottleRecomputeIntervalMS () const
int | GetTraceLevels () const

## Detailed Description

Definition at line 37 of file XrdThrottleConfig.hh.

## Constructor & Destructor Documentation

## Configuration()

XrdThrottle::Configuration::Configuration | ( | XrdSysError & | log,
|  | XrdOucEnv * | env )

inline

Definition at line 39 of file XrdThrottleConfig.hh.

: m_env(env), m_log(log)
{}

## Member Function Documentation

## Configure()

int Configuration::Configure | ( | const std::string & | config_file | ) |

Definition at line 41 of file XrdThrottleConfig.cc.

{
XrdOucEnv myEnv;
XrdOucStream Config(&m_log, getenv("XRDINSTANCE"), &myEnv, "(Throttle Config)> ");
int cfgFD;
if (config_file.empty()) {
m_log.Say("No filename specified.");
return 1;
}
if ((cfgFD = open(config_file.c_str(), O_RDONLY)) < 0) {
m_log.Emsg("Config", errno, "Unable to open configuration file", config_file.c_str());
return 1;
}
Config.Attach(cfgFD);
static const char *cvec[] = { "*** throttle (ofs) plugin config:", 0 };
Config.Capture(cvec);
char *var, *val;
int NoGo = 0;
while( (var = Config.GetMyFirstWord()) )
{
if (!strcmp("throttle.fslib", var)) {
val = Config.GetWord();
if (!val || !val[0]) {m_log.Emsg("Config", "fslib not specified."); continue;}
m_fslib = val;
}
TS_Xeq("throttle.max_open_files", xmaxopen);
TS_Xeq("throttle.max_active_connections", xmaxconn);
TS_Xeq("throttle.throttle", xthrottle);
TS_Xeq("throttle.loadshed", xloadshed);
TS_Xeq("throttle.max_wait_time", xmaxwait);
TS_Xeq("throttle.trace", xtrace);
if (NoGo)
{
m_log.Emsg("Config", "Throttle configuration failed.");
return 1;
}
}
return 0;
}
TS_Xeq
#define TS_Xeq(x, m)
Definition XrdConfig.cc:160
open
#define open
Definition XrdPosix.hh:76
XrdCms::Config
XrdCmsConfig Config
Definition XrdCmsConfig.cc:108

References open, and TS_Xeq.

## GetFileSystemLibrary()

const std::string & XrdThrottle::Configuration::GetFileSystemLibrary | ( |  | ) | const

inline

Definition at line 50 of file XrdThrottleConfig.hh.

{ return m_fslib; }

## GetLoadshedFreq()

long long XrdThrottle::Configuration::GetLoadshedFreq | ( |  | ) | const

inline

Definition at line 64 of file XrdThrottleConfig.hh.

{ return m_loadshed_freq; }

Referenced by XrdThrottleManager::FromConfig().

Here is the caller graph for this function:

## GetLoadshedHost()

const std::string & XrdThrottle::Configuration::GetLoadshedHost | ( |  | ) | const

inline

Definition at line 54 of file XrdThrottleConfig.hh.

{ return m_loadshed_hostname; }

Referenced by XrdThrottleManager::FromConfig().

Here is the caller graph for this function:

## GetLoadshedPort()

long long XrdThrottle::Configuration::GetLoadshedPort | ( |  | ) | const

inline

Definition at line 59 of file XrdThrottleConfig.hh.

{ return m_loadshed_port; }

Referenced by XrdThrottleManager::FromConfig().

Here is the caller graph for this function:

## GetMaxConn()

long long XrdThrottle::Configuration::GetMaxConn | ( |  | ) | const

inline

Definition at line 72 of file XrdThrottleConfig.hh.

{ return m_max_conn; }

Referenced by XrdThrottleManager::FromConfig().

Here is the caller graph for this function:

## GetMaxOpen()

long long XrdThrottle::Configuration::GetMaxOpen | ( |  | ) | const

inline

Definition at line 68 of file XrdThrottleConfig.hh.

{ return m_max_open; }

Referenced by XrdThrottleManager::FromConfig().

Here is the caller graph for this function:

## GetMaxWait()

long long XrdThrottle::Configuration::GetMaxWait | ( |  | ) | const

inline

Definition at line 77 of file XrdThrottleConfig.hh.

{ return m_max_wait; }

Referenced by XrdThrottleManager::FromConfig().

Here is the caller graph for this function:

## GetThrottleConcurrency()

long long XrdThrottle::Configuration::GetThrottleConcurrency | ( |  | ) | const

inline

Definition at line 81 of file XrdThrottleConfig.hh.

{ return m_throttle_concurrency_limit; }

Referenced by XrdThrottleManager::FromConfig().

Here is the caller graph for this function:

## GetThrottleDataRate()

long long XrdThrottle::Configuration::GetThrottleDataRate | ( |  | ) | const

inline

Definition at line 85 of file XrdThrottleConfig.hh.

{ return m_throttle_data_rate; }

Referenced by XrdThrottleManager::FromConfig().

Here is the caller graph for this function:

## GetThrottleIOPSRate()

long long XrdThrottle::Configuration::GetThrottleIOPSRate | ( |  | ) | const

inline

Definition at line 89 of file XrdThrottleConfig.hh.

{ return m_throttle_iops_rate; }

Referenced by XrdThrottleManager::FromConfig().

Here is the caller graph for this function:

## GetThrottleRecomputeIntervalMS()

long long XrdThrottle::Configuration::GetThrottleRecomputeIntervalMS | ( |  | ) | const

inline

Definition at line 93 of file XrdThrottleConfig.hh.

{ return m_throttle_recompute_interval_ms; }

Referenced by XrdThrottleManager::FromConfig().

Here is the caller graph for this function:

## GetTraceLevels()

int XrdThrottle::Configuration::GetTraceLevels | ( |  | ) | const

inline

Definition at line 97 of file XrdThrottleConfig.hh.

{ return m_trace_levels; }

Referenced by XrdThrottleManager::FromConfig().

Here is the caller graph for this function:

The documentation for this class was generated from the following files:

- XrdThrottleConfig.hh
- XrdThrottleConfig.cc