본문 바로가기
빅데이터/hive

[hive] metastore 메트릭 설정 하는 방법

by hs_seo 2024. 1. 8.

하이브 메타스토어의 metric을 설정하려면 hive-site.xml 파일에 다음 설정을 추가해야 합니다.

 

다음과 같이 설정하면 /tmp/report.json 위치에 5초에 한번 씩 메트릭 설정 파일을 생성합니다. 기본 설정은 json 형태의 파일이며, JMX 형태로 출력할 수도 있습니다.

 

<configuration>

    <property>
        <name>hive.metastore.metrics.enabled</name>
        <value>true</value>
    </property>

    <property>
        <name>hive.service.metrics.file.location</name>
        <value>/tmp/report.json</value>
    </property>

    <property>
        <name>hive.service.metrics.file.frequency</name>
        <value>5 seconds</value>
    </property>

</configuration>

 

다음 위치에서 설정을 확인할 수 있습니다.

 

https://cwiki.apache.org/confluence/display/Hive/Configuration+Properties#ConfigurationProperties-Metrics

 

Configuration Properties - Apache Hive - Apache Software Foundation

 

cwiki.apache.org

 

json 형태의 파일은 다음과 같은 형태입니다.

 

{
  "version" : "3.0.0",
  "gauges" : {
    "PS-MarkSweep.count" : {
      "value" : 3
    },
    "PS-MarkSweep.time" : {
      "value" : 181
    },
    "PS-Scavenge.count" : {
      "value" : 34
    },
    "PS-Scavenge.time" : {
      "value" : 183
    },
    "blocked.count" : {
      "value" : 0
    },
    "count" : {
      "value" : 32
    },
    "daemon.count" : {
      "value" : 11
    },
    "deadlock.count" : {
      "value" : 0
    },
    "deadlocks" : {
      "value" : [ ]
    },
    "direct.capacity" : {
      "value" : 0
    },
    "direct.count" : {
      "value" : 0
    },
    "direct.used" : {
      "value" : 0
    },
    "heap.committed" : {
      "value" : 251658240
    },
    "heap.init" : {
      "value" : 262144000
    },
    "heap.max" : {
      "value" : 251658240
    },
    "heap.usage" : {
      "value" : 0.3583019892374674
    },
    "heap.used" : {
      "value" : 90169648
    },
    "loaded" : {
      "value" : 12558
    },
    "mapped.capacity" : {
      "value" : 0
    },
    "mapped.count" : {
      "value" : 0
    },
    "mapped.used" : {
      "value" : 0
    },
    "new.count" : {
      "value" : 0
    },
    "non-heap.committed" : {
      "value" : 96886784
    },
    "non-heap.init" : {
      "value" : 2555904
    },
    "non-heap.max" : {
      "value" : -1
    },
    "non-heap.usage" : {
      "value" : -9.5516032E7
    },
    "non-heap.used" : {
      "value" : 95516032
    },
    "open_connections" : {
      "value" : 2
    },
    "pools.Code-Cache.usage" : {
      "value" : 0.060585276285807295
    },
    "pools.Compressed-Class-Space.usage" : {
      "value" : 0.007863745093345642
    },
    "pools.Metaspace.usage" : {
      "value" : 0.9861405230710831
    },
    "pools.PS-Eden-Space.usage" : {
      "value" : 0.8868429432744566
    },
    "pools.PS-Old-Gen.usage" : {
      "value" : 0.15016843561540572
    },
    "pools.PS-Survivor-Space.usage" : {
      "value" : 0.7169388991135818
    },
    "runnable.count" : {
      "value" : 5
    },
    "terminated.count" : {
      "value" : 0
    },
    "timed_waiting.count" : {
      "value" : 7
    },
    "total.committed" : {
      "value" : 348545024
    },
    "total.init" : {
      "value" : 264699904
    },
    "total.max" : {
      "value" : 251658239
    },
    "total.used" : {
      "value" : 185901328
    },
    "total_count_dbs" : {
      "value" : 4
    },
    "total_count_partitions" : {
      "value" : 0
    },
    "total_count_tables" : {
      "value" : 1
    },
    "unloaded" : {
      "value" : 8
    },
    "waiting.count" : {
      "value" : 20
    }
  },
  "counters" : {
    "active_calls_create_database" : {
      "count" : 0
    },
    "active_calls_create_table" : {
      "count" : 0
    },
    "active_calls_get_all_functions" : {
      "count" : 0
    },
    "active_calls_get_database" : {
      "count" : 0
    },
    "active_calls_get_databases" : {
      "count" : 0
    },
    "active_calls_get_multi_table" : {
      "count" : 0
    },
    "active_calls_get_table" : {
      "count" : 0
    },
    "active_calls_get_tables" : {
      "count" : 0
    },
    "active_calls_get_tables_by_type" : {
      "count" : 0
    },
    "create_total_count_dbs" : {
      "count" : 3
    },
    "create_total_count_partitions" : {
      "count" : 0
    },
    "create_total_count_tables" : {
      "count" : 1
    },
    "delete_total_count_dbs" : {
      "count" : 0
    },
    "delete_total_count_partitions" : {
      "count" : 0
    },
    "delete_total_count_tables" : {
      "count" : 0
    },
    "directsql_errors" : {
      "count" : 0
    },
    "jvm.pause.extraSleepTime" : {
      "count" : 106
    },
    "jvm.pause.info-threshold" : {
      "count" : 0
    },
    "jvm.pause.warn-threshold" : {
      "count" : 0
    }
  },
  "histograms" : { },
  "meters" : { },
  "timers" : {
    "api_create_database" : {
      "count" : 6,
      "max" : 1088.776762,
      "mean" : 444.9632715795527,
      "min" : 127.43292799999999,
      "p50" : 184.902933,
      "p75" : 1088.260578,
      "p95" : 1088.776762,
      "p98" : 1088.776762,
      "p99" : 1088.776762,
      "p999" : 1088.776762,
      "stddev" : 430.53565217146263,
      "m15_rate" : 0.0,
      "m1_rate" : 0.0,
      "m5_rate" : 0.0,
      "mean_rate" : 0.0,
      "duration_units" : "milliseconds",
      "rate_units" : "calls/millisecond"
    },
    "api_create_table" : {
      "count" : 1,
      "max" : 468.21102399999995,
      "mean" : 468.21102399999995,
      "min" : 468.21102399999995,
      "p50" : 468.21102399999995,
      "p75" : 468.21102399999995,
      "p95" : 468.21102399999995,
      "p98" : 468.21102399999995,
      "p99" : 468.21102399999995,
      "p999" : 468.21102399999995,
      "stddev" : 0.0,
      "m15_rate" : 0.0,
      "m1_rate" : 0.0,
      "m5_rate" : 0.0,
      "mean_rate" : 0.0,
      "duration_units" : "milliseconds",
      "rate_units" : "calls/millisecond"
    },
    "api_create_table_with_environment_context" : {
      "count" : 1,
      "max" : 468.89034399999997,
      "mean" : 468.89034399999997,
      "min" : 468.89034399999997,
      "p50" : 468.89034399999997,
      "p75" : 468.89034399999997,
      "p95" : 468.89034399999997,
      "p98" : 468.89034399999997,
      "p99" : 468.89034399999997,
      "p999" : 468.89034399999997,
      "stddev" : 0.0,
      "m15_rate" : 0.0,
      "m1_rate" : 0.0,
      "m5_rate" : 0.0,
      "mean_rate" : 0.0,
      "duration_units" : "milliseconds",
      "rate_units" : "calls/millisecond"
    },
    "api_flushCache" : {
      "count" : 15,
      "max" : 0.102411,
      "mean" : 0.07078194310668183,
      "min" : 0.022903,
      "p50" : 0.052118,
      "p75" : 0.0906,
      "p95" : 0.0906,
      "p98" : 0.0906,
      "p99" : 0.0906,
      "p999" : 0.0906,
      "stddev" : 0.019232344795730823,
      "m15_rate" : 0.0,
      "m1_rate" : 0.0,
      "m5_rate" : 0.0,
      "mean_rate" : 0.0,
      "duration_units" : "milliseconds",
      "rate_units" : "calls/millisecond"
    },
    "api_get_all_functions" : {
      "count" : 10,
      "max" : 153.586997,
      "mean" : 39.55107850000053,
      "min" : 39.458988,
      "p50" : 39.643169,
      "p75" : 39.643169,
      "p95" : 39.643169,
      "p98" : 39.643169,
      "p99" : 39.643169,
      "p999" : 39.643169,
      "stddev" : 0.09209050023058414,
      "m15_rate" : 0.0,
      "m1_rate" : 0.0,
      "m5_rate" : 0.0,
      "mean_rate" : 0.0,
      "duration_units" : "milliseconds",
      "rate_units" : "calls/millisecond"
    },
    "api_get_current_notificationEventId" : {
      "count" : 1,
      "max" : 26.661454,
      "mean" : 26.661454,
      "min" : 26.661454,
      "p50" : 26.661454,
      "p75" : 26.661454,
      "p95" : 26.661454,
      "p98" : 26.661454,
      "p99" : 26.661454,
      "p999" : 26.661454,
      "stddev" : 0.0,
      "m15_rate" : 0.0,
      "m1_rate" : 0.0,
      "m5_rate" : 0.0,
      "mean_rate" : 0.0,
      "duration_units" : "milliseconds",
      "rate_units" : "calls/millisecond"
    },
    "api_get_database" : {
      "count" : 46,
      "max" : 14.447481999999999,
      "mean" : 12.702148472238092,
      "min" : 10.626126,
      "p50" : 11.449326,
      "p75" : 14.327435,
      "p95" : 14.447481999999999,
      "p98" : 14.447481999999999,
      "p99" : 14.447481999999999,
      "p999" : 14.447481999999999,
      "stddev" : 1.546680049348721,
      "m15_rate" : 0.0,
      "m1_rate" : 0.0,
      "m5_rate" : 0.0,
      "mean_rate" : 0.0,
      "duration_units" : "milliseconds",
      "rate_units" : "calls/millisecond"
    },
    "api_get_databases" : {
      "count" : 12,
      "max" : 37.976278,
      "mean" : 37.84153005154411,
      "min" : 9.326004,
      "p50" : 37.813210999999995,
      "p75" : 37.976278,
      "p95" : 37.976278,
      "p98" : 37.976278,
      "p99" : 37.976278,
      "p999" : 37.976278,
      "stddev" : 1.1990330616160505,
      "m15_rate" : 0.0,
      "m1_rate" : 0.0,
      "m5_rate" : 0.0,
      "mean_rate" : 0.0,
      "duration_units" : "milliseconds",
      "rate_units" : "calls/millisecond"
    },
    "api_get_multi_table" : {
      "count" : 14,
      "max" : 0.120322,
      "mean" : 0.01358250000000017,
      "min" : 0.011141,
      "p50" : 0.013685,
      "p75" : 0.018023,
      "p95" : 0.018023,
      "p98" : 0.018023,
      "p99" : 0.018023,
      "p999" : 0.018023,
      "stddev" : 0.002741385188187275,
      "m15_rate" : 0.0,
      "m1_rate" : 0.0,
      "m5_rate" : 0.0,
      "mean_rate" : 0.0,
      "duration_units" : "milliseconds",
      "rate_units" : "calls/millisecond"
    },
    "api_get_table" : {
      "count" : 1,
      "max" : 40.916548,
      "mean" : 40.916548,
      "min" : 40.916548,
      "p50" : 40.916548,
      "p75" : 40.916548,
      "p95" : 40.916548,
      "p98" : 40.916548,
      "p99" : 40.916548,
      "p999" : 40.916548,
      "stddev" : 0.0,
      "m15_rate" : 0.0,
      "m1_rate" : 0.0,
      "m5_rate" : 0.0,
      "mean_rate" : 0.0,
      "duration_units" : "milliseconds",
      "rate_units" : "calls/millisecond"
    },
    "api_get_table_objects_by_name_req" : {
      "count" : 14,
      "max" : 1.1591719999999999,
      "mean" : 0.16781575000000246,
      "min" : 0.12236599999999999,
      "p50" : 0.169534,
      "p75" : 0.213305,
      "p95" : 0.213305,
      "p98" : 0.213305,
      "p99" : 0.213305,
      "p999" : 0.213305,
      "stddev" : 0.032175276645100004,
      "m15_rate" : 0.0,
      "m1_rate" : 0.0,
      "m5_rate" : 0.0,
      "mean_rate" : 0.0,
      "duration_units" : "milliseconds",
      "rate_units" : "calls/millisecond"
    },
    "api_get_table_req" : {
      "count" : 1,
      "max" : 44.091826999999995,
      "mean" : 44.091826999999995,
      "min" : 44.091826999999995,
      "p50" : 44.091826999999995,
      "p75" : 44.091826999999995,
      "p95" : 44.091826999999995,
      "p98" : 44.091826999999995,
      "p99" : 44.091826999999995,
      "p999" : 44.091826999999995,
      "stddev" : 0.0,
      "m15_rate" : 0.0,
      "m1_rate" : 0.0,
      "m5_rate" : 0.0,
      "mean_rate" : 0.0,
      "duration_units" : "milliseconds",
      "rate_units" : "calls/millisecond"
    },
    "api_get_tables" : {
      "count" : 22,
      "max" : 10.527555,
      "mean" : 9.375800479396363,
      "min" : 9.003544,
      "p50" : 9.290447,
      "p75" : 9.515732,
      "p95" : 9.515732,
      "p98" : 9.515732,
      "p99" : 9.515732,
      "p999" : 9.515732,
      "stddev" : 0.12785516577651726,
      "m15_rate" : 0.0,
      "m1_rate" : 0.0,
      "m5_rate" : 0.0,
      "mean_rate" : 0.0,
      "duration_units" : "milliseconds",
      "rate_units" : "calls/millisecond"
    },
    "api_get_tables_by_type" : {
      "count" : 28,
      "max" : 15.514476,
      "mean" : 9.526827250000027,
      "min" : 9.159256,
      "p50" : 9.521156,
      "p75" : 9.802636,
      "p95" : 9.955098,
      "p98" : 9.955098,
      "p99" : 9.955098,
      "p999" : 9.955098,
      "stddev" : 0.24705002648306407,
      "m15_rate" : 0.0,
      "m1_rate" : 0.0,
      "m5_rate" : 0.0,
      "mean_rate" : 0.0,
      "duration_units" : "milliseconds",
      "rate_units" : "calls/millisecond"
    },
    "api_init" : {
      "count" : 1,
      "max" : 3170.581722,
      "mean" : 3170.581722,
      "min" : 3170.581722,
      "p50" : 3170.581722,
      "p75" : 3170.581722,
      "p95" : 3170.581722,
      "p98" : 3170.581722,
      "p99" : 3170.581722,
      "p999" : 3170.581722,
      "stddev" : 0.0,
      "m15_rate" : 0.0,
      "m1_rate" : 0.0,
      "m5_rate" : 0.0,
      "mean_rate" : 0.0,
      "duration_units" : "milliseconds",
      "rate_units" : "calls/millisecond"
    },
    "api_set_ugi" : {
      "count" : 18,
      "max" : 0.32861999999999997,
      "mean" : 0.12840442824914913,
      "min" : 0.017439,
      "p50" : 0.036358,
      "p75" : 0.32861999999999997,
      "p95" : 0.32861999999999997,
      "p98" : 0.32861999999999997,
      "p99" : 0.32861999999999997,
      "p999" : 0.32861999999999997,
      "stddev" : 0.13666058170834242,
      "m15_rate" : 0.0,
      "m1_rate" : 0.0,
      "m5_rate" : 0.0,
      "mean_rate" : 0.0,
      "duration_units" : "milliseconds",
      "rate_units" : "calls/millisecond"
    },
    "api_shutdown" : {
      "count" : 11,
      "max" : 1.330095,
      "mean" : 0.609825144654769,
      "min" : 0.285271,
      "p50" : 0.610381,
      "p75" : 0.610381,
      "p95" : 0.610381,
      "p98" : 0.610381,
      "p99" : 0.610381,
      "p999" : 0.610381,
      "stddev" : 0.012588111174789316,
      "m15_rate" : 0.0,
      "m1_rate" : 0.0,
      "m5_rate" : 0.0,
      "mean_rate" : 0.0,
      "duration_units" : "milliseconds",
      "rate_units" : "calls/millisecond"
    }
  }
}
반응형