mirror of
https://github.com/Athou/commafeed.git
synced 2026-03-21 21:37:29 +00:00
metrics for entry cache
This commit is contained in:
@@ -64,6 +64,16 @@ public class MetricsBean {
|
||||
thisMinute.statusesInserted += statusesCount;
|
||||
}
|
||||
|
||||
public void entryCacheHit() {
|
||||
thisHour.entryCacheHit++;
|
||||
thisMinute.entryCacheHit++;
|
||||
}
|
||||
|
||||
public void entryCacheMiss() {
|
||||
thisHour.entryCacheMiss++;
|
||||
thisMinute.entryCacheMiss++;
|
||||
}
|
||||
|
||||
public void pushReceived(int feedCount) {
|
||||
|
||||
thisHour.pushNotificationsReceived++;
|
||||
@@ -101,6 +111,8 @@ public class MetricsBean {
|
||||
private int threadWaited;
|
||||
private int pushNotificationsReceived;
|
||||
private int pushFeedsQueued;
|
||||
private int entryCacheHit;
|
||||
private int entryCacheMiss;
|
||||
|
||||
public int getFeedsRefreshed() {
|
||||
return feedsRefreshed;
|
||||
|
||||
@@ -172,11 +172,13 @@ public class FeedRefreshUpdater {
|
||||
locked = lock.tryLock(1, TimeUnit.MINUTES);
|
||||
if (locked) {
|
||||
if (!cache.hasFeedEntry(feed, entry)) {
|
||||
log.info("cache miss for {}", entry.getUrl());
|
||||
log.debug("cache miss for {}", entry.getUrl());
|
||||
feedUpdateService.updateEntry(feed, entry, subscriptions);
|
||||
cache.putFeedEntry(feed, entry);
|
||||
metricsBean.entryCacheMiss();
|
||||
} else {
|
||||
log.info("cache hit for {}", entry.getUrl());
|
||||
log.debug("cache hit for {}", entry.getUrl());
|
||||
metricsBean.entryCacheHit();
|
||||
}
|
||||
success = true;
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user