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

Commit

Permalink
Some consistency changes -> Eliminate package name from controller name.
Browse files Browse the repository at this point in the history
  • Loading branch information
mtho11 committed Sep 10, 2015
1 parent 32a76a6 commit d8cca4f
Show file tree
Hide file tree
Showing 14 changed files with 34 additions and 39 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<div class="hk-screen-content" ng-controller="HawkularMetrics.AppServerDetailsController as tabs">
<div class="hk-screen-content" ng-controller="AppServerDetailsController as tabs">

<hawkular-sidebar ng-controller="Sidebar.SidebarController">
<div class="hk-nav-tabs-container">
Expand All @@ -14,4 +14,4 @@

<ng-include ng-repeat="tab in tabs.availableTabs" src="tab.src" ng-if="tabs.activeTab === tab.id" ng-controller="tab.controller"></ng-include>

</div>
</div>
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<div class="hk-application-servers" ng-controller="HawkularMetrics.AppServerListController as vm">
<div class="hk-application-servers" ng-controller="AppServerListController as vm">

<div class="text-center hk-urls-list hk-spinner-container" ng-hide="vm.resourceList">
<div class="spinner spinner-lg"></div>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<div ng-controller="HawkularMetrics.UrlListController as vm">
<div ng-controller="UrlListController as vm">
<div class="text-center hk-urls-list hk-spinner-container" ng-hide="vm.resourceList">
<div class="spinner spinner-lg"></div>
<p class="hk-spinner-legend-below">Loading...</p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,5 @@ module HawkularMetrics {
export class AppServerAlertsDetailsController {
}

_module.controller('HawkularMetrics.AppServerAlertsDetailsController', AppServerAlertsDetailsController);
_module.controller('AppServerAlertsDetailsController', AppServerAlertsDetailsController);
}
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ module HawkularMetrics {

private autoRefreshPromise: ng.IPromise<number>;
private resourceList;
private expandedList;
///private expandedList;
public alertList;
public chartAvailData;
public chartRespData;
Expand Down Expand Up @@ -69,7 +69,7 @@ module HawkularMetrics {
if ($rootScope.currentPersona) {
this.getDatasources(this.$rootScope.currentPersona.id);
} else {
// currentPersona hasn't been injected to the rootScope yet, wait for it..
/// currentPersona hasn't been injected to the rootScope yet, wait for it..
$rootScope.$watch('currentPersona', (currentPersona) => currentPersona &&
this.getDatasources(currentPersona.id));
}
Expand Down Expand Up @@ -114,7 +114,7 @@ module HawkularMetrics {
// Datasource connection trigger exists, nothing to do
this.$log.debug('Datasource connection trigger exists, nothing to do');
}, () => {
// Datasource connection trigger doesn't exist, need to create one
/// Datasource connection trigger doesn't exist, need to create one

var triggerId:string = resId + '_ds_conn';
var dataId:string = 'MI~R~[' + resId + ']~MT~Datasource Pool Metrics~Available Count';
Expand All @@ -133,10 +133,10 @@ module HawkularMetrics {
});

var respTriggerPromise = this.HawkularAlertsManager.getTrigger(resId + '_ds_resp').then(() => {
// Datasource responsiveness trigger exists, nothing to do
/// Datasource responsiveness trigger exists, nothing to do
this.$log.debug('Datasource responsiveness trigger exists, nothing to do');
}, () => {
// Datasource responsiveness trigger doesn't exist, need to create one
/// Datasource responsiveness trigger doesn't exist, need to create one
var triggerId:string = resId + '_ds_resp';
var dataId:string = 'MI~R~[' + resId + ']~MT~Datasource Pool Metrics~Average Get Time';

Expand Down Expand Up @@ -171,13 +171,13 @@ module HawkularMetrics {
templateUrl: 'plugins/metrics/html/modals/alerts-ds-setup.html',
controller: 'DatasourcesAlertSetupController as das',
resolve: {
resourceId: function () {
resourceId: () => {
return resId;
}
}
});

modalInstance.result.then(angular.noop, function () {
modalInstance.result.then(angular.noop, () => {
log.debug('Datasource Alert Setup modal dismissed at: ' + new Date());
});
}, () => {
Expand Down Expand Up @@ -221,29 +221,30 @@ module HawkularMetrics {
var tenantId:TenantId = currentTenantId || this.$rootScope.currentPersona.id;
var idParts = this.$routeParams.resourceId.split('~');
var feedId = idParts[0];

this.HawkularInventory.ResourceOfTypeUnderFeed.query({
environmentId: globalEnvironmentId,
feedId: feedId,
resourceTypeId: 'Datasource'}, (aResourceList, getResponseHeaders) => {
var promises = [];
var tmpResourceList = [];
angular.forEach(aResourceList, function(res, idx) {
angular.forEach(aResourceList, (res:any) => {
if (res.id.startsWith(new RegExp(this.$routeParams.resourceId + '~/'))) {
tmpResourceList.push(res);
promises.push(this.HawkularMetric.GaugeMetricData(this.$rootScope.currentPersona.id).queryMetrics({
promises.push(this.HawkularMetric.GaugeMetricData(tenantId).queryMetrics({
gaugeId: 'MI~R~[' + res.id + ']~MT~Datasource Pool Metrics~Available Count',
distinct: true}, (data) => {
res.availableCount = data[0];
}).$promise);
promises.push(this.HawkularMetric.GaugeMetricData(this.$rootScope.currentPersona.id).queryMetrics({
promises.push(this.HawkularMetric.GaugeMetricData(tenantId).queryMetrics({
gaugeId: 'MI~R~[' + res.id + ']~MT~Datasource Pool Metrics~In Use Count',
distinct: true}, (data) => {
res.inUseCount = data[0];
}).$promise);
this.getAlerts(res.id, this.startTimeStamp, this.endTimeStamp, res);
}
}, this);
this.$q.all(promises).then((result) => {
this.$q.all(promises).then(() => {
this.resourceList = tmpResourceList;
this.resourceList.$resolved = true;
this.getDatasourceChartData();
Expand All @@ -264,7 +265,7 @@ module HawkularMetrics {

var tenantId:TenantId = currentTenantId || this.$rootScope.currentPersona.id;
angular.forEach(this.resourceList, function(res, idx) {
this.HawkularMetric.GaugeMetricData(this.$rootScope.currentPersona.id).queryMetrics({
this.HawkularMetric.GaugeMetricData(tenantId).queryMetrics({
gaugeId: 'MI~R~[' + res.id + ']~MT~Datasource Pool Metrics~Available Count',
start: this.startTimeStamp,
end: this.endTimeStamp, buckets:60}, (data) => {
Expand All @@ -273,7 +274,7 @@ module HawkularMetrics {
color: AppServerDatasourcesDetailsController.AVAILABLE_COLOR,
values: this.formatBucketedChartOutput(data) };
}, this);
this.HawkularMetric.GaugeMetricData(this.$rootScope.currentPersona.id).queryMetrics({
this.HawkularMetric.GaugeMetricData(tenantId).queryMetrics({
gaugeId: 'MI~R~[' + res.id + ']~MT~Datasource Pool Metrics~In Use Count',
start: this.startTimeStamp,
end: this.endTimeStamp, buckets:60}, (data) => {
Expand All @@ -282,7 +283,7 @@ module HawkularMetrics {
color: AppServerDatasourcesDetailsController.IN_USE_COLOR,
values: this.formatBucketedChartOutput(data) };
}, this);
this.HawkularMetric.GaugeMetricData(this.$rootScope.currentPersona.id).queryMetrics({
this.HawkularMetric.GaugeMetricData(tenantId).queryMetrics({
gaugeId: 'MI~R~[' + res.id + ']~MT~Datasource Pool Metrics~Timed Out',
start: this.startTimeStamp,
end: this.endTimeStamp, buckets:60}, (data) => {
Expand All @@ -292,7 +293,7 @@ module HawkularMetrics {
values: this.formatBucketedChartOutput(data) };
}, this);

this.HawkularMetric.GaugeMetricData(this.$rootScope.currentPersona.id).queryMetrics({
this.HawkularMetric.GaugeMetricData(tenantId).queryMetrics({
gaugeId: 'MI~R~[' + res.id + ']~MT~Datasource Pool Metrics~Average Get Time',
start: this.startTimeStamp,
end: this.endTimeStamp, buckets:60}, (data) => {
Expand All @@ -301,7 +302,7 @@ module HawkularMetrics {
color: AppServerDatasourcesDetailsController.WAIT_COLOR,
values: this.formatBucketedChartOutput(data) };
}, this);
this.HawkularMetric.GaugeMetricData(this.$rootScope.currentPersona.id).queryMetrics({
this.HawkularMetric.GaugeMetricData(tenantId).queryMetrics({
gaugeId: 'MI~R~[' + res.id + ']~MT~Datasource Pool Metrics~Average Creation Time',
start: this.startTimeStamp,
end: this.endTimeStamp, buckets:60}, (data) => {
Expand All @@ -315,10 +316,7 @@ module HawkularMetrics {
}





}

_module.controller('HawkularMetrics.AppServerDatasourcesDetailsController', AppServerDatasourcesDetailsController);
_module.controller('AppServerDatasourcesDetailsController', AppServerDatasourcesDetailsController);
}
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ module HawkularMetrics {
resourceTypeId: 'Deployment'}, (aResourceList, getResponseHeaders) => {
let promises = [];
let tmpResourceList = [];
angular.forEach(aResourceList, function(res: any) {
angular.forEach(aResourceList, (res: any) => {
if (res.id.startsWith(new RegExp(this.$routeParams.resourceId + '~/'))) {
tmpResourceList.push(res);
res.selected = _.result(_.find(this.resourceList, {'id': res.id}), 'selected');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,5 @@ module HawkularMetrics {
export class AppServerJmsDetailsController {
}

_module.controller('HawkularMetrics.AppServerJmsDetailsController', AppServerJmsDetailsController);
_module.controller('AppServerJmsDetailsController', AppServerJmsDetailsController);
}
Original file line number Diff line number Diff line change
Expand Up @@ -149,13 +149,13 @@ module HawkularMetrics {
templateUrl: 'plugins/metrics/html/modals/alerts-jvm-setup.html',
controller: 'JvmAlertSetupController as jas',
resolve: {
resourceId: function () {
resourceId: () => {
return this.resourceId;
}
}
});

modalInstance.result.then(angular.noop, function () {
modalInstance.result.then(angular.noop, () => {
log.debug('Jvm Alert Setup modal dismissed at: ' + new Date());
});
}, () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ module HawkularMetrics {
var step = this.$window.Math.floor(response.length / buckets);
result = [];
var accValue = 0;
_.forEach(response, function(point:any, idx) {
_.forEach(response, (point:any, idx) => {
if (parseInt(idx, 10) % step === (step-1)) {
result.push({timestamp: point.timestamp, value: accValue });
accValue = 0;
Expand Down Expand Up @@ -194,7 +194,6 @@ module HawkularMetrics {
start: this.startTimeStamp,
end: this.endTimeStamp,
buckets: 1}, (resource) => {
console.log('!!! heap used', resource);
if (resource.length) {
this['heapUsage'] = resource[0];
}
Expand All @@ -204,7 +203,6 @@ module HawkularMetrics {
start: this.startTimeStamp,
end: this.endTimeStamp,
buckets: 1}, (resource) => {
console.log('!!! heap max', resource);
if (resource.length) {
this['heapMax'] = resource[0];
AppServerJvmDetailsController.MAX_HEAP = resource[0].max;
Expand All @@ -215,7 +213,6 @@ module HawkularMetrics {
start: this.startTimeStamp,
end: this.endTimeStamp,
buckets: 1}, (resource) => {
console.log('!!! GC', resource);
if (resource.length) {
this['accGCDuration'] = resource[0].value - resource[resource.length-1].value;
this.chartGCDurationData = this.formatCounterChartOutput(resource);
Expand Down Expand Up @@ -268,6 +265,6 @@ module HawkularMetrics {
}
}

_module.controller('HawkularMetrics.AppServerJvmDetailsController', AppServerJvmDetailsController);
_module.controller('AppServerJvmDetailsController', AppServerJvmDetailsController);

}
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,5 @@ module HawkularMetrics {
export class AppServerTransactionsDetailsController {
}

_module.controller('HawkularMetrics.AppServerTransactionsDetailsController', AppServerTransactionsDetailsController);
_module.controller('AppServerTransactionsDetailsController', AppServerTransactionsDetailsController);
}
Original file line number Diff line number Diff line change
Expand Up @@ -235,5 +235,5 @@ module HawkularMetrics {
}


_module.controller('HawkularMetrics.AppServerWebDetailsController', AppServerWebDetailsController);
_module.controller('AppServerWebDetailsController', AppServerWebDetailsController);
}
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,6 @@ module HawkularMetrics {

}

_module.controller('HawkularMetrics.AppServerDetailsController', AppServerDetailsController);
_module.controller('AppServerDetailsController', AppServerDetailsController);

}
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,6 @@ module HawkularMetrics {

}

_module.controller('HawkularMetrics.AppServerListController', AppServerListController);
_module.controller('AppServerListController', AppServerListController);

}
2 changes: 1 addition & 1 deletion console/src/main/scripts/plugins/metrics/ts/urlList.ts
Original file line number Diff line number Diff line change
Expand Up @@ -354,6 +354,6 @@ module HawkularMetrics {
}

}
_module.controller('HawkularMetrics.UrlListController', UrlListController);
_module.controller('UrlListController', UrlListController);

}

0 comments on commit d8cca4f

Please sign in to comment.