more metrics

This commit is contained in:
Athou
2013-05-18 17:50:38 +02:00
parent 18cc08d7ad
commit f4d6ebda63
2 changed files with 15 additions and 2 deletions

View File

@@ -33,12 +33,15 @@ public class MetricsBean {
thisHour.feedsRefreshed++;
}
public void feedUpdated(int entriesCount) {
public void feedUpdated(int entriesCount, int statusesCount) {
thisHour.feedsUpdated++;
thisMinute.feedsUpdated++;
thisHour.entriesInserted += entriesCount;
thisMinute.entriesInserted += entriesCount;
thisHour.statusesInserted += statusesCount;
thisMinute.statusesInserted += statusesCount;
}
public Metric getLastMinute() {
@@ -53,6 +56,7 @@ public class MetricsBean {
private int feedsRefreshed;
private int feedsUpdated;
private int entriesInserted;
private int statusesInserted;
public int getFeedsRefreshed() {
return feedsRefreshed;
@@ -78,5 +82,13 @@ public class MetricsBean {
this.entriesInserted = entriesInserted;
}
public int getStatusesInserted() {
return statusesInserted;
}
public void setStatusesInserted(int statusesInserted) {
this.statusesInserted = statusesInserted;
}
}
}

View File

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