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

[Cases] Export getCasesMetrics from the cases UI client #131493

Merged
merged 5 commits into from
May 4, 2022

Conversation

cnasikas
Copy link
Member

@cnasikas cnasikas commented May 4, 2022

Summary

This PR exposes the getCasesMetrics in the UI client.

Depends on: #131407

Usage

await casesClient.api.cases.getCasesMetrics({ features: ['mttr'], from, to, owner });

Respose:

{
   // Average resolve time in seconds of all cases 
    mttr: 0
}

Checklist

Delete any items that are not applicable to this PR.

For maintainers

@cnasikas cnasikas self-assigned this May 4, 2022
@cnasikas cnasikas added v8.3.0 release_note:skip Skip the PR/issue when compiling release notes Team:ResponseOps Label for the ResponseOps team (formerly the Cases and Alerting teams) Feature:Cases Cases feature labels May 4, 2022
@cnasikas cnasikas changed the title [Cases] [Cases] Export getCasesMetrics from the cases UI client May 4, 2022
@cnasikas cnasikas requested a review from academo May 4, 2022 09:39
@cnasikas cnasikas marked this pull request as ready for review May 4, 2022 09:39
@cnasikas cnasikas requested a review from a team as a code owner May 4, 2022 09:39
@elasticmachine
Copy link
Contributor

Pinging @elastic/response-ops (Team:ResponseOps)

@elasticmachine
Copy link
Contributor

Pinging @elastic/response-ops-cases (Feature:Cases)

@@ -43,3 +49,11 @@ export const getCasesStatus = async ({

return convertToCamelCase<CasesStatusResponse, CasesStatus>(decodeCasesStatusResponse(response));
};

export const getCasesMetrics = async ({
Copy link
Contributor

Choose a reason for hiding this comment

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

I can see in all of the other APIs we accept an abort signal, is there a particular reason to not require it here?

Copy link
Member Author

Choose a reason for hiding this comment

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

I forgot it. Thanks!

Copy link
Member Author

Choose a reason for hiding this comment

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

Done!

Copy link
Contributor

@academo academo left a comment

Choose a reason for hiding this comment

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

Two questions:

  1. Are we missing an abort signal in the frontend API?
  2. Do we really need to make the backend more complex by accepting features as strings or array?

@cnasikas cnasikas requested a review from academo May 4, 2022 11:07
Copy link
Contributor

@academo academo left a comment

Choose a reason for hiding this comment

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

Thanks for the changes.

@cnasikas cnasikas enabled auto-merge (squash) May 4, 2022 11:21
@cnasikas cnasikas merged commit 8dd22dd into elastic:main May 4, 2022
@kibana-ci
Copy link
Collaborator

💚 Build Succeeded

Metrics [docs]

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
cases 290.1KB 290.2KB +29.0B

Page load bundle

Size of the bundles that are downloaded on every page load. Target size is below 100kb

id before after diff
cases 97.3KB 97.7KB +384.0B

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

cc @cnasikas

@cnasikas cnasikas deleted the mttr_ui_client branch May 4, 2022 12:12
@kibanamachine kibanamachine added the backport:skip This commit does not require backporting label May 4, 2022
kertal pushed a commit to kertal/kibana that referenced this pull request May 24, 2022
…1493)

* Export cases metrics

* Fixes

* Add integration tests

* Add comment

* Add signal
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:skip This commit does not require backporting Feature:Cases Cases feature release_note:skip Skip the PR/issue when compiling release notes Team:ResponseOps Label for the ResponseOps team (formerly the Cases and Alerting teams) v8.3.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants