Skip to content

Commit

Permalink
Merge branch 'main' into 202255-poc-migration-to-emotion
Browse files Browse the repository at this point in the history
  • Loading branch information
jennypavlova authored Dec 5, 2024
2 parents 8deb498 + f30f0a8 commit 23e74d1
Show file tree
Hide file tree
Showing 6 changed files with 208 additions and 154 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* 2.0.
*/

import { flatten, orderBy, last } from 'lodash';
import { flatten, orderBy, last, clamp, round } from 'lodash';
import { rangeQuery, kqlQuery } from '@kbn/observability-plugin/server';
import { ProcessorEvent } from '@kbn/observability-plugin/common';
import { asPercent } from '../../../../common/utils/formatters';
Expand Down Expand Up @@ -145,9 +145,15 @@ export async function getTransactionBreakdown({
const type = bucket.key as string;

return bucket.subtypes.buckets.map((subBucket) => {
const percentageRaw =
(subBucket.total_self_time_per_subtype.value || 0) / sumAllSelfTimes;
// limit percentage from 0% to 100% and
// round to 8 decimal points (results in 6 decimal points after converting to percentages) to prevent displaying scientific notation in charts
const percentage = round(clamp(percentageRaw, 0, 1), 8);

return {
name: (subBucket.key as string) || type,
percentage: (subBucket.total_self_time_per_subtype.value || 0) / sumAllSelfTimes,
percentage,
};
});
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,13 @@ export const uiSettings: Record<string, UiSettingsParams> = {
defaultMessage:
'A list of base patterns to match and explore data views in Logs Explorer. Remote clusters will be automatically matched for the provided base patterns.',
}),
deprecation: {
message: i18n.translate('xpack.logsExplorer.allowedDataViewsDeprecationWarning', {
defaultMessage:
'Logs Explorer is deprecated, and this setting will be removed in Kibana 9.0.',
}),
docLinksKey: 'generalSettings',
},
type: 'array',
schema: schema.arrayOf(schema.string()),
requiresPageReload: true,
Expand Down
Loading

0 comments on commit 23e74d1

Please sign in to comment.