[Uptime] Update snapshot counts#48035
Conversation
|
Pinging @elastic/uptime (Team:uptime) |
💔 Build Failed
|
|
@elasticmachine merge upstream |
💔 Build Failed
|
abcd5d7 to
23b29e5
Compare
💚 Build Succeeded
|
💔 Build Failed
|
f3ff135 to
891b6f4
Compare
💚 Build Succeeded
|
891b6f4 to
b014642
Compare
💚 Build Succeeded
|
b014642 to
ecd7314
Compare
💔 Build Failed
|
ecd7314 to
a2952f9
Compare
💔 Build Failed
|
💚 Build Succeeded
|
💔 Build Failed |
💔 Build Failed |
shahzad31
left a comment
There was a problem hiding this comment.
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. |
💔 Build Failed |
|
@elasticmachine merge upstream |
|
@shahzad31 I added a follow-up issue for heading text here: elastic/uptime#120 |
💚 Build Succeeded |
* 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.
* 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.
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 theSnapshotcomponent becoming aconnected container.Testing this PR
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
strikethroughsto remove checklist items you don't feel are applicable to this PR.For maintainers