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

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into mazz/hawkular-483…
Browse files Browse the repository at this point in the history
…-execute-op
  • Loading branch information
ppalaga committed Jul 27, 2015
2 parents 84360df + 9e46402 commit 8839f10
Show file tree
Hide file tree
Showing 28 changed files with 463 additions and 266 deletions.
45 changes: 45 additions & 0 deletions console/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,51 @@
</filesets>
</configuration>

This comment has been minimized.

Copy link
@mtho11

mtho11 Jul 28, 2015

Member

Looks like this merge wasnt rebased first? It looks like every UI file was changed, so it makes it very difficult to see what actually changed.

This comment has been minimized.

Copy link
@ppalaga

ppalaga Jul 28, 2015

Author Contributor

I'd personally vote for rebasing before merging to master but: (1) I have the feeling that nobody does and I do not want the only one who does (because in the end, it is additional work) and (ii) in this specific case, I worked on the branch together with @jmazzitelli and I did not want to do something unexpected. In other words I do not find rebasing required nor common in hawkular but I am ready to support anybody who proposes that we should care more for the readability of the history.

This comment has been minimized.

Copy link
@mtho11

mtho11 Jul 28, 2015

Member

AFAIK the the rule has always been to rebase before merging.

</plugin>

<plugin>
<groupId>com.github.eirslett</groupId>
<artifactId>frontend-maven-plugin</artifactId>
<version>${node.maven.plugin.version}</version>

<configuration>
<workingDirectory>target/gulp-build/</workingDirectory>
</configuration>

<executions>
<execution>
<id>npm install</id>
<goals>
<goal>npm</goal>
</goals>
<phase>prepare-package</phase>
<configuration>
<arguments>install</arguments>
</configuration>
</execution>

<execution>
<id>bower install</id>
<goals>
<goal>bower</goal>
</goals>
<phase>prepare-package</phase>
<configuration>
<arguments>install</arguments>
</configuration>
</execution>

<execution>
<id>gulp build</id>
<goals>
<goal>gulp</goal>
</goals>
<phase>prepare-package</phase>
<configuration>
<arguments>build</arguments>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
Expand Down
2 changes: 1 addition & 1 deletion console/src/main/scripts/bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"angular-toastr": "1.4.1",
"bootstrap-select": "1.6",
"hawkular-charts": "~0.4.6",
"hawkular-ui-services": "0.5.2",
"hawkular-ui-services": "0.5.4",
"hawtio-core-navigation": "2.0.51",
"hawtio-core": "2.0.16",
"hawtio-template-cache": "2.0.3",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ <h3>Deployments</h3>
<td class="state" ng-show="res.state === 'down'"><i class="fa fa-square"></i> Stopped</td>
<td class="state" ng-show="res.state === 'unknown'"><i class="fa fa-times-circle-o"></i> Failed</td>
<td class="state" ng-hide="res.state"><i class="fa fa-chain-broken"></i> Unknown</td>
<td><strong>{{res.properties.name | limitTo14 : res.properties.name.length-13 : 12}}</strong> <span ng-show="false">({{res.properties.name | limitTo14 : res.properties.name.length-13 : 12}})</span> <span class="label label-danger label-alert pull-right" tooltip-trigger tooltip-placement="top" tooltip="Deployment alerts">{{res.alerts}}</span></td>
<td><strong>{{res.properties.name | limitTo : res.properties.name.length-13 : 12}}</strong> <span ng-show="false">({{res.properties.name | limitTo : res.properties.name.length-13 : 12}})</span> <span class="label label-danger label-alert pull-right" tooltip-trigger tooltip-placement="top" tooltip="Deployment alerts">{{res.alerts}}</span></td>
<td ng-show="true">Enabled</td>
<td ng-show="false">Disabled</td>
<td class="success" ng-show="true">Good</td>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ <h3 class="pull-left">JVM Status</h3>
<span class="hk-item">Average Heap Usage</span>
</div>
<div class="col-sm-3 hk-summary-item">
<span class="hk-data" ng-show="vm.garbageCollector">{{ vm.garbageCollector.gc / 1024 / 1024 | number : 0 }} s</span>
<span class="hk-data" ng-hide="vm.garbageCollector">n/a</span>
<span class="hk-item">Last Garbage Collection (Duration)</span>
<span class="hk-data" ng-show="vm.accGCDuration">{{ vm.accGCDuration }}ms</span>
<span class="hk-data" ng-hide="vm.accGCDuration">n/a</span>
<span class="hk-item">Accumulated GC Duration</span>
</div>
<div class="col-sm-3 hk-summary-item">
<span class="hk-data" ng-show="vm.heapMax">{{ vm.heapMax.max / 1024 / 1024 | number : 0 }} MB</span>
Expand Down Expand Up @@ -89,4 +89,21 @@ <h2>Non Heap Usage</h2>
</div>
</div>

</section>
<div class="panel panel-default hk-graph" ng-if="vm.chartNonHeapData[0]">
<h2>Accumulated GC Duration</h2>
<div class="metrics-chart">
<!-- HINT: colors for the chart can be changed in the hawkular-charts.css -->
<hawkular-chart
data="{{vm.chartGCDurationData}}"
chart-type="histogram"
alert-value="{{vm.threshold}}"
use-zero-min-value="true"
y-axis-units="GC Duration (ms)"
chart-height="250">
</hawkular-chart>
</div>
<div class="hk-legend text-left">
</div>
</div>

</section>
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ <h1>No application servers set up.</h1>
<p ng-hide="res.state"><span class="spinner spinner-sm spinner-inline"></span> <span class="fetching">Fetching state...</span></p>
{{res.state | firstUpper}}
</td>
<td><a href="/hawkular-ui/app/app-details/{{res.id | limitTo14 : res.id.length-4 : 1}}/jvm">{{res.id | limitTo14 : res.id.length-4 : 1}}</a> <a href="/hawkular-ui/app/app-details/{{res.id}}/jvm" class="pull-right"><span class="label label-danger label-alert" tooltip-trigger tooltip-placement="top" tooltip="Server alerts" ng-show="res.alerts.length > 0">{{res.alerts.length}}</span></a></td>
<td><a href="/hawkular-ui/app/app-details/{{res.id | limitTo : res.id.length-4 : 1}}/jvm">{{res.id | limitTo : res.id.length-4 : 1}}</a> <a href="/hawkular-ui/app/app-details/{{res.id}}/jvm" class="pull-right"><span class="label label-danger label-alert" tooltip-trigger tooltip-placement="top" tooltip="Server alerts" ng-show="res.alerts.length > 0">{{res.alerts.length}}</span></a></td>
<td>{{res.type.id}}</td>
<td>{{(res.properties.resourceConfiguration | filter:'Hostname':true)[0].value || 'n/a'}}</td>
<!-- <td class="center"><span class="label label-primary" ng-repeat="tag in res.tags">{{tag}}</span><span ng-hide="res.tags.length > 0">--</span></td> -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ <h3 class="pull-left">Availability Status</h3>
<!-- Alerts -->
<div class="hk-info-top clearfix">
<h3 class="pull-left" data-toggle="tooltip" data-placement="top" title="" data-original-title="Expand/collapse">
<button class="btn btn-link hk-trigger" ng-click="showAllAlerts = !showAllAlerts"><i class="fa" ng-show="vm.alertList.length > 0" ng-class="showAllAlerts ? 'fa-minus-square-o' : 'fa-plus-square-o'"></i> Alerts <span ng-show="vm.alertList.length > 0">({{showAllAlerts ? vm.alertList.length : vm.math.min(vm.alertList.length, 3)}} of {{vm.alertList.length}})</span></button>
<button class="btn btn-link hk-trigger" ng-click="showAllAlerts = !showAllAlerts"><i class="fa" ng-show="vm.alertList.length > 0" ng-class="showAllAlerts ? 'fa-minus-square-o' : 'fa-plus-square-o'"></i> Alerts <span ng-show="vm.alertList.length > 0">({{showAllAlerts ? vm.alertList.length : MetricsAvailabilityController.min(vm.alertList.length, 3)}} of {{vm.alertList.length}})</span></button>
</h3>
<span class="hk-settings pull-right"><a href="#" ng-controller="MetricsAlertController as mac" ng-click="mac.openSetup()"><i class="fa fa-cog"></i>Alert Settings</a></span>
</div>
Expand Down Expand Up @@ -82,4 +82,4 @@ <h2>Availability</h2>


</section>
</div>
</div>
4 changes: 3 additions & 1 deletion console/src/main/scripts/plugins/metrics/html/url-list.html
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,11 @@ <h2 ng-show="vm.resourceList.length > 0" class="text-center hk-fade-in">Current

<div ng-class="{'hk-fade-in': vm.resourceList}">
<div class="hk-url-item" ng-repeat="res in vm.resourceList | orderBy:'properties.url':vm.reverse">
<div class="hk-url-heading">
<div class="panel panel-default hk-url-heading">
<a href="/hawkular-ui/url/availability/{{res.id}}">{{res.properties.url}}</a>
<span ng-show="res.properties['trait-collected-on']" class="pull-right">{{res.traits}}</span>
</div>

<div class="panel panel-default hk-summary">
<div class="row">
<div class="col-sm-3 hk-summary-item">
Expand Down
8 changes: 7 additions & 1 deletion console/src/main/scripts/plugins/metrics/less/metrics.less
Original file line number Diff line number Diff line change
Expand Up @@ -465,11 +465,17 @@ a:hover .fa-spinner {
margin-top: @grid-gutter-width/4*3;

.hk-url-heading {
margin-bottom: @grid-gutter-width/4;
margin-bottom: 1px;
padding: @grid-gutter-width/4 @grid-gutter-width/3;

a {
font-size: ceil(@font-size-base * 1.333333);
}

span {
color: @gray-light;
margin-top: ceil(@font-size-base * 1.333333) - @font-size-base;
}
}

.hk-summary {
Expand Down
4 changes: 2 additions & 2 deletions console/src/main/scripts/plugins/metrics/ts/alertsManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,13 @@ module HawkularMetrics {

export class HawkularAlertsManager implements IHawkularAlertsManager{

public static $inject = ['HawkularAlert', '$q', '$log', '$moment','AlertService'];
public static $inject = ['HawkularAlert', '$q', '$log', '$moment','NotificationService'];

constructor(private HawkularAlert: any,
private $q: ng.IQService,
private $log: ng.ILogService,
private $moment: any,
private AlertService:any) {
private NotificationService:INotificationService) {
}

public createTrigger(id: TriggerId, triggerName: string, enabled: boolean,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ module HawkularMetrics {
public chartRespData;

constructor(private $scope: any,
private $rootScope: any,
private $rootScope: IHawkularRootScope,
private $routeParams: any,
private $interval: ng.IIntervalService,
private $q: ng.IQService,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ module HawkularMetrics {

constructor(private $location: ng.ILocationService,
private $scope: any,
private $rootScope: any,
private $rootScope: IHawkularRootScope,
private $interval: ng.IIntervalService,
private $log: ng.ILogService,
private $filter: ng.IFilterService,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,37 +30,36 @@ module HawkularMetrics {
export class AppServerJvmDetailsController {
/// this is for minification purposes
public static $inject = ['$location', '$scope', '$rootScope', '$interval', '$log', '$filter', '$routeParams',
'$modal', 'HawkularInventory', 'HawkularMetric', 'HawkularAlert', 'HawkularAlertsManager', 'HawkularErrorManager',
'$q', 'md5'];
'$modal', '$window', 'HawkularInventory', 'HawkularMetric', 'HawkularAlert', 'HawkularAlertsManager',
'HawkularErrorManager', '$q', 'md5'];

public static USED_COLOR = '#1884c7'; /// blue
public static MAXIMUM_COLOR = '#f57f20'; /// orange
public static COMMITTED_COLOR = '#515252'; /// dark gray

private resourceList;
private metricsList;
public alertList;
public chartHeapData: IMultiDataPoint[];
public chartNonHeapData: IMultiDataPoint[];
public startTimeStamp:TimestampInMillis;
public endTimeStamp:TimestampInMillis;
public chartGCDurationData: IChartDataPoint[];

constructor(private $location: ng.ILocationService,
private $scope: any,
private $rootScope: any,
private $rootScope: IHawkularRootScope,
private $interval: ng.IIntervalService,
private $log: ng.ILogService,
private $filter: ng.IFilterService,
private $routeParams: any,
private $modal: any,
private $window: any,
private HawkularInventory: any,
private HawkularMetric: any,
private HawkularAlert: any,
private HawkularAlertsManager: HawkularMetrics.IHawkularAlertsManager,
private HawkularErrorManager: HawkularMetrics.IHawkularErrorManager,
private $q: ng.IQService,
private md5: any,
public startTimeStamp:TimestampInMillis,
public endTimeStamp:TimestampInMillis,
public resourceUrl: string) {
private md5: any ) {
$scope.vm = this;

this.startTimeStamp = +moment().subtract(($routeParams.timeOffset || 3600000), 'milliseconds');
Expand All @@ -69,10 +68,11 @@ module HawkularMetrics {
this.chartNonHeapData = [];

if ($rootScope.currentPersona) {
this.getJvmData(this.$rootScope.currentPersona.id);
this.getJvmData();
} else {
// currentPersona hasn't been injected to the rootScope yet, wait for it..
$rootScope.$watch('currentPersona', (currentPersona) => currentPersona && this.getJvmData(currentPersona.id));
$rootScope.$watch('currentPersona',
(currentPersona) => currentPersona && this.getJvmData());
}

this.autoRefresh(20);
Expand All @@ -99,6 +99,41 @@ module HawkularMetrics {
});
}

private formatCounterChartOutput(response, buckets = 60):IChartDataPoint[] {
var result = response;
/// FIXME: Simulating buckets.. this should come from metrics.
if (response.length > buckets) {
var step = this.$window.Math.floor(response.length / buckets);
result = [];
var accValue = 0;
_.forEach(response, function(point:any, idx) {
if (parseInt(idx, 10) % step === (step-1)) {
result.push({timestamp: point.timestamp, value: accValue });
accValue = 0;
}
else {
accValue += point.value;
}
});
}

// The schema is different for bucketed output
return _.map(result, (point:IChartDataPoint, idx) => {
var theValue = idx === 0 ? 0 : (result[idx-1].value - point.value);
return {
timestamp: point.timestamp,
date: new Date(point.timestamp),
value: theValue,
avg: theValue,
min: theValue,
max: theValue,
percentile95th: theValue,
median: theValue,
empty: !angular.isNumber(point.value)
};
});
}

public autoRefresh(intervalInSeconds: number): void {
this.autoRefreshPromise = this.$interval(() => {
this.getJvmData();
Expand All @@ -110,12 +145,11 @@ module HawkularMetrics {
});
}

public getJvmData(currentTenantId?: TenantId): any {
public getJvmData(): any {
this.alertList = []; // FIXME: when we have alerts for app server
this.endTimeStamp = this.$routeParams.endTime || +moment();
this.startTimeStamp = this.endTimeStamp - (this.$routeParams.timeOffset || 3600000);

var tenantId:TenantId = currentTenantId || this.$rootScope.currentPersona.id;
this.HawkularMetric.GaugeMetricData(this.$rootScope.currentPersona.id).queryMetrics({
gaugeId: 'MI~R~[' + this.$routeParams.resourceId + '~/]~MT~WildFly Memory Metrics~Heap Used',
start: this.startTimeStamp,
Expand All @@ -130,15 +164,22 @@ module HawkularMetrics {
buckets: 1}, (resource) => {
this['heapMax'] = resource[0];
}, this);
this.getJvmChartData(currentTenantId);
this.HawkularMetric.CounterMetricData(this.$rootScope.currentPersona.id).queryMetrics({
counterId: 'MI~R~[' + this.$routeParams.resourceId + '~/]~MT~WildFly Memory Metrics~Accumulated GC Duration',
start: this.startTimeStamp,
end: this.endTimeStamp,
buckets: 1}, (resource) => {
this['accGCDuration'] = resource[0].value - resource[resource.length-1].value;
this.chartGCDurationData = this.formatCounterChartOutput(resource);
}, this);
this.getJvmChartData();
}

public getJvmChartData(currentTenantId?: TenantId): any {
public getJvmChartData(): any {

this.endTimeStamp = this.$routeParams.endTime || +moment();
this.startTimeStamp = this.endTimeStamp - (this.$routeParams.timeOffset || 3600000);

var tenantId:TenantId = currentTenantId || this.$rootScope.currentPersona.id;
this.HawkularMetric.GaugeMetricData(this.$rootScope.currentPersona.id).queryMetrics({
gaugeId: 'MI~R~[' + this.$routeParams.resourceId + '~/]~MT~WildFly Memory Metrics~Heap Committed',
start: this.startTimeStamp,
Expand Down
6 changes: 3 additions & 3 deletions console/src/main/scripts/plugins/metrics/ts/errorManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@ module HawkularMetrics {

export class HawkularErrorManager implements IHawkularErrorManager {

public static $inject = ['$q', '$log', 'AlertService'];
public static $inject = ['$q', '$log', 'NotificationService'];

constructor(private $q: ng.IQService,
private $log: ng.ILogService,
private AlertService: IAlertService) {
private NotificationService: INotificationService) {
}

private errorToastr(error: any, errorMsg: string): void {
Expand All @@ -46,7 +46,7 @@ module HawkularMetrics {
errorMsgComplete = errorMsg + ' ' + error;
}

this.AlertService.error(errorMsgComplete);
this.NotificationService.error(errorMsgComplete);
}

public errorHandler(error: any, msg: string, cb?: (error: any, msg: string) => void): ng.IPromise<void> {
Expand Down
4 changes: 2 additions & 2 deletions console/src/main/scripts/plugins/metrics/ts/metricService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,11 @@ module HawkularMetrics {

export class MetricService implements IMetricService {

public static $inject = ['$log', 'HawkularMetric', 'AlertService'];
public static $inject = ['$log', 'HawkularMetric', 'NotificationService'];

constructor(private $log:ng.ILogService,
private HawkularMetric:any,
private AlertService:IAlertService) {
private NotificationService:INotificationService) {
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ module HawkularMetrics {
private HawkularErrorManager: HawkularMetrics.IHawkularErrorManager,
private $log: ng.ILogService,
private $q: ng.IQService,
private $rootScope: any,
private $rootScope: IHawkularRootScope,
private $routeParams: any,
private $modal: any,
private $interval: ng.IIntervalService,
Expand Down

0 comments on commit 8839f10

Please sign in to comment.