Bug 1357447 - main dashboard utilization
Summary: main dashboard utilization
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Storage Console
Classification: Red Hat Storage
Component: UI
Version: 2
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
: 2
Assignee: kamlesh
QA Contact: Martin Kudlej
URL:
Whiteboard:
Depends On:
Blocks: Console-2-GA
TreeView+ depends on / blocked
 
Reported: 2016-07-18 09:06 UTC by Martin Kudlej
Modified: 2016-08-23 19:57 UTC (History)
6 users (show)

Fixed In Version: rhscon-ui-0.0.51-1.el7scon.noarch
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-08-23 19:57:14 UTC
Embargoed:


Attachments (Terms of Use)
wrong graph data (12.86 KB, image/png)
2016-07-18 09:06 UTC, Martin Kudlej
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 1358267 0 unspecified CLOSED Wrong size and utilization of pool 2021-02-22 00:41:40 UTC
Red Hat Product Errata RHEA-2016:1754 0 normal SHIPPED_LIVE New packages: Red Hat Storage Console 2.0 2017-04-18 19:09:06 UTC

Internal Links: 1358267

Description Martin Kudlej 2016-07-18 09:06:08 UTC
Created attachment 1180976 [details]
wrong graph data

Description of problem:
As you can see at screenshot 142/200 GB info is synchronized with percentage info but these 2 are not synchronized with graph data. It shows utilization graph 118 GB from 200 GB.
All utilization info is wrong because in reality there is usage 132GB.

Version-Release number of selected component (if applicable):
ceph-ansible-1.0.5-27.el7scon.noarch
ceph-installer-1.0.14-1.el7scon.noarch
rhscon-ceph-0.0.33-1.el7scon.x86_64
rhscon-core-0.0.34-1.el7scon.x86_64
rhscon-core-selinux-0.0.34-1.el7scon.noarch
rhscon-ui-0.0.48-1.el7scon.noarch

How reproducible:
100%

Steps to Reproduce:
1. copy some objects to pool and pass treshold for pool
2. remove some objects
3. check graphs

Actual results:
It seems that graph and all related data are updating separately. 

Expected results:
Graphs with related info will update at once with real data.

Comment 2 Ju Lim 2016-07-21 19:23:53 UTC
Problem:
In the dashboard, the donut chart showing utilization information does not get updated whenever utilization values change, specifically the the donut is not re-drawn with the updated value unless the User forces a manual refresh.

USM is using angular-patternfly (which sits on top of a C3 chart), and there appears to be no re-draw function in there, and the C3 chart does have the redraw function.  Right now, the angular-patternfly does not provide any control over this redraw function.

UXD Feedback (from the PatternFly UI Dev team): 
This appears to be a known issue with C3 charts.  Firing a resize event seems to be the recommended way to refresh C3 charts.

We encountered this issue when we were creating the PatternFly website when switching between tabs.  This is the JS we're using to solve our particular problem.  Whenever the tab is toggled, a resize event is fired, and the C3 chart is refreshed.

<script>
    // Workaround for bug with hidden C3 charts in v0.4.11.
    $(document).on('shown.bs.tab', 'a[data-toggle="tab"]', function () {
        if (window.dispatchEvent) {
            window.dispatchEvent(new Event('resize'));
        }
        // Special case for IE
        if ($(document).fireEvent) {
            $(document).fireEvent('onresize');
        }
    });
</script>

Comment 3 Ju Lim 2016-07-21 20:14:36 UTC
Per the PatternFly UI Development Team, the following are two choices to fix this issue:

1) Patch release the release of Angular Patternfly USM is currently using
  Small change but they need to update their version of Angular Patternfly

2) Provide a fix that works around the problem:

Currently they use the angular patternfly directive as such:

<div pf-donut-pct-chart class="fix-this" config="usedConfig" data="usedData" center-label="usedLabel"></div>
The fix would be to add another directive to wrap the pfDonutPctChart directive. Their HTML would become:

<div pf-donut-pct-chart-fixed>
   <div pf-donut-pct-chart class="fix-this" config="usedConfig" data="usedData" center-label="usedLabel"></div>
</div>

Then add the pfDonutPctChart directive (this could be named whatever USM wants and be in any module in USM):

angular.module('patternfly.charts').directive('pfDonutPctChartFixed', function (pfUtils, $timeout) {
  'use strict';
  return {
    restrict: 'A',
    transclude: true,
    template: '<div ng-transclude></div>',
    link: function (scope, iElm) {
      $timeout(function() {
        var pfDonutPctChart = iElm.find('span')[0];
        var innerScope = angular.element(pfDonutPctChart).isolateScope();
        innerScope.updateAll = function (scope) {
          scope.updateAvailable();
          scope.config.data = pfUtils.merge( scope.config.data, scope.getDonutData(scope));
          scope.config.color = scope.statusDonutColor(scope);
          scope.config.data.onclick = scope.config.onClickFn;
        };
      }, 200);
    }
  };
});

Basically, this outer directive gets the original directive and updates the erroneous method updateAll.

Please let us know which option they prefer and if we need to create the patch release.

Comment 4 kamlesh 2016-07-22 12:08:03 UTC
@julim : we have preferred second option for this .. means created custom directive for updating this donut chart arc.

Comment 5 kamlesh 2016-07-22 12:08:21 UTC
(In reply to kamlesh from comment #4)
> @julim : we had preferred second option for this .. means created custom
> directive for updating this donut chart arc.

Comment 6 Martin Kudlej 2016-08-05 09:01:26 UTC
Bug 1358267 will be solved in next version of Ceph. All other related BZ were filed so I verify this BZ.

Comment 8 errata-xmlrpc 2016-08-23 19:57:14 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHEA-2016:1754


Note You need to log in before you can comment on or make changes to this bug.