mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-27 18:12:02 +00:00
Make common macros extendable
This commit is contained in:
parent
376c903da9
commit
d8e87f6c1d
@ -2,7 +2,7 @@
|
||||
|
||||
|
||||
/// Available metrics. Add something here as you wish.
|
||||
#define APPLY_FOR_METRICS(M) \
|
||||
#define APPLY_FOR_BUILTIN_METRICS(M) \
|
||||
M(Query, "Number of executing queries") \
|
||||
M(Merge, "Number of executing background merges") \
|
||||
M(Move, "Number of currently executing moves") \
|
||||
@ -200,7 +200,13 @@
|
||||
M(MergeTreeReadTaskRequestsSent, "The current number of callback requests in flight from the remote server back to the initiator server to choose the read task (for MergeTree tables). Measured on the remote server side.") \
|
||||
M(MergeTreeAllRangesAnnouncementsSent, "The current number of announcement being sent in flight from the remote server to the initiator server about the set of data parts (for MergeTree tables). Measured on the remote server side.") \
|
||||
M(CreatedTimersInQueryProfiler, "Number of Created thread local timers in QueryProfiler") \
|
||||
M(ActiveTimersInQueryProfiler, "Number of Active thread local timers in QueryProfiler")
|
||||
M(ActiveTimersInQueryProfiler, "Number of Active thread local timers in QueryProfiler") \
|
||||
|
||||
#ifdef APPLY_FOR_EXTERNAL_METRICS
|
||||
#define APPLY_FOR_METRICS(M) APPLY_FOR_BUILTIN_METRICS(M) APPLY_FOR_EXTERNAL_METRICS(M)
|
||||
#else
|
||||
#define APPLY_FOR_METRICS(M) APPLY_FOR_BUILTIN_METRICS(M)
|
||||
#endif
|
||||
|
||||
namespace CurrentMetrics
|
||||
{
|
||||
|
@ -13,7 +13,7 @@
|
||||
* - system.errors table
|
||||
*/
|
||||
|
||||
#define APPLY_FOR_ERROR_CODES(M) \
|
||||
#define APPLY_FOR_BUILTIN_ERROR_CODES(M) \
|
||||
M(0, OK) \
|
||||
M(1, UNSUPPORTED_METHOD) \
|
||||
M(2, UNSUPPORTED_PARAMETER) \
|
||||
@ -589,6 +589,12 @@
|
||||
M(1002, UNKNOWN_EXCEPTION) \
|
||||
/* See END */
|
||||
|
||||
#ifdef APPLY_FOR_EXTERNAL_ERROR_CODES
|
||||
#define APPLY_FOR_ERROR_CODES(M) APPLY_FOR_BUILTIN_ERROR_CODES(M) APPLY_FOR_EXTERNAL_ERROR_CODES(M)
|
||||
#else
|
||||
#define APPLY_FOR_ERROR_CODES(M) APPLY_FOR_BUILTIN_ERROR_CODES(M)
|
||||
#endif
|
||||
|
||||
namespace DB
|
||||
{
|
||||
namespace ErrorCodes
|
||||
|
@ -4,7 +4,7 @@
|
||||
|
||||
|
||||
/// Available events. Add something here as you wish.
|
||||
#define APPLY_FOR_EVENTS(M) \
|
||||
#define APPLY_FOR_BUILTIN_EVENTS(M) \
|
||||
M(Query, "Number of queries to be interpreted and potentially executed. Does not include queries that failed to parse or were rejected due to AST size limits, quota limits or limits on the number of simultaneously running queries. May include internal queries initiated by ClickHouse itself. Does not count subqueries.") \
|
||||
M(SelectQuery, "Same as Query, but only for SELECT queries.") \
|
||||
M(InsertQuery, "Same as Query, but only for INSERT queries.") \
|
||||
@ -536,6 +536,11 @@ The server successfully detected this situation and will download merged part fr
|
||||
M(LogError, "Number of log messages with level Error") \
|
||||
M(LogFatal, "Number of log messages with level Fatal") \
|
||||
|
||||
#ifdef APPLY_FOR_EXTERNAL_EVENTS
|
||||
#define APPLY_FOR_EVENTS(M) APPLY_FOR_BUILTIN_EVENTS(M) APPLY_FOR_EXTERNAL_EVENTS(M)
|
||||
#else
|
||||
#define APPLY_FOR_EVENTS(M) APPLY_FOR_BUILTIN_EVENTS(M)
|
||||
#endif
|
||||
|
||||
namespace ProfileEvents
|
||||
{
|
||||
|
@ -2,9 +2,14 @@
|
||||
#include <Common/ExternalLoaderStatus.h>
|
||||
|
||||
/// Available status. Add something here as you wish.
|
||||
#define APPLY_FOR_STATUS(M) \
|
||||
#define APPLY_FOR_BUILTIN_STATUS(M) \
|
||||
M(DictionaryStatus, "Dictionary Status.", DB::getStatusEnumAllPossibleValues()) \
|
||||
|
||||
#ifdef APPLY_FOR_EXTERNAL_STATUS
|
||||
#define APPLY_FOR_STATUS(M) APPLY_FOR_BUILTIN_STATUS(M) APPLY_FOR_EXTERNAL_STATUS(M)
|
||||
#else
|
||||
#define APPLY_FOR_STATUS(M) APPLY_FOR_BUILTIN_STATUS(M)
|
||||
#endif
|
||||
|
||||
namespace CurrentStatusInfo
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user