You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@brooklyn.apache.org by he...@apache.org on 2021/11/09 12:46:30 UTC
[brooklyn-server] branch master updated: add 'created' field to
dashboard sensor
This is an automated email from the ASF dual-hosted git repository.
heneveld pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/brooklyn-server.git
The following commit(s) were added to refs/heads/master by this push:
new fc85253 add 'created' field to dashboard sensor
fc85253 is described below
commit fc852531a9e7161a91aea42657bf47f7b333ce9b
Author: Alex Heneveld <al...@cloudsoftcorp.com>
AuthorDate: Tue Nov 9 12:44:48 2021 +0000
add 'created' field to dashboard sensor
---
.../apache/brooklyn/core/effector/AddDeploySensorsInitializer.java | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/core/src/main/java/org/apache/brooklyn/core/effector/AddDeploySensorsInitializer.java b/core/src/main/java/org/apache/brooklyn/core/effector/AddDeploySensorsInitializer.java
index aae81f5..1e9d402 100644
--- a/core/src/main/java/org/apache/brooklyn/core/effector/AddDeploySensorsInitializer.java
+++ b/core/src/main/java/org/apache/brooklyn/core/effector/AddDeploySensorsInitializer.java
@@ -20,6 +20,7 @@ package org.apache.brooklyn.core.effector;
import com.google.common.collect.ImmutableMap;
import com.google.common.reflect.TypeToken;
+import java.time.Instant;
import org.apache.brooklyn.api.entity.EntityInitializer;
import org.apache.brooklyn.api.entity.EntityLocal;
import org.apache.brooklyn.api.mgmt.entitlement.EntitlementContext;
@@ -45,7 +46,10 @@ public class AddDeploySensorsInitializer implements EntityInitializer {
((EntityInternal) entity).getMutableEntityType().addSensor(sensor);
entity.sensors().set(sensor, ImmutableMap.of(
"user", entitlementContext != null ? entitlementContext.user() : "Unknown",
- "deploy_time", System.currentTimeMillis()
+
+ "created", Instant.now()
+ // previously used the below instead
+// "deploy_time", System.currentTimeMillis()
));
}