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

feat(insights): Switch to ratios for slow and frozen frames #74523

Merged
merged 5 commits into from
Jul 26, 2024

Conversation

markushi
Copy link
Member

@markushi markushi commented Jul 18, 2024

As described here, we want to move to ratios for slow and frozen frames.

Utilizes division_if to calculate the ratios.

image

@markushi markushi requested a review from a team as a code owner July 18, 2024 20:04
@github-actions github-actions bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Jul 18, 2024
@markushi markushi marked this pull request as draft July 18, 2024 20:04
@@ -819,6 +819,10 @@ export function getSortField(
return field;
}

if (field.startsWith('division_if(')) {
Copy link
Member Author

@markushi markushi Jul 19, 2024

Choose a reason for hiding this comment

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

This feels like a hack 🙈, an alternative would be adding them to aggregations, but then we'd need to support this for discover queries as well (see count_if as an example,

[AggregationKey.COUNT_IF]: {
...getDocsAndOutputType(AggregationKey.COUNT_IF),
parameters: [
{
kind: 'column',
columnTypes: validateDenyListColumns(
['string', 'duration', 'number'],
['id', 'issue', 'user.display']
),
defaultValue: 'transaction.duration',
required: true,
},
{
kind: 'dropdown',
options: CONDITIONS_ARGUMENTS,
dataType: 'string',
defaultValue: CONDITIONS_ARGUMENTS[0].value,
required: true,
},
{
kind: 'value',
dataType: 'string',
defaultValue: '300',
required: true,
},
],
isSortable: true,
multiPlotType: 'area',
) - not too sure if this would blow stuff up, as the backend support for division_if is tightly bound to releases.

Copy link
Member

Choose a reason for hiding this comment

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

I think there's a cleaner way to get around this, but I have to do a bit of investigation. I'm seeing some odd access paths when it comes to the structure of tableMeta. If you want, we can remove this until I get a chance to poke around a bit more and we can put up a separate PR to handle the sortability of the headers.

The endpoint returns in the meta data that the corresponding type to the division_if statements should be percentages so they should be sortable by default when it gets to this block. I know that the key gets kind of mangled for equations but we should be able to work around that

@markushi markushi marked this pull request as ready for review July 19, 2024 16:20
Copy link
Member

@narsaynorath narsaynorath left a comment

Choose a reason for hiding this comment

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

Just a few comments. I think the conversion for the table looks good but there's probably an alternate way to access the tooltips without editing the type and also fixing the sorting without hardcoding the division_if prefix.

I think we should pull out the field renderer part and have a separate PR. I can take a look deeper tomorrow on how to get around it

@@ -819,6 +819,10 @@ export function getSortField(
return field;
}

if (field.startsWith('division_if(')) {
Copy link
Member

Choose a reason for hiding this comment

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

I think there's a cleaner way to get around this, but I have to do a bit of investigation. I'm seeing some odd access paths when it comes to the structure of tableMeta. If you want, we can remove this until I get a chance to poke around a bit more and we can put up a separate PR to handle the sortability of the headers.

The endpoint returns in the meta data that the corresponding type to the division_if statements should be percentages so they should be sortable by default when it gets to this block. I know that the key gets kind of mangled for equations but we should be able to work around that

Copy link
Member

@narsaynorath narsaynorath 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 to me! thanks for splitting out the sorting changes we discussed

@markushi markushi merged commit 6f127ef into master Jul 26, 2024
42 checks passed
@markushi markushi deleted the feat/starfish-slow-frozen-frames-as-ratio branch July 26, 2024 18:21
@github-actions github-actions bot locked and limited conversation to collaborators Aug 11, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Scope: Frontend Automatically applied to PRs that change frontend components
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants