Skip to content

Sourcerer Improvements#224781

Closed
michaelolo24 wants to merge 2 commits intoelastic:mainfrom
michaelolo24:improve-dataview-performance
Closed

Sourcerer Improvements#224781
michaelolo24 wants to merge 2 commits intoelastic:mainfrom
michaelolo24:improve-dataview-performance

Conversation

@michaelolo24
Copy link
Contributor

Summary

Summarize your PR. If it involves visual changes include a screenshot or gif.

Checklist

Check the PR satisfies following conditions.

Reviewers should verify this PR satisfies this list as well.

  • Any text added follows EUI's writing guidelines, uses sentence case text and includes i18n support
  • Documentation was added for features that require explanation or tutorials
  • Unit or functional tests were updated or added to match the most common scenarios
  • If a plugin configuration key changed, check if it needs to be allowlisted in the cloud and added to the docker list
  • This was checked for breaking HTTP API changes, and any breaking changes have been approved by the breaking-change committee. The release_note:breaking label should be applied in these situations.
  • Flaky Test Runner was used on any tests changed
  • The PR description includes the appropriate Release Notes section, and the correct release_note:* label is applied per the guidelines

Identify risks

Does this PR introduce any risks? For example, consider risks like hard to test bugs, performance regression, potential of data loss.

Describe the risk, its severity, and mitigation for each identified risk. Invite stakeholders and evaluate how to proceed before merging.

@elasticmachine
Copy link
Contributor

🤖 Jobs for this PR can be triggered through checkboxes. 🚧

ℹ️ To trigger the CI, please tick the checkbox below 👇

  • Click to trigger kibana-pull-request for this PR!
  • Click to trigger kibana-deploy-project-from-pr for this PR!
  • Click to trigger kibana-deploy-cloud-from-pr for this PR!

children,
...props
}) => {
const newDataViewPickerEnabled = useIsExperimentalFeatureEnabled('newDataViewPickerEnabled');
Copy link
Contributor Author

Choose a reason for hiding this comment

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

enable cell actions in flyouts

const getFieldSpec = useGetFieldSpec(sourcererScope);
const oldGetFieldSpec = useGetFieldSpec(sourcererScope);

const getFieldSpec = useCallback(
Copy link
Contributor Author

Choose a reason for hiding this comment

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

enable cell actions in explore tables

const indexFieldsSearch = useCallback(
(iNames: string[]) => {
const asyncSearch = async () => {
console.trace('useFetchIndex is deprecated, use useDataView instead: ', indexNames);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

ignore, was using for debugging purposes

fields: 'fields',
},
};
// return {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ignore, need to investigate whats going on here

searchable: false,
}
columns.map((column) =>
newDataViewPickerEnabled
Copy link
Contributor Author

Choose a reason for hiding this comment

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

enable cell actions for alerts table

if (newDataViewPickerEnabled) {
return;
}
if (selectedDataView == null || missingPatterns.length > 0) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@lgestc need to investigate whether one of my changes introduced this, but since defaultDataView is never set in sourcerer...opening up a timeline causes this to run in an infinite loop. Still need to dig into what the code path for this is, but it most likely involves useCreateTimeline and/or useUpdateTimeline

if (existingField && existingField.isMapped) {
// mapped field, remove runtimeField def
existingField.runtimeField = undefined;
this.fields.clearSpecCache();
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Built on top of this PR: #224767 to test performance

expect(savedObjectsClient.find).toHaveBeenCalledTimes(2);
});

test('caches fields toSpec calls', async () => {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Built on top of this PR: #224767 to test performance

* License v3.0 only", or the "Server Side Public License, v 1".
*/

import { fieldList, IIndexPatternFieldList } from './field_list';
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Built on top of this PR: #224767 to test performance

*/
create(field: FieldSpec): DataViewField;

/**
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Built on top of this PR: #224767 to test performance

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants