hadoop知識之counter

在mapper中

try  catch 異常中作如下處理:

context.getCounter("errorLines", "mapShortUrl").increment(1);


在界面中會看到如下的 計數。

  Counter Map Reduce Total
errorLines mapShortUrl 23,128 0 23,128
Job Counters SLOTS_MILLIS_MAPS 0 0 23,779
Launched reduce tasks 0 0 1
Total time spent by all reduces waiting after reserving slots (ms) 0 0 0
Rack-local map tasks 0 0 1
Total time spent by all maps waiting after reserving slots (ms) 0 0 0
Launched map tasks 0 0 1
SLOTS_MILLIS_REDUCES 0 0 12,844

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章