[pmg-devel] applied: [PATCH pmg-api] api: journal: stream the journal data to the client
Thomas Lamprecht
t.lamprecht at proxmox.com
Wed Nov 24 18:58:27 CET 2021
On 24.11.21 15:48, Dominik Csapak wrote:
> instead of accumulating the whole output of 'mini-journalreader' in
> the api call (this can be quite big), use the download mechanic of the
> http-server to stream the output to the client.
>
> we lose some error handling possibilities, but we do not have
> to allocate anything here, and since perl does not free memory after
> allocating[0] this is our desired behaviour.
>
> to keep api compatiblitiy, we need to give the journalreader the '-j'
> flag to let it output json.
>
> also tell the http server that the encoding is gzip and pipe
> the output through it.
>
> 0: https://perldoc.perl.org/perlfaq3#How-can-I-free-an-array-or-hash-so-my-program-shrinks?
>
> Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
> ---
> this is basically a 1:1 copy of the changes in pve-manager[0]
> obviously needs the changes from http-server and mini-journalreader
> from[1]
>
> 0: https://lists.proxmox.com/pipermail/pve-devel/2021-November/051072.html
> 1: https://lists.proxmox.com/pipermail/pve-devel/2021-November/051070.html
>
> src/PMG/API2/Nodes.pm | 22 ++++++++++++++--------
> 1 file changed, 14 insertions(+), 8 deletions(-)
>
>
applied, thanks!
More information about the pmg-devel
mailing list