-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
[APM] Split All instances API adding a new API to return comparison statistics #94767
[APM] Split All instances API adding a new API to return comparison statistics #94767
Conversation
1b964fb
to
6524826
Compare
7fd25a9
to
65086fe
Compare
Pinging @elastic/apm-ui (Team:apm) |
return ( | ||
<> | ||
{/* <EuiFlexItem grow={3}> | ||
<InstancesLatencyDistributionChart | ||
height={chartHeight} | ||
items={data} | ||
items={data.items} | ||
status={status} | ||
/> | ||
</EuiFlexItem> */} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
did you forget to remove this commented code?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, this is still commented out on Master https://github.com/elastic/kibana/blob/master/x-pack/plugins/apm/public/components/app/service_overview/service_overview_instances_chart_and_table.tsx#L75
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See the comment at the top of the file: https://github.com/elastic/kibana/pull/94767/files#diff-c0ef7ba5123324610da97ba1e6b7dac3d4ed715fbdde415ae2d2cc2b07d0e060R21-R26
.../apm/public/components/app/service_overview/service_overview_instances_table/get_columns.tsx
Outdated
Show resolved
Hide resolved
max: end, | ||
}, | ||
}, | ||
aggs: { avg: { avg: agg } }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's not necessary, but i usually like to name aggs something descriptive, like comparisonAvg
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since it's a generic function I'd rather leaving the way it is now. Otherwise, I'll have to check if the field exists before using it.
(response.aggregations?.[SERVICE_NODE_NAME].buckets.map( | ||
(serviceNodeBucket) => { | ||
const { doc_count: count, key } = serviceNodeBucket; | ||
const serviceNodeName = String(key); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wouldn't key always be a string? why is the cast needed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually no, key can be string | number
@@ -24,25 +30,78 @@ interface ServiceOverviewInstancesChartAndTableProps { | |||
serviceName: string; | |||
} | |||
|
|||
const INITIAL_STATE = { | |||
items: [] as Array<{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we use something from ApiReturnType
here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not really, since the type is changed from number | null | undefined
to number
here https://github.com/cauemarcondes/kibana/blob/apm-time-comparison-instances/x-pack/plugins/apm/public/components/app/service_overview/service_overview_instances_chart_and_table.tsx#L123-L127
💚 Build Succeeded
Metrics [docs]Module Count
Async chunks
History
To update your PR or re-run it, just comment with: |
…tatistics (elastic#94767) * adding comparison to instances table * fixing tests * adding api tests * removing unnecessary files * fixing ts issue * fixing ts issue * refactoring * refactoring * refactoring * refactoring * refactoring * addressing PR comments * addressing PR comments
closes #90577