Skip to content

[Uptime] Update snapshot counts#48035

Merged
justinkambic merged 45 commits intoelastic:masterfrom
justinkambic:uptime_snapshot-counts
Nov 27, 2019
Merged

[Uptime] Update snapshot counts#48035
justinkambic merged 45 commits intoelastic:masterfrom
justinkambic:uptime_snapshot-counts

Conversation

@justinkambic
Copy link
Copy Markdown
Contributor

@justinkambic justinkambic commented Oct 11, 2019

Summary

Resolves #47376.

Code is WIP.

The goal of this patch is to utilize the monitor iterator to ensure that the snapshot counts we're showing the user correspond to the values in the monitor list.

In addition to updating how we compute these values, we're moving the querying code from the existing GQL schema to a REST endpoint with io-ts-generated typing for validation. Additionally, we've begun a state management migration from internal component state and context reliance to a dedicated Redux-powered solution. As a result, there're some added functions around data fetching, state reduction, and action dispatching. It also resulted in the Snapshot component becoming a connected container.

Testing this PR

  1. Start up one or more Heartbeat locations and run this patch
  2. Ensure that the counts in the Snapshot view at the top of the Overview page correspond to the count of each status type of monitor shown in the table
  3. When you filter your environment, ensure that the filters you're applying result in the same numeric changes between the monitor list and the snapshot count

The goal here is to ensure that the counts we show our users correspond to the actual data we're displaying in our table.

Checklist

Use strikethroughs to remove checklist items you don't feel are applicable to this PR.

For maintainers

@justinkambic justinkambic added WIP Work in progress v8.0.0 Team:Uptime - DEPRECATED Synthetics & RUM sub-team of Application Observability v7.5.0 polish labels Oct 11, 2019
@justinkambic justinkambic self-assigned this Oct 11, 2019
@elasticmachine
Copy link
Copy Markdown
Contributor

Pinging @elastic/uptime (Team:uptime)

@elasticmachine
Copy link
Copy Markdown
Contributor

💔 Build Failed

@justinkambic
Copy link
Copy Markdown
Contributor Author

@elasticmachine merge upstream

@elasticmachine
Copy link
Copy Markdown
Contributor

💔 Build Failed

@justinkambic justinkambic force-pushed the uptime_snapshot-counts branch from abcd5d7 to 23b29e5 Compare November 11, 2019 21:53
@elasticmachine
Copy link
Copy Markdown
Contributor

💚 Build Succeeded

@justinkambic justinkambic removed the WIP Work in progress label Nov 12, 2019
@justinkambic justinkambic marked this pull request as ready for review November 12, 2019 00:01
@elasticmachine
Copy link
Copy Markdown
Contributor

💔 Build Failed

@justinkambic justinkambic force-pushed the uptime_snapshot-counts branch from f3ff135 to 891b6f4 Compare November 12, 2019 21:21
@elasticmachine
Copy link
Copy Markdown
Contributor

💚 Build Succeeded

@justinkambic justinkambic force-pushed the uptime_snapshot-counts branch from 891b6f4 to b014642 Compare November 13, 2019 04:01
@elasticmachine
Copy link
Copy Markdown
Contributor

💚 Build Succeeded

@justinkambic justinkambic force-pushed the uptime_snapshot-counts branch from b014642 to ecd7314 Compare November 14, 2019 03:42
@elasticmachine
Copy link
Copy Markdown
Contributor

💔 Build Failed

@justinkambic justinkambic force-pushed the uptime_snapshot-counts branch from ecd7314 to a2952f9 Compare November 14, 2019 19:09
@elasticmachine
Copy link
Copy Markdown
Contributor

💔 Build Failed

@elasticmachine
Copy link
Copy Markdown
Contributor

💚 Build Succeeded

@elasticmachine
Copy link
Copy Markdown
Contributor

💔 Build Failed

@elasticmachine
Copy link
Copy Markdown
Contributor

💔 Build Failed

Copy link
Copy Markdown
Contributor

@shahzad31 shahzad31 left a comment

Choose a reason for hiding this comment

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

looks good, are we going to do those label changes in this PR or you want to handle that separately?
We discussed at that top, that i should says "All selected monitors are up".

"0/2 of selected monitors are up".

@justinkambic
Copy link
Copy Markdown
Contributor Author

looks good, are we going to do those label changes in this PR or you want to handle that separately?
We discussed at that top, that i should says "All selected monitors are up".

"0/2 of selected monitors are up".

@shahzad31 I think I'd prefer not to add any more code to this patch as it's holding up some more PR's downstream. If you're ok with it I'll create another enhancement issue to add that, will be a tiny change.

@elasticmachine
Copy link
Copy Markdown
Contributor

💔 Build Failed

@justinkambic
Copy link
Copy Markdown
Contributor Author

@elasticmachine merge upstream

@justinkambic
Copy link
Copy Markdown
Contributor Author

@shahzad31 I added a follow-up issue for heading text here: elastic/uptime#120

Copy link
Copy Markdown
Contributor

@shahzad31 shahzad31 left a comment

Choose a reason for hiding this comment

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

LGTM, WFG !!

@elasticmachine
Copy link
Copy Markdown
Contributor

💚 Build Succeeded

@justinkambic justinkambic merged commit ce16609 into elastic:master Nov 27, 2019
justinkambic added a commit to justinkambic/kibana that referenced this pull request Dec 3, 2019
* Add snapshot count function that uses monitor iterator class.

* Add js-doc comment.

* Add snapshot count route.

* Start adding snapshot state management.

* Commit changes that were missed in previous.

* Finish implementing snapshot count redux code.

* Add basePath setter and type to ui state.

* Dispatch basePath set action on app render.

* Replace GQL-powered Snapshot export with Redux/Rest-powered version.

* Extract presentational element to dedicated component.

* Update broken test.

* Rename action.

* Add comments to clarify adapter function.

* Remove obsolete code.

* Add ui state field to store for tracking when app refreshes.

* Make snapshot component refresh on global refresh via redux state.

* Remove obsolete @ts-igore.

* Alphabetize imports.

* Port functional test fixture to REST test.

* Delete snapshot GQL query.

* Update API test fixtures to match new snapshot count REST response shape.

* Update Snapshot count type check to be stricter.

* Add tests for Snapshot API call.

* Rename new test file from tsx to ts, it has no JSX.

* Add tests for snapshot reducer.

* Add tests for UI reducer.

* Add tests for selectors.

* Delete unused test file.

* Move snapshot getter and map/reduce logic to dedicated helper function.

* Add test for snapshot helper function.

* Export type from module.

* Rename outdated snapshot file.

* Add action creator for fetch success.

* Reorganize ui actions file.

* Update snapshot effect to put error when input params are not valid.

* Simplify typing code for a function.

* Simplify snapshot count reduction.

* Rename a function.

* Rewrite a function to increase code clarity.

* Remove duplicated interface.

* Add very high ceiling for snapshot count iteration.

* Update broken test assertion.
justinkambic added a commit that referenced this pull request Dec 4, 2019
* Add snapshot count function that uses monitor iterator class.

* Add js-doc comment.

* Add snapshot count route.

* Start adding snapshot state management.

* Commit changes that were missed in previous.

* Finish implementing snapshot count redux code.

* Add basePath setter and type to ui state.

* Dispatch basePath set action on app render.

* Replace GQL-powered Snapshot export with Redux/Rest-powered version.

* Extract presentational element to dedicated component.

* Update broken test.

* Rename action.

* Add comments to clarify adapter function.

* Remove obsolete code.

* Add ui state field to store for tracking when app refreshes.

* Make snapshot component refresh on global refresh via redux state.

* Remove obsolete @ts-igore.

* Alphabetize imports.

* Port functional test fixture to REST test.

* Delete snapshot GQL query.

* Update API test fixtures to match new snapshot count REST response shape.

* Update Snapshot count type check to be stricter.

* Add tests for Snapshot API call.

* Rename new test file from tsx to ts, it has no JSX.

* Add tests for snapshot reducer.

* Add tests for UI reducer.

* Add tests for selectors.

* Delete unused test file.

* Move snapshot getter and map/reduce logic to dedicated helper function.

* Add test for snapshot helper function.

* Export type from module.

* Rename outdated snapshot file.

* Add action creator for fetch success.

* Reorganize ui actions file.

* Update snapshot effect to put error when input params are not valid.

* Simplify typing code for a function.

* Simplify snapshot count reduction.

* Rename a function.

* Rewrite a function to increase code clarity.

* Remove duplicated interface.

* Add very high ceiling for snapshot count iteration.

* Update broken test assertion.
@justinkambic
Copy link
Copy Markdown
Contributor Author

Backported to:
7.x/7.6.0 97d2fa6
#52137

@justinkambic justinkambic deleted the uptime_snapshot-counts branch December 4, 2019 15:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

polish release_note:enhancement Team:Uptime - DEPRECATED Synthetics & RUM sub-team of Application Observability v7.6.0 v8.0.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Uptime] Snapshot counts change when location filter is selected despite same data being returned

5 participants