-
Notifications
You must be signed in to change notification settings - Fork 11
refactor: use new group limit in explorer #698
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
Changes from 1 commit
f3a02f8
d0a6f5a
5d7595b
7ead1ee
6d1dcf3
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,3 @@ | ||
| import { TimeDuration } from '@hypertrace/common'; | ||
| import { GraphQlFilter } from '@hypertrace/distributed-tracing'; | ||
| import { Model } from '@hypertrace/hyperdash'; | ||
| import { NEVER, Observable } from 'rxjs'; | ||
|
|
@@ -19,18 +18,16 @@ import { ExploreCartesianDataSourceModel, ExplorerData } from '../explore/explor | |
| export class ExplorerVisualizationCartesianDataSourceModel extends ExploreCartesianDataSourceModel { | ||
| public request?: ExploreVisualizationRequest; | ||
|
|
||
| protected fetchResults(interval: TimeDuration | 'AUTO'): Observable<CartesianResult<ExplorerData>> { | ||
| const requestState = this.buildRequestState(interval); | ||
|
|
||
| if (this.request === undefined || requestState === undefined) { | ||
| protected fetchResults(): Observable<CartesianResult<ExplorerData>> { | ||
| if (this.request === undefined) { | ||
| return NEVER; | ||
| } | ||
|
|
||
| return this.request.exploreQuery$.pipe( | ||
| switchMap(exploreRequest => | ||
| this.query<ExploreGraphQlQueryHandlerService>(inheritedFilters => | ||
| this.appendFilters(exploreRequest, this.getFilters(inheritedFilters)) | ||
| ).pipe(mergeMap(response => this.mapResponseData(requestState, response))) | ||
| ).pipe(mergeMap(response => this.mapResponseData(this.request!, response))) | ||
| ) | ||
| ); | ||
| } | ||
|
|
@@ -46,17 +43,8 @@ export class ExplorerVisualizationCartesianDataSourceModel extends ExploreCartes | |
| }; | ||
| } | ||
|
|
||
| protected buildRequestState(interval: TimeDuration | 'AUTO'): ExploreRequestState | undefined { | ||
| if (this.request?.series.length === 0 || this.request?.context === undefined) { | ||
| return undefined; | ||
| } | ||
|
|
||
| return { | ||
| series: this.request.series, | ||
| context: this.request.context, | ||
| interval: interval, | ||
| groupBy: this.request.groupBy, | ||
| groupByLimit: this.request.groupByLimit | ||
| }; | ||
| protected buildRequestState(): ExploreRequestState | undefined { | ||
| // Unused since fetchResults is overriden, but abstract so requires a def | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This one's a bit weird. This is an abstract method used in the parent's fetchResults which we override in this class. It's not really relevant to this implementation since fetchResults uses an observable of state rather than building its own. This was actually breaking the explorer, (although no one noticed) since the previous implementation was mapping the response data based on the initial state, not the current one.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah. AFAIR, the
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If this is working, then you don't need to override
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. As a user interacts with the explorer, all of the fields on
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ah okay. It will still be confusing to a new developer. Do you think we should change the design a little bit (as a tech debt)?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yeah, for sure. |
||
| return undefined; | ||
| } | ||
| } | ||
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.
On the consumer side, do we need to change the existing limit in modelJsons (may be) since this will now limit the number of results?
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.
None exist in the UI as of today (besides what you've got in flight), but in general yes - new data models that extend this will have to use the two types of limit appropriately.