Skip to content
This repository has been archived by the owner on Nov 9, 2017. It is now read-only.

Commit

Permalink
Merge pull request #855 from jshaughn/hawkular-1040-2
Browse files Browse the repository at this point in the history
HAWKULAR-1040 use actual URL now that we have it
  • Loading branch information
jpkrohling committed Feb 16, 2016
2 parents 3a70a6c + 85d177e commit 23710d6
Showing 1 changed file with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -696,18 +696,21 @@ private void handleResourceEvent(ResourceEvent event) {
}
case "URL": {
// common to members
// TODO: use the URL as needed, not the hash if and when we can get the actual URL from the event
String resourceId = r.getId();
String url = resourceId; // use this as a default but the url should be there
if (null != r.getProperties() && null != r.getProperties().get("url")) {
url = (String) r.getProperties().get("url");
}
Map<String, String> memberContext = new HashMap<>(2);
memberContext.put("resourceName", "URL [" + resourceId + "]"); // Should be the URL
memberContext.put("resourceName", "URL [" + url + "]");
memberContext.put("resourcePath", event.getHeaders().get("path"));
Map<String, String> memberTags = new HashMap<>(1);
memberTags.put("resourceId", resourceId);

// Response Time
String groupTriggerId = "URL_Response";
String memberId = groupTriggerId + "_" + resourceId;
String memberDescription = "Response Time for URL [" + resourceId + "]"; // should be the URL
String memberDescription = "Response Time for URL [" + url + "]";
Map<String, String> dataIdMap = new HashMap<>(2);
String dataId1 = "status.duration";
String memberDataId1 = resourceId + ".status.duration";
Expand All @@ -720,7 +723,7 @@ private void handleResourceEvent(ResourceEvent event) {
// Avail
groupTriggerId = "URL_Down";
memberId = groupTriggerId + "_" + resourceId;
memberDescription = "Availability for URL [" + resourceId + "]"; // Should be the URL
memberDescription = "Availability for URL [" + url + "]";
dataIdMap.clear();
dataId1 = "status.code";
memberDataId1 = resourceId + ".status.code";
Expand Down

0 comments on commit 23710d6

Please sign in to comment.