在上次我做了很多整合(从一个地方到另一个地方的数据传输,包括DB,SSH,FTP等),并且每个我需要记录一些统计信息(例如多少更新的文件,插入的数据库行数,发生的错误等)。所有这些集成每天工作一次,直到发生一些错误,我对日志不感兴趣。但是当发生错误时,我需要一些统计数据用于以前的运行。 基本上我在主类中做了5-10个int变量,并输出它们到最后的日志。但是每次创建多个变量,然后编码输出它们并不是很方便。同样在目前,它将是各种地方的20+统计变量(所以我至少需要单独的课程)。java lib用于收集整合统计信息
我只是想知道是否已经有一些Java库可以帮助我。
基本上 在代码中,我想:
statistics.increase(counterName); //to increase counter
statistics.out(); //to get string of somehow formatted statistics
statistics.out(counterName); //to get string for specific counter
理想:
could work with no configuration
support for slf4j
statistics.adjust(counterName, value);
statistics.addcounter(counterName, tagName, initial value, increment);
statistics.outTag(tagName); //output counters with specific tag
嗯..他们看起来像一个大framworks。我需要一些小而简单的东西。 – 2010-08-18 14:01:44