Skip to content
This repository was archived by the owner on Sep 10, 2024. It is now read-only.

Conversation

@inge4pres
Copy link

Summary

This is a draft
Here we introduce the usage of the data plugin.

The plugin can be handy to simplify client/server interaction but it comes with a less-widely-open API.
Instead of the REST methods we are using now, it would use an /internal/bsearch endpoint that I still have to explore.

This PR starts implementing it and has some other refactoring that were needed to work with the plugin, such as using shared types between client and server.

I'd like to get a feedback from you about the ergonomics and the possible limitations (still working on implementing the search strategy client-side, working on it atm).

@inge4pres inge4pres added the help wanted Extra attention is needed label Mar 2, 2022
@inge4pres inge4pres requested review from jbcrail and rockdaboot March 2, 2022 18:10
@inge4pres inge4pres self-assigned this Mar 2, 2022
@inge4pres inge4pres changed the title Fg/use data plugin Use Kibana data plugin and search strategy Mar 2, 2022
@inge4pres inge4pres force-pushed the fg/use-data-plugin branch from 09d07f2 to 9d3f241 Compare March 4, 2022 18:52
@inge4pres inge4pres changed the base branch from main to fg/types-refactor March 4, 2022 18:53
@inge4pres
Copy link
Author

@jbcrail @rockdaboot I just updated the PR as we discussed earlier.
I'll check again how to make the UI work with the data plugin in this PR and then we can measure the differences in terms of ergonomic and data trasnferred with the clients.

es.search(
{
params: {
index: downsampledIndex + initialExp,

Choose a reason for hiding this comment

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

downsampleIndex sounds as if it holds an index name, which is not true - it only holds the prefix. To help understanding the code, I suggest using a function getDownsampledIndex(initialExp).

const initialExp = 6;
const targetSampleSize = 20000; // minimum number of samples to get statistically sound results

// Calculate the right down-sampled index to query data from

Choose a reason for hiding this comment

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

This comment is wrong, describes not what the function does.

});
return sampleCount;
};
return {

Choose a reason for hiding this comment

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

Please add an empty line before the return.

},
},
} as IEsSearchRequest;
return es.search(downsampledReq, options, deps);

Choose a reason for hiding this comment

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

Please add an empty line before the return.

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

Labels

help wanted Extra attention is needed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants