kibana/examples/response_stream/server
Walter Rafelsberger 0ab24e566c
[ML] AIOps: Use Kibana's http service instead of fetch, fix throttling. (#162335)
- Originally Kibana's `http` service did not support receiving streams,
that's why we used plain `fetch` for this. This has been fixed in
#158678, so this PR updates the streaming helpers to use Kibana's `http`
service from now on.
- The PR also breaks out the response stream code into its own package
and restructures it to separate client and server side code. This brings
down the `aiops` bundle size by `~300KB`! 🥳
- The approach to client side throttling/buffering was also revamped:
There was an issue doing the throttling inside the generator function,
it always waited for the timeout. The buffering is now removed from
`fetchStream`, instead `useThrottle` from `react-use` is used on the
reduced `data` in `useFetchStream`. Loading log rate analysis results
got a lot snappier with this update!
2023-07-27 08:57:10 +02:00
..
routes [ML] AIOps: Use Kibana's http service instead of fetch, fix throttling. (#162335) 2023-07-27 08:57:10 +02:00
index.ts [ML] Explain log rate spikes: Move API stream demos to Kibana examples. (#132590) 2022-05-24 16:59:31 +02:00
plugin.ts chore(NA): eslint rule for disallowing naked eslint-disable (#136408) 2022-07-19 17:11:04 +01:00