mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-09-24 18:50:49 +00:00
Merge
This commit is contained in:
commit
0f89a6aab7
@ -33,7 +33,7 @@ public:
|
||||
|
||||
/// Для облачных демонов удобней использовать
|
||||
/// путь вида prefix.environment.layer.daemon_name.metrica
|
||||
static const std::string & getPerLayerPath(const std::string & prefix = "one_min");
|
||||
static std::string getPerLayerPath(const std::string & prefix = "one_min");
|
||||
|
||||
/// возвращает путь root_path.server_name
|
||||
static std::string getPerServerPath(const std::string & server_name, const std::string & root_path = "one_min");
|
||||
|
@ -31,7 +31,7 @@ GraphiteWriter::GraphiteWriter(const std::string & config_name, const std::strin
|
||||
root_path += "." + sub_path;
|
||||
}
|
||||
|
||||
static std::string getPerLayerPathImpl(const std::string prefix)
|
||||
std::string getPostfix()
|
||||
{
|
||||
/// Угадываем имя среды по имени машинки
|
||||
/// машинки имеют имена вида example01dt.yandex.ru
|
||||
@ -41,8 +41,6 @@ static std::string getPerLayerPathImpl(const std::string prefix)
|
||||
|
||||
std::stringstream path_full;
|
||||
|
||||
path_full << prefix << ".";
|
||||
|
||||
std::string hostname = Poco::Net::DNS::hostName();
|
||||
hostname = hostname.substr(0, hostname.find('.'));
|
||||
|
||||
@ -72,10 +70,10 @@ static std::string getPerLayerPathImpl(const std::string prefix)
|
||||
return path_full.str();
|
||||
}
|
||||
|
||||
const std::string & GraphiteWriter::getPerLayerPath(const std::string & prefix)
|
||||
std::string GraphiteWriter::getPerLayerPath(const std::string & prefix)
|
||||
{
|
||||
static std::string path = getPerLayerPathImpl(prefix); /// thread-safe statics.
|
||||
return path;
|
||||
const std::string static postfix = getPostfix();
|
||||
return prefix + "." + postfix;
|
||||
}
|
||||
|
||||
std::string GraphiteWriter::getPerServerPath(const std::string & server_name, const std::string & root_path)
|
||||
|
Loading…
Reference in New Issue
Block a user