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

Commit

Permalink
Update to Agent 0.13.7.Final and fix UI IDs usage
Browse files Browse the repository at this point in the history
  • Loading branch information
ammendonca committed Dec 3, 2015
1 parent 83e06af commit 3251995
Show file tree
Hide file tree
Showing 17 changed files with 112 additions and 120 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<div class="hk-nav-tabs-container">
<ul class="nav nav-tabs nav-tabs-pf">
<li class="active"><a href="/hawkular-ui/alerts-center/{{hkParams.timeOffset}}" class="hk-alerts">Alerts</a></li>
<li><a href="/hawkular-ui/alerts-center-triggers" class="hk-availability">Definitions</a></li>
<li><a href="/hawkular-ui/alerts-center-triggers/" class="hk-availability">Definitions</a></li>
</ul>
</div>
</hawkular-subtab>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ <h3>Deployments</h3>
</div>
<div class="col-lg-3">
<hk-alert-info list="vm.alertList" limit="(vm.showAllAlerts ? 100000 : 3)"
resource-id="vm.$routeParams.resourceId" title="Deployments">
resource-id="vm.$routeParams.feedId + '/' + vm.$routeParams.resourceId" title="Deployments">
</hk-alert-info>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ <h2>GC Duration</h2>

<div class="col-lg-3">
<hk-alert-info list="vm.alertList" limit="(vm.showAllAlerts ? 100000 : 3)"
resource-id="vm.$routeParams.resourceId" title="JVM">
resource-id="vm.$routeParams.feedId + '/' + vm.$routeParams.resourceId" title="JVM">
</hk-alert-info>
</div>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ <h1>No application servers set up.</h1>
{{res.state | firstUpper}}
</td>
<td>
<a href="/hawkular-ui/app/app-details/{{res.id | limitTo : res.id.length-2}}/jvm/{{hkParams.timeOffset}}">
<a href="/hawkular-ui/app/app-details/{{res.feedId}}/{{res.id | limitTo : res.id.length-2}}/jvm/{{hkParams.timeOffset}}">
{{res.id | limitTo : res.id.length-2}}
</a>
<a href="/hawkular-ui/app/app-details/{{res.id}}/jvm/{{hkParams.timeOffset}}" class="pull-right">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,9 +124,10 @@ module HawkularMetrics {
}

public showDetailPage(alertId:AlertId):void {
let timeOffset = this.alertsTimeOffset;
let endTime = this.alertsTimeEnd;
this.$location.url(`/hawkular-ui/alerts-center-detail/${alertId}/${timeOffset}/${endTime}`);
//let timeOffset = this.alertsTimeOffset;
//let endTime = this.alertsTimeEnd;
//this.$location.url(`/hawkular-ui/alerts-center-detail/${alertId}/${timeOffset}/${endTime}`);
this.$location.url(`/hawkular-ui/alerts-center-detail/${alertId}`);
}

public resolveSelected():void {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -189,19 +189,19 @@ module HawkularMetrics {

switch (trigger.context.triggerType) {
case 'Availability' :
route = '/hawkular-ui/alerts-center-triggers/availability/' + encodedId;
route = '/hawkular-ui/alerts-center-triggers-availability/' + encodedId;
break;
case 'Event' :
route = '/hawkular-ui/alerts-center-triggers/event/' + encodedId;
route = '/hawkular-ui/alerts-center-triggers-event/' + encodedId;
break;
case 'Range' :
route = '/hawkular-ui/alerts-center-triggers/range/' + encodedId;
route = '/hawkular-ui/alerts-center-triggers-range/' + encodedId;
break;
case 'RangeByPercent' :
route = '/hawkular-ui/alerts-center-triggers/range-percent/' + encodedId;
route = '/hawkular-ui/alerts-center-triggers-range-percent/' + encodedId;
break;
case 'Threshold' :
route = '/hawkular-ui/alerts-center-triggers/threshold/' + encodedId;
route = '/hawkular-ui/alerts-center-triggers-threshold/' + encodedId;
break;
}

Expand Down Expand Up @@ -234,8 +234,7 @@ module HawkularMetrics {
return route;
}

public
setPage(page:number):void {
public setPage(page:number):void {
this.triggersCurPage = page;
this.getTriggers();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@ module HawkularMetrics {
public startTimeStamp:TimestampInMillis;
public endTimeStamp:TimestampInMillis;

private feedId: FeedId;
private resourceId: ResourceId;

constructor(private $scope:any,
private $rootScope:IHawkularRootScope,
private $routeParams:any,
Expand All @@ -66,6 +69,9 @@ module HawkularMetrics {
private $modal:any) {
$scope.vm = this;

this.feedId = this.$routeParams.feedId;
this.resourceId = this.$routeParams.resourceId + '~~';

this.startTimeStamp = +moment().subtract(($routeParams.timeOffset || 3600000), 'milliseconds');
this.endTimeStamp = +moment();
this.chartAvailData = {};
Expand Down Expand Up @@ -182,16 +188,16 @@ module HawkularMetrics {

angular.forEach(resourceLists, (aResourceList) => {
angular.forEach(aResourceList, (res:IResource) => {
if (res.id.startsWith(new RegExp(this.$routeParams.resourceId + '~/'))) {
if (res.id.startsWith(this.$routeParams.resourceId + '~/')) {
tmpResourceList.push(res);
promises.push(this.HawkularMetric.GaugeMetricData(tenantId).queryMetrics({
gaugeId: 'MI~R~[' + res.id + ']~MT~Datasource Pool Metrics~Available Count',
gaugeId: MetricsService.getMetricId('M', this.feedId, res.id, 'Datasource Pool Metrics~Available Count'),
distinct: true
}, (data:number[]) => {
res.availableCount = data[0];
}).$promise);
promises.push(this.HawkularMetric.GaugeMetricData(tenantId).queryMetrics({
gaugeId: 'MI~R~[' + res.id + ']~MT~Datasource Pool Metrics~In Use Count',
gaugeId: MetricsService.getMetricId('M', this.feedId, res.id, 'Datasource Pool Metrics~In Use Count'),
distinct: true
}, (data:number[]) => {
res.inUseCount = data[0];
Expand All @@ -217,18 +223,13 @@ module HawkularMetrics {
this.endTimeStamp = this.$routeParams.endTime || +moment();
this.startTimeStamp = this.endTimeStamp - (this.$routeParams.timeOffset || 3600000);

let idParts = this.$routeParams.resourceId.split('~');
let feedId = idParts[0];

let xaDSsPromise = this.HawkularInventory.ResourceOfTypeUnderFeed.query({
environmentId: globalEnvironmentId,
feedId: feedId,
feedId: this.$routeParams.feedId,
resourceTypeId: 'XA Datasource'
}).$promise;

let nonXaDSsPromise = this.HawkularInventory.ResourceOfTypeUnderFeed.query({
environmentId: globalEnvironmentId,
feedId: feedId,
feedId: this.$routeParams.feedId,
resourceTypeId: 'Datasource'
}).$promise;

Expand Down Expand Up @@ -257,7 +258,7 @@ module HawkularMetrics {

public getDrivers(currentTenantId?:TenantId):void {
this.HawkularInventory.ResourceOfTypeUnderFeed.query({
environmentId: globalEnvironmentId, feedId: this.$routeParams.resourceId.split('~')[0],
feedId: this.$routeParams.feedId,
resourceTypeId: 'JDBC Driver'
}, (aResourceList, getResponseHeaders) => {
this.driversList = aResourceList;
Expand All @@ -284,7 +285,7 @@ module HawkularMetrics {

if (!this.skipChartData[res.id + '_Available Count']) {
let dsAvailPromise = this.MetricsService.retrieveGaugeMetrics(this.$rootScope.currentPersona.id,
'MI~R~[' + res.id + ']~MT~Datasource Pool Metrics~Available Count',
MetricsService.getMetricId('M', this.feedId, res.id, 'Datasource Pool Metrics~Available Count'),
this.startTimeStamp, this.endTimeStamp, 60);
availPromises.push(dsAvailPromise);
dsAvailPromise.then((data) => {
Expand All @@ -298,7 +299,7 @@ module HawkularMetrics {
}
if (!this.skipChartData[res.id + '_In Use Count']) {
let dsInUsePromise = this.MetricsService.retrieveGaugeMetrics(this.$rootScope.currentPersona.id,
'MI~R~[' + res.id + ']~MT~Datasource Pool Metrics~In Use Count',
MetricsService.getMetricId('M', this.feedId, res.id, 'Datasource Pool Metrics~In Use Count'),
this.startTimeStamp, this.endTimeStamp, 60);
availPromises.push(dsInUsePromise);
dsInUsePromise.then((data:number[]) => {
Expand All @@ -312,7 +313,7 @@ module HawkularMetrics {
}
if (!this.skipChartData[res.id + '_Timed Out']) {
let dsTimedPromise = this.MetricsService.retrieveGaugeMetrics(this.$rootScope.currentPersona.id,
'MI~R~[' + res.id + ']~MT~Datasource Pool Metrics~Timed Out',
MetricsService.getMetricId('M', this.feedId, res.id, 'Datasource Pool Metrics~Timed Out'),
this.startTimeStamp, this.endTimeStamp, 60);
availPromises.push(dsTimedPromise);
dsTimedPromise.then((data) => {
Expand All @@ -331,7 +332,7 @@ module HawkularMetrics {

if (!this.skipChartData[res.id + '_Average Get Time']) {
let dsWTimePromise = this.MetricsService.retrieveGaugeMetrics(this.$rootScope.currentPersona.id,
'MI~R~[' + res.id + ']~MT~Datasource Pool Metrics~Average Get Time',
MetricsService.getMetricId('M', this.feedId, res.id, 'Datasource Pool Metrics~Average Get Time'),
this.startTimeStamp, this.endTimeStamp, 60);
respPromises.push(dsWTimePromise);
dsWTimePromise.then((data) => {
Expand All @@ -345,7 +346,7 @@ module HawkularMetrics {
}
if (!this.skipChartData[res.id + '_Average Creation Time']) {
let dsCTimePromise = this.MetricsService.retrieveGaugeMetrics(this.$rootScope.currentPersona.id,
'MI~R~[' + res.id + ']~MT~Datasource Pool Metrics~Average Creation Time',
MetricsService.getMetricId('M', this.feedId, res.id, 'Datasource Pool Metrics~Average Creation Time'),
this.startTimeStamp, this.endTimeStamp, 60);
respPromises.push(dsCTimePromise);
dsCTimePromise.then((data) => {
Expand All @@ -370,11 +371,9 @@ module HawkularMetrics {
}

public loadTriggers(currentTenantId?:TenantId):any {
let tenantId:TenantId = currentTenantId || this.$rootScope.currentPersona.id;

_.forEach(this.resourceList, function (res:IResource, idx) {

this.loadDatasourceTriggers(res.id);
this.loadDatasourceTriggers(this.feedId + '/' + res.id);

}, this);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,23 +137,21 @@ module HawkularMetrics {

public getResourceList(currentTenantId?:TenantId):void {
let tenantId:TenantId = currentTenantId || this.$rootScope.currentPersona.id;
let resourceId:string = this.$routeParams.resourceId;
let idParts = resourceId.split('~');
let feedId = idParts[0];
this.HawkularInventory.ResourceOfTypeUnderFeed.query({
environmentId: globalEnvironmentId,
feedId: feedId,
feedId: this.$routeParams.feedId,
resourceTypeId: 'Deployment'
}, (aResourceList:IResource[], getResponseHeaders) => {
let promises = [];
let tmpResourceList = [];
_.forEach(aResourceList, (res:IResource) => {
if (res.id.startsWith(new RegExp(resourceId + '~/'))) {
if (res.id.startsWith(this.$routeParams.resourceId + '~/')) {
tmpResourceList.push(res);
res.feedId = this.$routeParams.feedId;
res.selected = _.result(_.find(this.resourceList, {'id': res.id}), 'selected');
promises.push(this.HawkularMetric.AvailabilityMetricData(this.$rootScope.currentPersona.id).query({
tenantId: tenantId,
availabilityId: 'AI~R~[' + res.id + ']~AT~Deployment Status~Deployment Status',
availabilityId: MetricsService.getMetricId('A', res.feedId, res.id,
'Deployment Status~Deployment Status'),
distinct: true
}, (availResource:IAvailResource[]) => {
let latestData = _.last(availResource);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@ module HawkularMetrics {
// will contain in the format: 'metric name' : true | false
public skipChartData = {};

private feedId: FeedId;
private resourceId: ResourceId;

constructor(private $scope:any,
private $rootScope:IHawkularRootScope,
private $interval:ng.IIntervalService,
Expand All @@ -61,6 +64,9 @@ module HawkularMetrics {
private $q:ng.IQService ) {
$scope.vm = this;

this.feedId = this.$routeParams.feedId;
this.resourceId = this.$routeParams.resourceId + '~~';

this.startTimeStamp = +moment().subtract(($routeParams.timeOffset || 3600000), 'milliseconds');
this.endTimeStamp = +moment();
this.chartHeapData = [];
Expand Down Expand Up @@ -134,22 +140,22 @@ module HawkularMetrics {

public getJvmData():void {
this.MetricsService.retrieveGaugeMetrics(this.$rootScope.currentPersona.id,
'MI~R~[' + this.$routeParams.resourceId + '~~]~MT~WildFly Memory Metrics~Heap Used',
MetricsService.getMetricId('M', this.feedId, this.resourceId, 'WildFly Memory Metrics~Heap Used'),
this.startTimeStamp, this.endTimeStamp, 1).then((resource) => {
if (resource.length) {
this['heapUsage'] = resource[0];
}
});
this.MetricsService.retrieveGaugeMetrics(this.$rootScope.currentPersona.id,
'MI~R~[' + this.$routeParams.resourceId + '~~]~MT~WildFly Memory Metrics~Heap Max',
MetricsService.getMetricId('M', this.feedId, this.resourceId, 'WildFly Memory Metrics~Heap Max'),
this.startTimeStamp, this.endTimeStamp, 1).then((resource) => {
if (resource.length) {
this['heapMax'] = resource[0];
AppServerJvmDetailsController.MAX_HEAP = resource[0].max;
}
});
this.MetricsService.retrieveCounterMetrics(this.$rootScope.currentPersona.id,
'MI~R~[' + this.$routeParams.resourceId + '~~]~MT~WildFly Memory Metrics~Accumulated GC Duration',
MetricsService.getMetricId('M', this.feedId, this.resourceId, 'WildFly Memory Metrics~Accumulated GC Duration'),
this.startTimeStamp, this.endTimeStamp, 1).then((resource) => {
if (resource.length) {
this['accGCDuration'] = (resource[0].max - resource[0].min);
Expand All @@ -167,7 +173,7 @@ module HawkularMetrics {

if (!this.skipChartData['Heap Committed']) {
let hCommPromise = this.MetricsService.retrieveGaugeMetrics(this.$rootScope.currentPersona.id,
'MI~R~[' + resourceId + '~~]~MT~WildFly Memory Metrics~Heap Committed',
MetricsService.getMetricId('M', this.feedId, this.resourceId, 'WildFly Memory Metrics~Heap Committed'),
this.startTimeStamp, this.endTimeStamp,60);
heapPromises.push(hCommPromise);
hCommPromise.then((data) => {
Expand All @@ -180,7 +186,7 @@ module HawkularMetrics {
}
if (!this.skipChartData['Heap Used']) {
let hUsedPromise = this.MetricsService.retrieveGaugeMetrics(this.$rootScope.currentPersona.id,
'MI~R~[' + resourceId + '~~]~MT~WildFly Memory Metrics~Heap Used',
MetricsService.getMetricId('M', this.feedId, this.resourceId, 'WildFly Memory Metrics~Heap Used'),
this.startTimeStamp, this.endTimeStamp, 60);
heapPromises.push(hUsedPromise);
hUsedPromise.then((data) => {
Expand All @@ -193,7 +199,7 @@ module HawkularMetrics {
}
if (!this.skipChartData['Heap Max']) {
let hMaxPromise = this.MetricsService.retrieveGaugeMetrics(this.$rootScope.currentPersona.id,
'MI~R~[' + resourceId + '~~]~MT~WildFly Memory Metrics~Heap Max',
MetricsService.getMetricId('M', this.feedId, this.resourceId, 'WildFly Memory Metrics~Heap Max'),
this.startTimeStamp, this.endTimeStamp, 60);
heapPromises.push(hMaxPromise);
hMaxPromise.then((data) => {
Expand All @@ -210,7 +216,7 @@ module HawkularMetrics {

if (!this.skipChartData['NonHeap Committed']) {
let nhCommPromise = this.MetricsService.retrieveGaugeMetrics(this.$rootScope.currentPersona.id,
'MI~R~[' + resourceId + '~~]~MT~WildFly Memory Metrics~NonHeap Committed',
MetricsService.getMetricId('M', this.feedId, this.resourceId, 'WildFly Memory Metrics~NonHeap Committed'),
this.startTimeStamp, this.endTimeStamp, 60);
nonHeapPromises.push(nhCommPromise);
nhCommPromise.then((data) => {
Expand All @@ -223,7 +229,7 @@ module HawkularMetrics {
}
if (!this.skipChartData['NonHeap Used']) {
let nhUsedPromise = this.MetricsService.retrieveGaugeMetrics(this.$rootScope.currentPersona.id,
'MI~R~[' + resourceId + '~~]~MT~WildFly Memory Metrics~NonHeap Used',
MetricsService.getMetricId('M', this.feedId, this.resourceId, 'WildFly Memory Metrics~NonHeap Used'),
this.startTimeStamp, this.endTimeStamp, 60);
nonHeapPromises.push(nhUsedPromise);
nhUsedPromise.then((data) => {
Expand All @@ -239,7 +245,7 @@ module HawkularMetrics {
});

this.MetricsService.retrieveCounterRateMetrics(this.$rootScope.currentPersona.id,
'MI~R~[' + resourceId + '~~]~MT~WildFly Memory Metrics~Accumulated GC Duration',
MetricsService.getMetricId('M', this.feedId, this.resourceId, 'WildFly Memory Metrics~Accumulated GC Duration'),
this.startTimeStamp, this.endTimeStamp, 60).then((resource) => {
if (resource.length) {
this.chartGCDurationData = MetricsService.formatBucketedChartOutput(resource);
Expand Down

0 comments on commit 3251995

Please sign in to comment.