在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 |