You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@usergrid.apache.org by mr...@apache.org on 2016/04/13 16:08:31 UTC
usergrid git commit: Set a processingFinished timestamp so we can
tell how long it takes to queue up push notifications for a particular query.
Repository: usergrid
Updated Branches:
refs/heads/release-2.1.1 112748010 -> 8c0338cf6
Set a processingFinished timestamp so we can tell how long it takes to queue up push notifications for a particular query.
Project: http://git-wip-us.apache.org/repos/asf/usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/usergrid/commit/8c0338cf
Tree: http://git-wip-us.apache.org/repos/asf/usergrid/tree/8c0338cf
Diff: http://git-wip-us.apache.org/repos/asf/usergrid/diff/8c0338cf
Branch: refs/heads/release-2.1.1
Commit: 8c0338cf664778f41b04ad46805eaecffea84852
Parents: 1127480
Author: Michael Russo <mr...@apigee.com>
Authored: Wed Apr 13 16:08:25 2016 +0200
Committer: Michael Russo <mr...@apigee.com>
Committed: Wed Apr 13 16:08:25 2016 +0200
----------------------------------------------------------------------
.../usergrid/persistence/entities/Notification.java | 13 +++++++++++++
.../impl/ApplicationQueueManagerImpl.java | 10 ++++++++++
2 files changed, 23 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/usergrid/blob/8c0338cf/stack/core/src/main/java/org/apache/usergrid/persistence/entities/Notification.java
----------------------------------------------------------------------
diff --git a/stack/core/src/main/java/org/apache/usergrid/persistence/entities/Notification.java b/stack/core/src/main/java/org/apache/usergrid/persistence/entities/Notification.java
index dc7c989..1350593 100644
--- a/stack/core/src/main/java/org/apache/usergrid/persistence/entities/Notification.java
+++ b/stack/core/src/main/java/org/apache/usergrid/persistence/entities/Notification.java
@@ -57,6 +57,10 @@ public class Notification extends TypedEntity {
@EntityProperty
protected Long queued;
+ /** Timestamp (ms) when the notification was processed */
+ @EntityProperty
+ protected Long processingFinished;
+
/** Timestamp (ms) when send notification started */
@EntityProperty
protected Long started;
@@ -138,6 +142,15 @@ public class Notification extends TypedEntity {
}
@JsonSerialize(include = JsonSerialize.Inclusion.NON_NULL)
+ public Long getProcessingFinished() {
+ return processingFinished;
+ }
+
+ public void setProcessingFinished(Long processingFinished) {
+ this.processingFinished = processingFinished;
+ }
+
+ @JsonSerialize(include = JsonSerialize.Inclusion.NON_NULL)
public Long getDeliver() {
return deliver;
}
http://git-wip-us.apache.org/repos/asf/usergrid/blob/8c0338cf/stack/services/src/main/java/org/apache/usergrid/services/notifications/impl/ApplicationQueueManagerImpl.java
----------------------------------------------------------------------
diff --git a/stack/services/src/main/java/org/apache/usergrid/services/notifications/impl/ApplicationQueueManagerImpl.java b/stack/services/src/main/java/org/apache/usergrid/services/notifications/impl/ApplicationQueueManagerImpl.java
index f819e39..0b0432d 100644
--- a/stack/services/src/main/java/org/apache/usergrid/services/notifications/impl/ApplicationQueueManagerImpl.java
+++ b/stack/services/src/main/java/org/apache/usergrid/services/notifications/impl/ApplicationQueueManagerImpl.java
@@ -204,6 +204,16 @@ public class ApplicationQueueManagerImpl implements ApplicationQueueManager {
})
+ .doOnCompleted( () -> {
+
+ try {
+ notification.setProcessingFinished(System.currentTimeMillis());
+ em.update(notification);
+ } catch (Exception e) {
+ logger.error("Unable to set processing finished timestamp for notification");
+ }
+
+ })
.doOnError(throwable -> logger.error("Failed while trying to send notification", throwable));
//TODO verify error handling here