measure refill rate

This commit is contained in:
Athou
2013-08-18 17:19:01 +02:00
parent 8f19e9408e
commit d92c2ebdf7

View File

@@ -57,6 +57,7 @@ public class FeedRefreshTaskGiver {
private Meter feedRefreshed; private Meter feedRefreshed;
private Meter threadWaited; private Meter threadWaited;
private Meter refill;
@PostConstruct @PostConstruct
public void init() { public void init() {
@@ -64,6 +65,7 @@ public class FeedRefreshTaskGiver {
executor = Executors.newFixedThreadPool(1); executor = Executors.newFixedThreadPool(1);
feedRefreshed = metrics.meter(MetricRegistry.name(getClass(), "feedRefreshed")); feedRefreshed = metrics.meter(MetricRegistry.name(getClass(), "feedRefreshed"));
threadWaited = metrics.meter(MetricRegistry.name(getClass(), "threadWaited")); threadWaited = metrics.meter(MetricRegistry.name(getClass(), "threadWaited"));
refill = metrics.meter(MetricRegistry.name(getClass(), "refill"));
} }
@PreDestroy @PreDestroy
@@ -144,6 +146,7 @@ public class FeedRefreshTaskGiver {
* refills the refresh queue and empties the giveBack queue while at it * refills the refresh queue and empties the giveBack queue while at it
*/ */
private void refill() { private void refill() {
refill.mark();
int count = Math.min(100, 3 * backgroundThreads); int count = Math.min(100, 3 * backgroundThreads);
// first, get feeds that are up to refresh from the database // first, get feeds that are up to refresh from the database