mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 09:19:04 -04:00
[Profiling] Fix decoding of long sequences (#144979)
We store stack frame types with a run-length encoding in Elasticsearch and decode the raw data in Kibana. The current implementation was working fine when the frame type did not change often but failed for long sequences of unique frame types. With this commit we make sure that these longer sequences can also properly decoded. Co-authored-by: Tim Rühsen <tim.ruhsen@elastic.co>
This commit is contained in:
parent
773d696bec
commit
614daf0b15
2 changed files with 5 additions and 1 deletions
|
@ -113,6 +113,10 @@ describe('Run-length encoding operations', () => {
|
|||
data: 'CQM',
|
||||
expected: [3, 3, 3, 3, 3, 3, 3, 3, 3],
|
||||
},
|
||||
{
|
||||
data: 'AQkBCAEHAQYBBQEEAQMBAgEBAQA',
|
||||
expected: [9, 8, 7, 6, 5, 4, 3, 2, 1, 0],
|
||||
},
|
||||
{
|
||||
data: 'EgMHBA',
|
||||
expected: Array(18).fill(3).concat(Array(7).fill(4)),
|
||||
|
|
|
@ -122,7 +122,7 @@ export function runLengthDecodeBase64Url(input: string, size: number, capacity:
|
|||
let i = 0;
|
||||
let j = 0;
|
||||
|
||||
for (i = 0; i < multipleOf8; i += 8) {
|
||||
for (i = 0; i < multipleOf8 * 8; i += 8) {
|
||||
n =
|
||||
(charCodeAt(input, i) << 26) |
|
||||
(charCodeAt(input, i + 1) << 20) |
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue