Added metric with revision number for better monitoring of deployment [#CLICKHOUSE-2].

This commit is contained in:
Alexey Milovidov 2017-08-01 17:34:06 +03:00
parent fd5ac57b8e
commit 34ac4fa3b8
2 changed files with 12 additions and 1 deletions

View File

@ -34,6 +34,7 @@
M(StorageBufferRows) \
M(StorageBufferBytes) \
M(DictCacheRequests) \
M(Revision) \
namespace CurrentMetrics

View File

@ -18,6 +18,8 @@
#include <Common/getMultipleKeysFromConfig.h>
#include <common/getMemoryAmount.h>
#include <Common/getNumberOfPhysicalCPUCores.h>
#include <Common/CurrentMetrics.h>
#include <Common/ClickHouseRevision.h>
#include <IO/HTTPCommon.h>
#include <Interpreters/AsynchronousMetrics.h>
#include <Interpreters/ProcessList.h>
@ -46,9 +48,15 @@
#include <TableFunctions/registerTableFunctions.h>
namespace CurrentMetrics
{
extern const Metric Revision;
}
namespace DB
{
namespace ErrorCodes
namespace ErrorCodes
{
extern const int NO_ELEMENTS_IN_CONFIG;
extern const int SUPPORT_IS_DISABLED;
@ -221,6 +229,8 @@ int Server::main(const std::vector<std::string> & args)
registerAggregateFunctions();
registerTableFunctions();
CurrentMetrics::set(CurrentMetrics::Revision, ClickHouseRevision::get());
/** Context contains all that query execution is dependent:
* settings, available functions, data types, aggregate functions, databases...
*/