If close fails, the counter would be incremented multiple times for the same entry. Its better if we increment only on successful open of next file.

arshadm@databusdev2:~$ ./scribe_ctrl.py counters 12000 | grep benchmark_local
benchmark_local1:hdfs_wrote_num_messages: 0
benchmark_local1:hdfs_wrote_bytes: 0
benchmark_local:denied for queue size: 204985
benchmark_local:std_wrote_bytes: 0
benchmark_local:std_wrote_num_messages: 0
benchmark_local:retries: 3
benchmark_local:requeue: 19831028
benchmark_local:hdfs_wrote_num_messages: 572723
benchmark_local:received good: 500000
benchmark_local:hdfs_wrote_bytes: 1545198240

The extra 72723 messages are because of two entries that are repeated
[Mon Feb 11 06:34:24 2013] "[2013-02-11-06:34 wrote <128000390> bytes in <47870> events to file <hdfs://databusdev2.mkhoj.com:9000/databus/data/benchmark_local/databusdev2.mkhoj.com/benchmark_local-2013-02-11-06-33_00000>
[Mon Feb 11 06:34:35 2013] "[2013-02-11-06:34 wrote <128000390> bytes in <47870> events to file <hdfs://databusdev2.mkhoj.com:9000/databus/data/benchmark_local/databusdev2.mkhoj.com/benchmark_local-2013-02-11-06-33_00000>
[Mon Feb 11 06:35:47 2013] "[2013-02-11-06:35 wrote <67098242> bytes in <24853> events to file <hdfs://databusdev2.mkhoj.com:9000/databus/data/benchmark_local/databusdev2.mkhoj.com/benchmark_local-2013-02-11-06-35_00000>
[Mon Feb 11 06:36:08 2013] "[2013-02-11-06:36 wrote <67098242> bytes in <24853> events to file <hdfs://databusdev2.mkhoj.com:9000/databus/data/benchmark_local/databusdev2.mkhoj.com/benchmark_local-2013-02-11-06-35_00000>