@parca/profile 0.19.111 → 0.19.112

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.19.112](https://github.com/parca-dev/parca/compare/@parca/profile@0.19.111...@parca/profile@0.19.112) (2026-01-15)
7
+
8
+ **Note:** Version bump only for package @parca/profile
9
+
6
10
  ## 0.19.111 (2026-01-15)
7
11
 
8
12
  **Note:** Version bump only for package @parca/profile
@@ -51,7 +51,7 @@ const LineProfileMetadata = ({ value, total, filtered, }) => {
51
51
  }
52
52
  const unfilteredPercent = (Number(value) / Number(total + filtered)) * 100;
53
53
  const filteredPercent = (Number(value) / Number(total)) * 100;
54
- const valueWithUnit = valueFormatter(value, profileSource?.ProfileType().sampleUnit ?? '', 1, true);
54
+ const valueWithUnit = valueFormatter(value, profileSource?.ProfileType().periodUnit ?? '', 1, true);
55
55
  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 })] }));
56
56
  };
57
57
  const charsToWidth = (chars) => {
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/SourceView/index.tsx"],"names":[],"mappings":"AAaA,OAAO,KAAwC,MAAM,OAAO,CAAC;AAM7D,OAAO,EAAC,MAAM,EAAC,MAAM,eAAe,CAAC;AAQrC,UAAU,eAAe;IACvB,OAAO,EAAE,OAAO,CAAC;IACjB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,gBAAgB,CAAC,EAAE,CAAC,OAAO,EAAE,GAAG,CAAC,OAAO,KAAK,IAAI,CAAC;CACnD;AAID,eAAO,MAAM,UAAU,6CAuKrB,CAAC;AAEH,eAAe,UAAU,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/SourceView/index.tsx"],"names":[],"mappings":"AAaA,OAAO,KAAwC,MAAM,OAAO,CAAC;AAM7D,OAAO,EAAC,MAAM,EAAC,MAAM,eAAe,CAAC;AAQrC,UAAU,eAAe;IACvB,OAAO,EAAE,OAAO,CAAC;IACjB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,gBAAgB,CAAC,EAAE,CAAC,OAAO,EAAE,GAAG,CAAC,OAAO,KAAK,IAAI,CAAC;CACnD;AAID,eAAO,MAAM,UAAU,6CAqKrB,CAAC;AAEH,eAAe,UAAU,CAAC"}
@@ -72,7 +72,7 @@ export const SourceView = React.memo(function SourceView({ data, loading, total,
72
72
  }
73
73
  return undefined;
74
74
  }, [sourceTable]);
75
- const getProfileDataForLine = useCallback((line, newLine) => {
75
+ const getProfileDataForLine = useCallback((line) => {
76
76
  const data = getLineData(line);
77
77
  if (data === undefined) {
78
78
  return undefined;
@@ -81,7 +81,7 @@ export const SourceView = React.memo(function SourceView({ data, loading, total,
81
81
  return undefined;
82
82
  }
83
83
  return {
84
- line: newLine,
84
+ line,
85
85
  cumulative: Number(data.cumulative),
86
86
  flat: Number(data.flat),
87
87
  };
@@ -92,22 +92,20 @@ export const SourceView = React.memo(function SourceView({ data, loading, total,
92
92
  }
93
93
  if (startLine === endLine) {
94
94
  const profileData = [];
95
- const profileDataForLine = getProfileDataForLine(startLine, 1);
95
+ const profileDataForLine = getProfileDataForLine(startLine);
96
96
  if (profileDataForLine != null) {
97
97
  profileData.push(profileDataForLine);
98
98
  }
99
99
  return [sourceCode[startLine - 1], profileData];
100
100
  }
101
101
  let code = '';
102
- let line = 1;
103
102
  const profileData = [];
104
103
  for (let i = startLine; i <= endLine; i++) {
105
104
  code += sourceCode[i] + '\n';
106
- const profileDataForLine = getProfileDataForLine(i, line);
105
+ const profileDataForLine = getProfileDataForLine(i);
107
106
  if (profileDataForLine != null) {
108
107
  profileData.push(profileDataForLine);
109
108
  }
110
- line++;
111
109
  }
112
110
  return [code, profileData];
113
111
  }, [startLine, endLine, sourceCode, getProfileDataForLine]);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@parca/profile",
3
- "version": "0.19.111",
3
+ "version": "0.19.112",
4
4
  "description": "Profile viewing libraries",
5
5
  "dependencies": {
6
6
  "@floating-ui/react": "^0.27.12",
@@ -84,5 +84,5 @@
84
84
  "access": "public",
85
85
  "registry": "https://registry.npmjs.org/"
86
86
  },
87
- "gitHead": "77f4ccf0e86c3d2c62f8a24d2d5316b78f24dec7"
87
+ "gitHead": "250c30a141481e91a3d81968d644705dae028ad5"
88
88
  }
@@ -84,7 +84,7 @@ const LineProfileMetadata = ({
84
84
 
85
85
  const valueWithUnit = valueFormatter(
86
86
  value,
87
- profileSource?.ProfileType().sampleUnit ?? '',
87
+ profileSource?.ProfileType().periodUnit ?? '',
88
88
  1,
89
89
  true
90
90
  );
@@ -102,7 +102,7 @@ export const SourceView = React.memo(function SourceView({
102
102
  );
103
103
 
104
104
  const getProfileDataForLine = useCallback(
105
- (line: number, newLine: number): ProfileData | undefined => {
105
+ (line: number): ProfileData | undefined => {
106
106
  const data = getLineData(line);
107
107
  if (data === undefined) {
108
108
  return undefined;
@@ -111,7 +111,7 @@ export const SourceView = React.memo(function SourceView({
111
111
  return undefined;
112
112
  }
113
113
  return {
114
- line: newLine,
114
+ line,
115
115
  cumulative: Number(data.cumulative),
116
116
  flat: Number(data.flat),
117
117
  };
@@ -125,7 +125,7 @@ export const SourceView = React.memo(function SourceView({
125
125
  }
126
126
  if (startLine === endLine) {
127
127
  const profileData: ProfileData[] = [];
128
- const profileDataForLine = getProfileDataForLine(startLine, 1);
128
+ const profileDataForLine = getProfileDataForLine(startLine);
129
129
  if (profileDataForLine != null) {
130
130
  profileData.push(profileDataForLine);
131
131
  }
@@ -133,15 +133,13 @@ export const SourceView = React.memo(function SourceView({
133
133
  return [sourceCode[startLine - 1], profileData];
134
134
  }
135
135
  let code = '';
136
- let line = 1;
137
136
  const profileData: ProfileData[] = [];
138
137
  for (let i = startLine; i <= endLine; i++) {
139
138
  code += sourceCode[i] + '\n';
140
- const profileDataForLine = getProfileDataForLine(i, line);
139
+ const profileDataForLine = getProfileDataForLine(i);
141
140
  if (profileDataForLine != null) {
142
141
  profileData.push(profileDataForLine);
143
142
  }
144
- line++;
145
143
  }
146
144
  return [code, profileData];
147
145
  }, [startLine, endLine, sourceCode, getProfileDataForLine]);