list
^^^^
-Dump all variables and their values in a comma separated list,
+Dump all statistics and their values in a comma separated list,
equivalent to ``show *``.
list-zones [master,slave,native]
Set the configuration parameter *VARIABLE* to *VALUE*. Currently
only the query-logging can be set.
-show *VARIABLE*
-^^^^^^^^^^^^^^^
+show *STATISTIC*
+^^^^^^^^^^^^^^^^
Show a single statistic, as present in the output of the list
command.
+show *STATISTIC-PREFIX*\*
+^^^^^^^^^^^^^^^^^^^^^^^^^
+
+Show all statistics which names start with the supplied *STATISTIC-PREFIX*,
+as a comma-separated list. Only one (ending) wildcard is allowed.
+
status
^^^^^^
if (parts.size() == 2) {
if (parts[1] == "*")
ret = S.directory();
+ else if (parts[1].length() && parts[1][parts[1].length() - 1 ] == '*')
+ ret = S.directory(parts[1].substr(0, parts[1].length() - 1));
else
ret = S.getValueStr(parts[1]);
}
}
}
-string StatBag::directory()
+string StatBag::directory(const string &prefix)
{
string dir;
ostringstream o;
- for(const auto& i: d_stats) {
- if (d_blacklist.find(i.first) != d_blacklist.end())
+ for(const auto& val : d_stats) {
+ if (d_blacklist.find(val.first) != d_blacklist.end())
continue;
- o<<i.first<<"="<<*(i.second)<<",";
+ if (val.first.find(prefix) != 0)
+ continue;
+ o << val.first<<"="<<*(val.second)<<",";
}
for(const funcstats_t::value_type& val : d_funcstats) {
if (d_blacklist.find(val.first) != d_blacklist.end())
continue;
+ if (val.first.find(prefix) != 0)
+ continue;
o << val.first<<"="<<val.second(val.first)<<",";
}
dir=o.str();
return dir;
}
-
vector<string>StatBag::getEntries()
{
vector<string> ret;
uint64_t getRingSize(const string &name);
uint64_t getRingEntriesCount(const string &name);
- string directory(); //!< Returns a list of all data stored
+ string directory(const string &prefix = ""); //!< Returns a list of all data stored. If prefix is given, only stats named with this prefix are returned.
vector<string> getEntries(); //!< returns a vector with datums (items)
string getDescrip(const string &item); //!< Returns the description of this datum/item
StatType getStatType(const string &item); //!< Returns the stats type for the metrics endpoint