Skip to content

Commit

Permalink
feat(profiling): Clean up continuous profiling ui and compat flags (#…
Browse files Browse the repository at this point in the history
…81260)

We can consolidate the continuous-profiling-ui and
continuous-profiling-compat flags now as they will be enabled for all
orgs.
  • Loading branch information
Zylphrex authored Nov 27, 2024
1 parent 198e038 commit 2613081
Show file tree
Hide file tree
Showing 11 changed files with 41 additions and 701 deletions.
27 changes: 20 additions & 7 deletions static/app/components/profiling/profileEventsTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import {t} from 'sentry/locale';
import type {Organization} from 'sentry/types/organization';
import type {Project} from 'sentry/types/project';
import {defined} from 'sentry/utils';
import {trackAnalytics} from 'sentry/utils/analytics';
import {getTimeStampFromTableDateField} from 'sentry/utils/dates';
import EventView from 'sentry/utils/discover/eventView';
import {DURATION_UNITS} from 'sentry/utils/discover/fieldRenderers';
Expand All @@ -33,8 +34,7 @@ import {
useDomainViewFilters,
} from 'sentry/views/insights/pages/useFilters';
import {getTraceDetailsUrl} from 'sentry/views/performance/traceDetails/utils';

import {ProfilingTransactionHovercard} from './profilingTransactionHovercard';
import {profilesRouteWithQuery} from 'sentry/views/performance/transactionSummary/transactionProfiles/utils';

interface ProfileEventsTableProps<F extends FieldType> {
columns: readonly F[];
Expand Down Expand Up @@ -236,13 +236,26 @@ function ProfileEventsCell<F extends FieldType>(props: ProfileEventsCellProps<F>
const project = getProjectForRow(props.baggage, props.dataRow);

if (defined(project)) {
const linkToSummary = profilesRouteWithQuery({
query: props.baggage.location.query,
orgSlug: props.baggage.organization.slug,
projectID: project.id,
transaction: props.dataRow.transaction,
});

return (
<Container>
<ProfilingTransactionHovercard
transaction={value}
project={project}
organization={props.baggage.organization}
/>
<Link
to={linkToSummary}
onClick={() =>
trackAnalytics('profiling_views.go_to_transaction', {
organization: props.baggage.organization,
source: 'profiling.landing.transaction_table',
})
}
>
{props.dataRow.transaction}
</Link>
</Container>
);
}
Expand Down
270 changes: 0 additions & 270 deletions static/app/components/profiling/profilingTransactionHovercard.tsx

This file was deleted.

2 changes: 1 addition & 1 deletion static/app/utils/profiling/hooks/useProfileEvents.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ describe('useProfileEvents', function () {
match: [
MockApiClient.matchQuery({
dataset: 'discover',
query: 'has:profile.id (transaction:foo)',
query: '(has:profile.id OR (has:profiler.id has:thread.id)) (transaction:foo)',
}),
],
});
Expand Down
8 changes: 1 addition & 7 deletions static/app/utils/profiling/hooks/useProfileEvents.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ export interface UseProfileEventsOptions<F extends string = ProfilingFieldType>
fields: readonly F[];
referrer: string;
sort: Sort<F>;
continuousProfilingCompat?: boolean;
cursor?: string;
datetime?: PageFilters['datetime'];
enabled?: boolean;
Expand All @@ -30,7 +29,6 @@ export function useProfileEvents<F extends string>({
referrer,
query,
sort,
continuousProfilingCompat,
cursor,
enabled = true,
refetchOnMount = true,
Expand All @@ -40,11 +38,7 @@ export function useProfileEvents<F extends string>({
const organization = useOrganization();
const {selection} = usePageFilters();

if (continuousProfilingCompat) {
query = `(has:profile.id OR (has:profiler.id has:thread.id)) ${query ? `(${query})` : ''}`;
} else {
query = `has:profile.id ${query ? `(${query})` : ''}`;
}
query = `(has:profile.id OR (has:profiler.id has:thread.id)) ${query ? `(${query})` : ''}`;

const path = `/organizations/${organization.slug}/events/`;
const endpointOptions = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ describe('useProfileEvents', function () {
match: [
MockApiClient.matchQuery({
dataset: 'discover',
query: 'has:profile.id (transaction:foo)',
query: '(has:profile.id OR (has:profiler.id has:thread.id)) (transaction:foo)',
}),
],
});
Expand Down Expand Up @@ -135,7 +135,7 @@ describe('useProfileEvents', function () {
match: [
MockApiClient.matchQuery({
dataset: 'discover',
query: 'has:profile.id (transaction:foo)',
query: '(has:profile.id OR (has:profiler.id has:thread.id)) (transaction:foo)',
}),
],
});
Expand Down Expand Up @@ -197,7 +197,7 @@ describe('useProfileEvents', function () {
match: [
MockApiClient.matchQuery({
dataset: 'discover',
query: 'has:profile.id (transaction:foo)',
query: '(has:profile.id OR (has:profiler.id has:thread.id)) (transaction:foo)',
}),
],
});
Expand Down
Loading

0 comments on commit 2613081

Please sign in to comment.