[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:
lichaoyong
2020-05-27 08:49:30 +08:00
committed by GitHub
parent 12c59ba889
commit 1cc78fe69b
43 changed files with 711 additions and 338 deletions

View File

@ -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;