mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 17:28:26 -04:00
parent
6d1b5cd242
commit
86706e8b53
2 changed files with 15 additions and 8 deletions
|
@ -63,14 +63,14 @@ export const normalized = [ { key: 'next_doc',
|
|||
relative: 0,
|
||||
color: '#f5f5f5',
|
||||
tip: '' },
|
||||
{ key: 'match',
|
||||
time: 0,
|
||||
relative: '0.0',
|
||||
color: '#f5f5f5',
|
||||
tip: 'The time taken to execute a secondary, more precise scoring phase (used by phrase queries).' },
|
||||
{ key: 'match_count',
|
||||
time: 0,
|
||||
relative: 0,
|
||||
color: '#f5f5f5',
|
||||
tip: '' },
|
||||
{ key: 'match',
|
||||
time: 0,
|
||||
relative: '0.0',
|
||||
color: '#f5f5f5',
|
||||
tip: 'The time taken to execute a secondary, more precise scoring phase (used by phrase queries).' }
|
||||
];
|
||||
|
|
|
@ -84,7 +84,7 @@ export function normalizeBreakdown(breakdown) {
|
|||
}
|
||||
return partialTotal;
|
||||
}, 0);
|
||||
Object.keys(breakdown).forEach(key => {
|
||||
Object.keys(breakdown).sort().forEach(key => {
|
||||
let relative = 0;
|
||||
if (key.indexOf('_count') === -1) {
|
||||
relative = ((breakdown[key] / total) * 100).toFixed(1);
|
||||
|
@ -97,8 +97,15 @@ export function normalizeBreakdown(breakdown) {
|
|||
tip: getToolTip(key)
|
||||
});
|
||||
});
|
||||
final.sort((a, b) => comparator(a.time, b.time));
|
||||
return final;
|
||||
|
||||
// Sort by time descending and then key ascending
|
||||
return final.sort((a, b) => {
|
||||
if (comparator(a.time, b.time) !== 0) {
|
||||
return comparator(a.time, b.time);
|
||||
}
|
||||
|
||||
return -1 * comparator(a.key, b.key);
|
||||
});
|
||||
}
|
||||
|
||||
export function normalizeTimes(data, totalTime, depth) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue