[Enhancement] Convert metric to Json format (#3635)
Add a JSON format for existing metrics like this.
```
{
"tags":
{
"metric":"thread_pool",
"name":"thrift-server-pool",
"type":"active_thread_num"
},
"unit":"number",
"value":3
}
```
I add a new JsonMetricVisitor to handle the transformation.
It's not to modify existing PrometheusMetricVisitor and SimpleCoreMetricVisitor.
Also I add
1. A unit item to indicate the metric better
2. Cloning tablet statistics divided by database.
3. Use white space to replace newline in audit.log
This commit is contained in:
@ -34,12 +34,12 @@ namespace doris {
|
||||
|
||||
ChunkAllocator* ChunkAllocator::_s_instance = nullptr;
|
||||
|
||||
static IntCounter local_core_alloc_count;
|
||||
static IntCounter other_core_alloc_count;
|
||||
static IntCounter system_alloc_count;
|
||||
static IntCounter system_free_count;
|
||||
static IntCounter system_alloc_cost_ns;
|
||||
static IntCounter system_free_cost_ns;
|
||||
static IntCounter local_core_alloc_count(MetricUnit::NUMBER);
|
||||
static IntCounter other_core_alloc_count(MetricUnit::NUMBER);
|
||||
static IntCounter system_alloc_count(MetricUnit::NUMBER);
|
||||
static IntCounter system_free_count(MetricUnit::NUMBER);
|
||||
static IntCounter system_alloc_cost_ns(MetricUnit::NANOSECONDS);
|
||||
static IntCounter system_free_cost_ns(MetricUnit::NANOSECONDS);
|
||||
|
||||
#ifdef BE_TEST
|
||||
static std::mutex s_mutex;
|
||||
|
||||
Reference in New Issue
Block a user