Skip to content
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

Discover interval #3290

Merged
merged 9 commits into from
Apr 14, 2015
Merged

Discover interval #3290

merged 9 commits into from
Apr 14, 2015

Conversation

w33ble
Copy link
Contributor

@w33ble w33ble commented Mar 6, 2015

Closes #3038

Adds interval selection to Discover, using the same interval logic used in the agg builder in visualize.

To add addition intervals (mostly, intervals that are not just 1), see #1784

  • Display current interval (using bucket interval description)
  • Click to alter interval - show select on click
  • Remove select when set back to auto

@w33ble
Copy link
Contributor Author

w33ble commented Mar 6, 2015

There is still some auto-scaling happening here, for example:

screenshot 2015-03-06 16 47 38

screenshot 2015-03-06 16 47 30

I'm not sure it this is something that will be adjust in #2991, but my guess is that it's really not something we can fix. Showing the value that's used might be helpful though.

@rashidkpc
Copy link
Contributor

I think the auto scaling is OK here, Feb 6 - March 6 as an hourly chart would just be too many bars. I agree it would be extremely helpful to indicate that we are not showing raw counts at this point, but rather an adjusted "rate"

@w33ble
Copy link
Contributor Author

w33ble commented Mar 17, 2015

@rashidkpc Would you like me to add the current interval to this PR as well then?

@rashidkpc
Copy link
Contributor

Probably worth talking about, I'm not sure where it belongs exactly? Seems like it should go on the X-axis label somehow. Thoughts?

@w33ble
Copy link
Contributor Author

w33ble commented Apr 3, 2015

Whoops, didn't see the question. I could display it on the axis, maybe as part of the label. Let me play with this a bit and see if I can come up with something that looks decent.

Conflicts:
	src/kibana/plugins/discover/controllers/discover.js
	src/kibana/plugins/discover/index.html
@rashidkpc rashidkpc assigned w33ble and unassigned rashidkpc Apr 6, 2015
@w33ble
Copy link
Contributor Author

w33ble commented Apr 8, 2015

@rashidkpc I opened #3535 as displaying the interval is becoming a little more involved, and I don't think it should block merging this feature. Sending back to you for review.

@w33ble w33ble assigned rashidkpc and unassigned w33ble Apr 8, 2015
@w33ble w33ble mentioned this pull request Apr 8, 2015
@w33ble w33ble removed the review label Apr 8, 2015
@w33ble w33ble assigned w33ble and unassigned rashidkpc Apr 8, 2015
@w33ble
Copy link
Contributor Author

w33ble commented Apr 8, 2015

Found an issue - when you save the search, you lose the interval state. Need to fix that.

@w33ble w33ble added the review label Apr 8, 2015
@w33ble w33ble assigned rashidkpc and unassigned w33ble Apr 8, 2015
@w33ble
Copy link
Contributor Author

w33ble commented Apr 8, 2015

The issue right now is that the interval is only saved in the app state, which means when you save a vis, you lose the interval (since it's reloaded, and the app state is discarded).

I'm leaving this somewhat broken right now, with plans to fix it via #2716 by making that solution handle arbitrary persisted states, not limited to just visualizations.

@rashidkpc
Copy link
Contributor

I think its ok to have the interval as transient for now. The chart is more of a navigational aid in the context so I don't see it as something essential to put on the savedSearch.

@rashidkpc
Copy link
Contributor

Functionally this looks good, but style-wise it should use some tweaking. We were thinking something like this:

screen shot 2015-04-09 at 11 52 20 am

Then, when you click on "by hour" it changes to a select box.

@rashidkpc rashidkpc assigned w33ble and unassigned rashidkpc Apr 9, 2015
@w33ble
Copy link
Contributor Author

w33ble commented Apr 10, 2015

2015-04-10 11_38_41

This is what I ended up with. I reset the display when the user changes the interval back to Auto

I'm using the bucket interval description (which dips in to #3535 territory) as it's the best label we have available. Alternately, I could add new labels tot he interval options, or perhaps change what's there. If that's more desirable, let me know.

@w33ble w33ble assigned rashidkpc and unassigned w33ble Apr 10, 2015

<span class="results-interval" ng-hide="showInterval">
<a
ng-click="$parent.showInterval = !$parent.showInterval">
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Accessing $parent to set the value from the view seems wrong. Maybe change this to be a function on the parent that sets the value. Eg:

    $scope.toggleInterval = function () {
      $scope.showInterval =  !$scope.showInterval;
    };

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's how I started doing this, but it wasn't working for some reason, and $parent seemed to fix it. Of course, now that I do it again, it works fine. Oi.

@rashidkpc
Copy link
Contributor

With that one comment this looks good. Would like another set of eyes here.

@rashidkpc rashidkpc assigned panda01 and unassigned rashidkpc Apr 14, 2015
@panda01
Copy link
Contributor

panda01 commented Apr 14, 2015

Besides that one comment, this LGTM!

@panda01 panda01 assigned w33ble and unassigned panda01 Apr 14, 2015
@w33ble w33ble assigned panda01 and unassigned w33ble Apr 14, 2015
@w33ble
Copy link
Contributor Author

w33ble commented Apr 14, 2015

Ready for one last look

rashidkpc added a commit that referenced this pull request Apr 14, 2015
@rashidkpc rashidkpc merged commit 2c0748e into elastic:master Apr 14, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Interval options in time chart (Discover tab)
3 participants