more metrics

This commit is contained in:
Athou
2013-05-18 09:38:34 +02:00
parent 116735d1cf
commit 08a286cf23
2 changed files with 14 additions and 2 deletions

View File

@@ -33,9 +33,12 @@ public class MetricsBean {
thisHour.feedsRefreshed++;
}
public void feedUpdated() {
public void feedUpdated(int entriesCount) {
thisHour.feedsRefreshed++;
thisMinute.feedsUpdated++;
thisHour.entriesInserted += entriesCount;
thisMinute.entriesInserted += entriesCount;
}
public Metric getLastMinute() {
@@ -49,6 +52,7 @@ public class MetricsBean {
public static class Metric {
private int feedsRefreshed;
private int feedsUpdated;
private int entriesInserted;
public int getFeedsRefreshed() {
return feedsRefreshed;
@@ -66,5 +70,13 @@ public class MetricsBean {
this.feedsUpdated = feedsUpdated;
}
public int getEntriesInserted() {
return entriesInserted;
}
public void setEntriesInserted(int entriesInserted) {
this.entriesInserted = entriesInserted;
}
}
}

View File

@@ -95,7 +95,7 @@ public class FeedUpdateService {
feedEntryDAO.saveOrUpdate(entryUpdateList);
feedEntryStatusDAO.saveOrUpdate(statusUpdateList);
metricsBean.feedUpdated();
metricsBean.feedUpdated(entryUpdateList.size());
}
private FeedEntry findEntry(List<FeedEntry> existingEntries, FeedEntry entry) {