@parca/profile 0.16.350 → 0.16.351

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -3,6 +3,10 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [0.16.351](https://github.com/parca-dev/parca/compare/@parca/profile@0.16.350...@parca/profile@0.16.351) (2024-02-28)
7
+
8
+ **Note:** Version bump only for package @parca/profile
9
+
6
10
  ## 0.16.350 (2024-02-28)
7
11
 
8
12
  # 0.21.0 (2024-02-27)
@@ -18,6 +18,7 @@ import SyntaxHighlighter, { createElement } from 'react-syntax-highlighter';
18
18
  import { atomOneDark, atomOneLight } from 'react-syntax-highlighter/dist/esm/styles/hljs';
19
19
  import { Tooltip } from 'react-tooltip';
20
20
  import { useParcaContext } from '@parca/components';
21
+ import { valueFormatter } from '@parca/utilities';
21
22
  import { useProfileViewContext } from '../ProfileView/ProfileViewContext';
22
23
  import { LineNo } from './LineNo';
23
24
  import { langaugeFromFile } from './lang-detector';
@@ -49,9 +50,8 @@ const LineProfileMetadata = ({ value, total, filtered, }) => {
49
50
  }
50
51
  const unfilteredPercent = (Number(value) / Number(total + filtered)) * 100;
51
52
  const filteredPercent = (Number(value) / Number(total)) * 100;
52
- const valueString = value.toString();
53
- const valueWithUnit = `${valueString}${sampleUnit}`;
54
- return (_jsxs(_Fragment, { children: [_jsx("p", { className: cx('w- flex justify-end overflow-hidden text-ellipsis whitespace-nowrap', commonClasses), style: { backgroundColor: `rgba(236, 151, 6, ${intensityScale(unfilteredPercent)})` }, "data-tooltip-id": id, "data-tooltip-content": `${valueWithUnit} (${unfilteredPercent.toFixed(2)}%${filtered > 0n ? ` / ${filteredPercent.toFixed(2)}%` : ''})`, children: valueString }), _jsx(Tooltip, { id: id })] }));
53
+ const valueWithUnit = valueFormatter(value, sampleUnit, 1, true);
54
+ return (_jsxs(_Fragment, { children: [_jsx("p", { className: cx('w- flex justify-end overflow-hidden text-ellipsis whitespace-nowrap', commonClasses), style: { backgroundColor: `rgba(236, 151, 6, ${intensityScale(unfilteredPercent)})` }, "data-tooltip-id": id, "data-tooltip-content": `${valueWithUnit} (${unfilteredPercent.toFixed(2)}%${filtered > 0n ? ` / ${filteredPercent.toFixed(2)}%` : ''})`, children: valueWithUnit }), _jsx(Tooltip, { id: id })] }));
55
55
  };
56
56
  const charsToWidth = (chars) => {
57
57
  return charsToWidthMap[chars];
package/package.json CHANGED
@@ -1,15 +1,15 @@
1
1
  {
2
2
  "name": "@parca/profile",
3
- "version": "0.16.350",
3
+ "version": "0.16.351",
4
4
  "description": "Profile viewing libraries",
5
5
  "dependencies": {
6
6
  "@parca/client": "^0.16.106",
7
- "@parca/components": "^0.16.258",
7
+ "@parca/components": "^0.16.259",
8
8
  "@parca/dynamicsize": "^0.16.61",
9
9
  "@parca/hooks": "^0.0.44",
10
10
  "@parca/parser": "^0.16.69",
11
- "@parca/store": "^0.16.132",
12
- "@parca/utilities": "^0.0.60",
11
+ "@parca/store": "^0.16.133",
12
+ "@parca/utilities": "^0.0.61",
13
13
  "@tanstack/react-query": "^4.0.5",
14
14
  "@types/react-beautiful-dnd": "^13.1.8",
15
15
  "apache-arrow": "^12.0.0",
@@ -50,5 +50,5 @@
50
50
  "access": "public",
51
51
  "registry": "https://registry.npmjs.org/"
52
52
  },
53
- "gitHead": "4ca1395ad920b41cf74465ab5679796f98a6f930"
53
+ "gitHead": "f92df4afcaf89ccbf154cb3df4f9272b12b98622"
54
54
  }
@@ -21,6 +21,7 @@ import {atomOneDark, atomOneLight} from 'react-syntax-highlighter/dist/esm/style
21
21
  import {Tooltip} from 'react-tooltip';
22
22
 
23
23
  import {useParcaContext} from '@parca/components';
24
+ import {valueFormatter} from '@parca/utilities';
24
25
 
25
26
  import {useProfileViewContext} from '../ProfileView/ProfileViewContext';
26
27
  import {LineNo} from './LineNo';
@@ -80,8 +81,7 @@ const LineProfileMetadata = ({
80
81
  const unfilteredPercent = (Number(value) / Number(total + filtered)) * 100;
81
82
  const filteredPercent = (Number(value) / Number(total)) * 100;
82
83
 
83
- const valueString = value.toString();
84
- const valueWithUnit = `${valueString}${sampleUnit}`;
84
+ const valueWithUnit = valueFormatter(value, sampleUnit, 1, true);
85
85
 
86
86
  return (
87
87
  <>
@@ -96,7 +96,7 @@ const LineProfileMetadata = ({
96
96
  filtered > 0n ? ` / ${filteredPercent.toFixed(2)}%` : ''
97
97
  })`}
98
98
  >
99
- {valueString}
99
+ {valueWithUnit}
100
100
  </p>
101
101
  <Tooltip id={id} />
102
102
  </>