-
Notifications
You must be signed in to change notification settings - Fork 356
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add differential chart option to charts #1367
Conversation
@yaacov Cannot apply the following label because they are not recognized: providers/containers |
@miq-bot add_label compute/containers |
@@ -2,6 +2,16 @@ angular.module('miq.util').factory('metricsUtilsFactory', function() { | |||
return function (dash) { | |||
var UNKNOWN_ERROR_STR = __('Something is wrong, try reloading the page'); | |||
|
|||
function dataDiff(data) { | |||
data.forEach(function(v, i) { | |||
if (data[i] && data[i + 1]) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@yaacov what if either data[i]
or data[i + 1]
is really 0?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 thanks, replaced with explicit !== null
@yaacov at least |
@@ -2,6 +2,16 @@ angular.module('miq.util').factory('metricsUtilsFactory', function() { | |||
return function (dash) { | |||
var UNKNOWN_ERROR_STR = __('Something is wrong, try reloading the page'); | |||
|
|||
function dataDiff(data) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@yaacov let's use a less generic name.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 Thanks, replaced with inplaceCalcDataDifferentials
:-)
15ff186
to
0f0af69
Compare
function inplaceCalcDataDifferentials(data) { | ||
data.forEach(function(v, i) { | ||
if ((data[i] !== null) && (data[i + 1] !== null)) { | ||
data[i] = data[i + 1] - data[i]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@yaacov I am not sure if we want to do this inplace... wouldn't this function always result in an array where the last item is null
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not sure if we want to do this inplace
inplace saves memory and pushing data between functions ...
wouldn't this function always result in an array where the last item is null?
yes, each consecutive pair becomes one item, the null is left in the end.
2858622
to
a31762c
Compare
Following meeting today, change "Differentials" to "Rate" cc// @simon3z |
@yaacov a couple of comments:
|
66d706d
to
427f90f
Compare
@simon3z |
This pull request is not mergeable. Please rebase and repush. |
427f90f
to
1e88372
Compare
1e88372
to
36cf08e
Compare
@yaacov do we have a BZ for this? If not we should (open one, thanks). |
|
@miq-bot add_label fine/yes https://bugzilla.redhat.com/show_bug.cgi?id=1457893 target 5.8.1 |
@himdel please re-review |
This pull request is not mergeable. Please rebase and repush. |
36cf08e
to
7926d7f
Compare
LGTM 👍 would merge, but seems the JS specs are failing, looks relevant. |
7926d7f
to
8029d14
Compare
@himdel |
8029d14
to
0131b20
Compare
Checked commit yaacov@0131b20 with ruby 2.2.6, rubocop 0.47.1, and haml-lint 0.20.0 |
@himdel all green now |
@yaacov there are a bit of conflicts backporting to Fine. Would you mind creating a Fine PR?
|
Backported to Fine via #1600 |
Description
Add rate / differential chart option to charts
BZ: https://bugzilla.redhat.com/show_bug.cgi?id=1457893
Motive
Some metrics only come in counter/totals form (especially in Prometheus), we need a rate view to better understand/compare them.
Screenshot