could easily be added if necessary.
return "PONG";
}
-string DLShowHandler(const vector<string>&parts, Utility::pid_t ppid)
-try
-{
- extern StatBag S;
- string ret("Wrong number of parameters");
- if(parts.size()==2) {
- if(parts[1]=="*")
- ret=S.directory();
- else
- ret=S.getValueStr(parts[1]);
- }
+string DLShowHandler(const vector<string>&parts, Utility::pid_t ppid) {
+ std::set<string> blacklist;
+ blacklist.insert("special-memory-usage");
+ try {
+ extern StatBag S;
+ string ret("Wrong number of parameters");
+ if (parts.size() == 2) {
+ if (parts[1] == "*")
+ ret = S.directory(blacklist);
+ else
+ ret = S.getValueStr(parts[1]);
+ }
- return ret;
-}
-catch(...)
-{
- return "Unknown";
+ return ret;
+ }
+ catch (...) {
+ return "Unknown";
+ }
}
void setStatus(const string &str)
}
}
-string StatBag::directory()
+string StatBag::directory(const std::set<string>& skip)
{
string dir;
ostringstream o;
for(const auto& i: d_stats) {
+ if (skip.find(i.first) != skip.end())
+ continue;
o<<i.first<<"="<<*(i.second)<<",";
}
for(const funcstats_t::value_type& val : d_funcstats) {
+ if (skip.find(val.first) != skip.end())
+ continue;
o << val.first<<"="<<val.second(val.first)<<",";
}
dir=o.str();
void resizeRing(const string &name, unsigned int newsize);
unsigned int getRingSize(const string &name);
- string directory(); //!< Returns a list of all data stored
+ string directory(const std::set<string>& skip); //!< Returns a list of all data stored
vector<string> getEntries(); //!< returns a vector with datums (items)
string getDescrip(const string &item); //!< Returns the description of this datum/item
void exists(const string &key); //!< call this function to throw an exception in case a key does not exist