#include <StorageAccount.h>
Definition at line 9 of file StorageAccount.h.
StorageAccount::Counter & StorageAccount::counter |
( |
const std::string & |
storageClass, |
|
|
const std::string & |
operation |
|
) |
| |
|
static |
Definition at line 96 of file StorageAccount.cc.
References CommonMethods::lock(), pos, s_mutex, s_stats, and vdt::x.
Referenced by StorageFactory::check(), StorageAccountProxy::close(), StorageAccountProxy::flush(), StorageFactory::open(), StorageAccountProxy::resize(), StorageFactory::stagein(), StorageAccountProxy::StorageAccountProxy(), storageCounter(), and StorageAccountProxy::~StorageAccountProxy().
98 boost::shared_ptr<OperationStats> &opstats =
s_stats [storageClass];
101 OperationStats::iterator
pos = opstats->find (operation);
102 if (pos == opstats->end ()) {
std::map< std::string, Counter > OperationStats
StorageAccount::StorageStats s_stats
unsigned int(* Counter)(align::ID)
Container::value_type value_type
void StorageAccount::fillSummary |
( |
std::map< std::string, std::string > & |
summary | ) |
|
|
static |
Definition at line 74 of file StorageAccount.cc.
References d2str(), i, i2str(), j, and s_stats.
Referenced by TFileAdaptor::statsXML().
75 int const oneM = 1000 * 1000;
76 int const oneMeg = 1024 * 1024;
78 for (OperationStats::iterator
j =
i->second->begin();
j !=
i->second->end(); ++
j) {
79 std::ostringstream os;
80 os <<
"Timing-" <<
i->first <<
"-" <<
j->first <<
"-";
81 summary.insert(std::make_pair(os.str() +
"numOperations",
i2str(
j->second.attempts)));
82 summary.insert(std::make_pair(os.str() +
"numSuccessfulOperations",
i2str(
j->second.successes)));
83 summary.insert(std::make_pair(os.str() +
"totalMegabytes",
d2str(
j->second.amount / oneMeg)));
84 summary.insert(std::make_pair(os.str() +
"totalMsecs",
d2str(
j->second.timeTotal / oneM)));
85 summary.insert(std::make_pair(os.str() +
"minMsecs",
d2str(
j->second.timeMin / oneM)));
86 summary.insert(std::make_pair(os.str() +
"maxMsecs",
d2str(
j->second.timeMax / oneM)));
static const StorageStats & summary(void)
StorageAccount::StorageStats s_stats
static std::string d2str(double d)
static std::string i2str(int i)
std::string StorageAccount::summaryText |
( |
bool |
banner = false | ) |
|
|
static |
Definition at line 35 of file StorageAccount.cc.
References first, i, j, and s_stats.
Referenced by TFileAdaptor::stats().
37 std::ostringstream os;
39 os <<
"stats: class/operation/attempts/successes/amount/time-total/time-min/time-max\n";
41 for (OperationStats::iterator
j =
i->second->begin ();
j !=
i->second->end (); ++
j, first =
false)
42 os << (first ?
"" :
"; ")
45 <<
j->second.attempts <<
'/'
46 <<
j->second.successes <<
'/'
47 << (
j->second.amount / 1024 / 1024) <<
"MB/"
48 << (
j->second.timeTotal / 1000 / 1000) <<
"ms/"
49 << (
j->second.timeMin / 1000 / 1000) <<
"ms/"
50 << (
j->second.timeMax / 1000 / 1000) <<
"ms";
StorageAccount::StorageStats s_stats
std::string StorageAccount::summaryXML |
( |
void |
| ) |
|
|
static |
Definition at line 56 of file StorageAccount.cc.
References i, j, and s_stats.
57 std::ostringstream os;
58 os <<
"<storage-timing-summary>\n";
60 for (OperationStats::iterator
j =
i->second->begin ();
j !=
i->second->end (); ++
j)
61 os <<
" <counter-value subsystem='" <<
i->first
62 <<
"' counter-name='" <<
j->first
63 <<
"' num-operations='" <<
j->second.attempts
64 <<
"' num-successful-operations='" <<
j->second.successes
65 <<
"' total-megabytes='" << (
j->second.amount / 1024 / 1024)
66 <<
"' total-msecs='" << (
j->second.timeTotal / 1000 / 1000)
67 <<
"' min-msecs='" << (
j->second.timeMin / 1000 / 1000)
68 <<
"' max-msecs='" << (
j->second.timeMax / 1000 / 1000) <<
"'/>\n";
69 os <<
"</storage-timing-summary>";
StorageAccount::StorageStats s_stats