@parca/profile 0.16.502 → 0.16.504
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 +8 -0
- package/dist/MetricsGraph/UtilizationMetrics/Throughput.d.ts.map +1 -1
- package/dist/MetricsGraph/UtilizationMetrics/Throughput.js +3 -8
- package/dist/MetricsGraph/UtilizationMetrics/index.d.ts.map +1 -1
- package/dist/MetricsGraph/UtilizationMetrics/index.js +2 -2
- package/dist/MetricsGraph/utils/colorMapping.d.ts +8 -0
- package/dist/MetricsGraph/utils/colorMapping.d.ts.map +1 -0
- package/dist/MetricsGraph/utils/colorMapping.js +35 -0
- package/dist/ProfileSelector/MetricsGraphSection.d.ts.map +1 -1
- package/dist/ProfileSelector/MetricsGraphSection.js +3 -1
- package/dist/ProfileView/components/Toolbars/index.d.ts.map +1 -1
- package/dist/ProfileView/components/Toolbars/index.js +7 -1
- package/dist/ProfileViewWithData.d.ts.map +1 -1
- package/dist/ProfileViewWithData.js +3 -1
- package/package.json +2 -2
- package/src/MetricsGraph/UtilizationMetrics/Throughput.tsx +3 -11
- package/src/MetricsGraph/UtilizationMetrics/index.tsx +2 -3
- package/src/MetricsGraph/utils/colorMapping.ts +41 -0
- package/src/ProfileSelector/MetricsGraphSection.tsx +8 -2
- package/src/ProfileView/components/Toolbars/index.tsx +7 -1
- package/src/ProfileViewWithData.tsx +3 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,14 @@
|
|
|
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.504](https://github.com/parca-dev/parca/compare/@parca/profile@0.16.503...@parca/profile@0.16.504) (2025-05-02)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @parca/profile
|
|
9
|
+
|
|
10
|
+
## [0.16.503](https://github.com/parca-dev/parca/compare/@parca/profile@0.16.502...@parca/profile@0.16.503) (2025-04-30)
|
|
11
|
+
|
|
12
|
+
**Note:** Version bump only for package @parca/profile
|
|
13
|
+
|
|
6
14
|
## [0.16.502](https://github.com/parca-dev/parca/compare/@parca/profile@0.16.501...@parca/profile@0.16.502) (2025-04-29)
|
|
7
15
|
|
|
8
16
|
**Note:** Version bump only for package @parca/profile
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Throughput.d.ts","sourceRoot":"","sources":["../../../src/MetricsGraph/UtilizationMetrics/Throughput.tsx"],"names":[],"mappings":"AAqBA,OAAO,EAAC,aAAa,EAAqD,MAAM,mBAAmB,CAAC;AAIpG,OAAO,EAAC,KAAK,kBAAkB,IAAI,YAAY,EAAC,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"Throughput.d.ts","sourceRoot":"","sources":["../../../src/MetricsGraph/UtilizationMetrics/Throughput.tsx"],"names":[],"mappings":"AAqBA,OAAO,EAAC,aAAa,EAAqD,MAAM,mBAAmB,CAAC;AAIpG,OAAO,EAAC,KAAK,kBAAkB,IAAI,YAAY,EAAC,MAAM,uBAAuB,CAAC;AAkB9E,UAAU,WAAW;IACnB,YAAY,EAAE,YAAY,EAAE,CAAC;IAC7B,WAAW,EAAE,YAAY,EAAE,CAAC;IAC5B,eAAe,EAAE,CACf,MAAM,EAAE;QAAC,GAAG,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAC,GAAG,KAAK,CAAC;QAAC,GAAG,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAC,CAAC,KACvE,IAAI,CAAC;IACV,YAAY,EAAE,CAAC,KAAK,EAAE,aAAa,KAAK,IAAI,CAAC;IAC7C,IAAI,EAAE,MAAM,CAAC;IACb,iBAAiB,EAAE,MAAM,CAAC;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,MAAM,CAAC;CACZ;AAQD,KAAK,KAAK,GAAG,WAAW,GAAG;IACzB,yBAAyB,CAAC,EAAE,OAAO,CAAC;CACrC,CAAC;AA0dF,QAAA,MAAM,SAAS,gIAUZ,KAAK,KAAG,GAAG,CAAC,OAiCd,CAAC;AAEF,eAAe,SAAS,CAAC"}
|
|
@@ -22,6 +22,7 @@ import { formatDate, formatForTimespan, getPrecision, valueFormatter } from '@pa
|
|
|
22
22
|
import MetricsContextMenu from '../MetricsContextMenu';
|
|
23
23
|
import MetricsTooltip from '../MetricsTooltip';
|
|
24
24
|
import { useMetricsGraphDimensions } from '../useMetricsGraphDimensions';
|
|
25
|
+
import { getSeriesColor } from '../utils/colorMapping';
|
|
25
26
|
function transformToSeries(data, isReceive = false) {
|
|
26
27
|
const series = data.reduce(function (agg, s) {
|
|
27
28
|
if (s.labelset !== undefined) {
|
|
@@ -120,10 +121,6 @@ const RawAreaChart = ({ transmitData, receiveData, addLabelMatcher, setTimeRange
|
|
|
120
121
|
event: e,
|
|
121
122
|
});
|
|
122
123
|
}, [show]);
|
|
123
|
-
const color = d3.scaleOrdinal(d3.schemeCategory10);
|
|
124
|
-
const getSeriesColor = (series) => {
|
|
125
|
-
return color(series.labelset);
|
|
126
|
-
};
|
|
127
124
|
// Create line generator for both transmit and receive
|
|
128
125
|
const lineGenerator = d3
|
|
129
126
|
.line()
|
|
@@ -229,13 +226,11 @@ const RawAreaChart = ({ transmitData, receiveData, addLabelMatcher, setTimeRange
|
|
|
229
226
|
return false;
|
|
230
227
|
});
|
|
231
228
|
}
|
|
232
|
-
|
|
233
|
-
const strokeOpacity = isSelected ? 1 : 0.8;
|
|
234
|
-
return (_jsx("g", { className: "line cursor-pointer", children: _jsx("path", { d: lineGenerator(s.values) ?? '', fill: "none", stroke: seriesColor, strokeWidth: isSelected
|
|
229
|
+
return (_jsx("g", { className: "line cursor-pointer", children: _jsx("path", { d: lineGenerator(s.values) ?? '', fill: "none", stroke: getSeriesColor(s.metric), strokeWidth: isSelected
|
|
235
230
|
? lineStrokeSelected
|
|
236
231
|
: hovering && highlighted != null && i === highlighted.seriesIndex
|
|
237
232
|
? lineStrokeHover
|
|
238
|
-
: lineStroke, strokeOpacity:
|
|
233
|
+
: lineStroke, strokeOpacity: isSelected ? 1 : 0.8, onClick: () => {
|
|
239
234
|
if (highlighted != null) {
|
|
240
235
|
setSelectedSeries(JSON.stringify(highlighted.labels.map(l => ({
|
|
241
236
|
key: l.name,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/MetricsGraph/UtilizationMetrics/index.tsx"],"names":[],"mappings":"AAqBA,OAAO,EAAC,aAAa,EAAqD,MAAM,mBAAmB,CAAC;AAKpG,OAAO,EAAC,KAAK,kBAAkB,IAAI,YAAY,EAAC,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/MetricsGraph/UtilizationMetrics/index.tsx"],"names":[],"mappings":"AAqBA,OAAO,EAAC,aAAa,EAAqD,MAAM,mBAAmB,CAAC;AAKpG,OAAO,EAAC,KAAK,kBAAkB,IAAI,YAAY,EAAC,MAAM,uBAAuB,CAAC;AAO9E,UAAU,WAAW;IACnB,IAAI,EAAE,YAAY,EAAE,CAAC;IACrB,eAAe,EAAE,CACf,MAAM,EAAE;QAAC,GAAG,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAC,GAAG,KAAK,CAAC;QAAC,GAAG,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAC,CAAC,KACvE,IAAI,CAAC;IACV,YAAY,EAAE,CAAC,KAAK,EAAE,aAAa,KAAK,IAAI,CAAC;IAC7C,IAAI,EAAE,MAAM,CAAC;IACb,iBAAiB,EAAE,MAAM,CAAC;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,MAAM,CAAC;CACZ;AAQD,KAAK,KAAK,GAAG,WAAW,GAAG;IACzB,IAAI,EAAE,YAAY,EAAE,CAAC;IACrB,eAAe,EAAE,CACf,MAAM,EAAE;QAAC,GAAG,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAC,GAAG,KAAK,CAAC;QAAC,GAAG,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAC,CAAC,KACvE,IAAI,CAAC;IACV,YAAY,EAAE,CAAC,KAAK,EAAE,aAAa,KAAK,IAAI,CAAC;IAC7C,yBAAyB,CAAC,EAAE,OAAO,CAAC;CACrC,CAAC;AAkdF,QAAA,MAAM,kBAAkB,2GASrB,KAAK,KAAG,GAAG,CAAC,OAgCd,CAAC;AAEF,eAAe,kBAAkB,CAAC"}
|
|
@@ -23,6 +23,7 @@ import MetricsSeries from '../../MetricsSeries';
|
|
|
23
23
|
import MetricsContextMenu from '../MetricsContextMenu';
|
|
24
24
|
import MetricsTooltip from '../MetricsTooltip';
|
|
25
25
|
import { useMetricsGraphDimensions } from '../useMetricsGraphDimensions';
|
|
26
|
+
import { getSeriesColor } from '../utils/colorMapping';
|
|
26
27
|
function transformToSeries(data) {
|
|
27
28
|
const series = data.reduce(function (agg, s) {
|
|
28
29
|
if (s.labelset !== undefined) {
|
|
@@ -126,7 +127,6 @@ const RawUtilizationMetrics = ({ data, addLabelMatcher, setTimeRange, width, hei
|
|
|
126
127
|
event: e,
|
|
127
128
|
});
|
|
128
129
|
}, [show]);
|
|
129
|
-
const color = d3.scaleOrdinal(d3.schemeCategory10);
|
|
130
130
|
const l = d3.line(d => xScale(d[0]), d => yScale(d[1]));
|
|
131
131
|
const highlighted = useMemo(() => {
|
|
132
132
|
if (series.length === 0) {
|
|
@@ -229,7 +229,7 @@ const RawUtilizationMetrics = ({ data, addLabelMatcher, setTimeRange, width, hei
|
|
|
229
229
|
return false;
|
|
230
230
|
});
|
|
231
231
|
}
|
|
232
|
-
return (_jsx("g", { className: "line cursor-pointer", children: _jsx(MetricsSeries, { data: s, line: l, color:
|
|
232
|
+
return (_jsx("g", { className: "line cursor-pointer", children: _jsx(MetricsSeries, { data: s, line: l, color: getSeriesColor(s.metric), strokeWidth: isSelected
|
|
233
233
|
? lineStrokeSelected
|
|
234
234
|
: hovering && highlighted != null && i === highlighted.seriesIndex
|
|
235
235
|
? lineStrokeHover
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"colorMapping.d.ts","sourceRoot":"","sources":["../../../src/MetricsGraph/utils/colorMapping.ts"],"names":[],"mappings":"AAqBA;;GAEG;AACH,wBAAgB,cAAc,CAAC,MAAM,EAAE,KAAK,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAC,CAAC,GAAG,MAAM,CAgBnF"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
// Copyright 2022 The Parca Authors
|
|
2
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
3
|
+
// you may not use this file except in compliance with the License.
|
|
4
|
+
// You may obtain a copy of the License at
|
|
5
|
+
//
|
|
6
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
|
7
|
+
//
|
|
8
|
+
// Unless required by applicable law or agreed to in writing, software
|
|
9
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
10
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
11
|
+
// See the License for the specific language governing permissions and
|
|
12
|
+
// limitations under the License.
|
|
13
|
+
import * as d3 from 'd3';
|
|
14
|
+
// Cache to store color mappings
|
|
15
|
+
const colorCache = new Map();
|
|
16
|
+
// Create a color scale using d3's category10 scheme
|
|
17
|
+
const colorScale = d3.scaleOrdinal(d3.schemeCategory10);
|
|
18
|
+
/**
|
|
19
|
+
* Generates a consistent color for a series based on its identifying properties
|
|
20
|
+
*/
|
|
21
|
+
export function getSeriesColor(labels) {
|
|
22
|
+
// Create a key from all labels to ensure unique identification
|
|
23
|
+
const key = labels
|
|
24
|
+
.map(l => `${l.name}=${l.value}`)
|
|
25
|
+
.sort()
|
|
26
|
+
.join(',');
|
|
27
|
+
// Return cached color if exists
|
|
28
|
+
if (colorCache.has(key)) {
|
|
29
|
+
return colorCache.get(key);
|
|
30
|
+
}
|
|
31
|
+
// Generate new color and cache it
|
|
32
|
+
const color = colorScale(key);
|
|
33
|
+
colorCache.set(key, color);
|
|
34
|
+
return color;
|
|
35
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MetricsGraphSection.d.ts","sourceRoot":"","sources":["../../src/ProfileSelector/MetricsGraphSection.tsx"],"names":[],"mappings":"AAeA,OAAO,EAAQ,kBAAkB,EAAC,MAAM,eAAe,CAAC;AACxD,OAAO,EAAC,aAAa,EAAC,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAC,KAAK,EAAC,MAAM,eAAe,CAAC;AAEpC,OAAO,EAAyB,gBAAgB,EAAC,MAAM,IAAI,CAAC;AAI5D,OAAO,EAAC,cAAc,EAAE,KAAK,kBAAkB,IAAI,sBAAsB,EAAC,MAAM,SAAS,CAAC;AAE1F,UAAU,wBAAwB;IAChC,gBAAgB,EAAE,OAAO,CAAC;IAC1B,gCAAgC,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IAC3D,WAAW,EAAE,MAAM,CAAC;IACpB,cAAc,EAAE,cAAc,CAAC;IAC/B,gBAAgB,EAAE,gBAAgB,GAAG,IAAI,CAAC;IAC1C,SAAS,EAAE,OAAO,CAAC;IACnB,KAAK,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC;IACvB,mBAAmB,EAAE,OAAO,CAAC;IAC7B,WAAW,EAAE,kBAAkB,CAAC;IAChC,qBAAqB,EAAE,MAAM,CAAC;IAC9B,qBAAqB,EAAE,CAAC,KAAK,EAAE,aAAa,KAAK,IAAI,CAAC;IACtD,WAAW,EAAE,CAAC,KAAK,EAAE,cAAc,KAAK,IAAI,CAAC;IAC7C,aAAa,EAAE,CAAC,MAAM,EAAE,gBAAgB,KAAK,IAAI,CAAC;IAClD,KAAK,EAAE,K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gBAAgB,GAAG,IAAI,CAAC;IAC1C,SAAS,EAAE,OAAO,CAAC;IACnB,KAAK,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC;IACvB,mBAAmB,EAAE,OAAO,CAAC;IAC7B,WAAW,EAAE,kBAAkB,CAAC;IAChC,qBAAqB,EAAE,MAAM,CAAC;IAC9B,qBAAqB,EAAE,CAAC,KAAK,EAAE,aAAa,KAAK,IAAI,CAAC;IACtD,WAAW,EAAE,CAAC,KAAK,EAAE,cAAc,KAAK,IAAI,CAAC;IAC7C,aAAa,EAAE,CAAC,MAAM,EAAE,gBAAgB,KAAK,IAAI,CAAC;IAClD,KAAK,EAAE,KAAK,CAAC;IACb,qBAAqB,EAAE,CAAC,eAAe,EAAE,MAAM,KAAK,IAAI,CAAC;IACzD,kBAAkB,EAAE,CAAC,QAAQ,CAAC,EAAE,OAAO,KAAK,IAAI,CAAC;IACjD,kBAAkB,CAAC,EAAE,KAAK,CAAC;QACzB,IAAI,EAAE,MAAM,CAAC;QACb,iBAAiB,EAAE,MAAM,CAAC;QAC1B,IAAI,EAAE,sBAAsB,EAAE,CAAC;KAChC,CAAC,CAAC;IACH,yBAAyB,CAAC,EAAE,OAAO,CAAC;CACrC;AAED,wBAAgB,mBAAmB,CAAC,EAClC,gBAAgB,EAChB,gCAAgC,EAChC,WAAW,EACX,cAAc,EACd,gBAAgB,EAChB,SAAS,EACT,KAAK,EACL,mBAAmB,EACnB,WAAW,EACX,qBAAqB,EACrB,qBAAqB,EACrB,WAAW,EACX,aAAa,EACb,KAAK,EACL,qBAAqB,EACrB,kBAAkB,EAClB,yBAAyB,GAC1B,EAAE,wBAAwB,GAAG,GAAG,CAAC,OAAO,CAgMxC"}
|
|
@@ -88,7 +88,9 @@ export function MetricsGraphSection({ showMetricsGraph, setDisplayHideMetricsGra
|
|
|
88
88
|
return (_jsx(_Fragment, { children: _jsx(UtilizationMetricsGraph, { data: data, addLabelMatcher: addLabelMatcher, setTimeRange: handleTimeRangeChange, utilizationMetricsLoading: utilizationMetricsLoading, name: name, humanReadableName: humanReadableName, from: querySelection.from, to: querySelection.to }, name) }));
|
|
89
89
|
}
|
|
90
90
|
return null;
|
|
91
|
-
}), throughputMetrics.length > 0 && (_jsx(AreaChart, { transmitData: throughputMetrics
|
|
91
|
+
}), throughputMetrics.length > 0 && (_jsx(AreaChart, { transmitData: throughputMetrics.find(metric => metric.name === 'gpu_pcie_throughput_transmit_bytes')
|
|
92
|
+
?.data ?? [], receiveData: throughputMetrics.find(metric => metric.name === 'gpu_pcie_throughput_receive_bytes')
|
|
93
|
+
?.data ?? [], addLabelMatcher: addLabelMatcher, setTimeRange: handleTimeRangeChange, name: throughputMetrics[0].name, humanReadableName: throughputMetrics[0].humanReadableName, from: querySelection.from, to: querySelection.to, utilizationMetricsLoading: utilizationMetricsLoading }))] }));
|
|
92
94
|
};
|
|
93
95
|
return (_jsxs("div", { className: cx('relative', { 'py-4': !showMetricsGraph }), children: [setDisplayHideMetricsGraphButton != null ? (_jsxs("button", { onClick: () => setDisplayHideMetricsGraphButton(!showMetricsGraph), className: cx('hidden px-3 py-1 text-sm font-medium text-gray-700 dark:text-gray-200 bg-gray-100 rounded-md hover:bg-gray-200 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 dark:bg-gray-900 z-10', showMetricsGraph && 'absolute right-0 bottom-3 !flex', !showMetricsGraph && 'relative !flex ml-auto'), children: [showMetricsGraph ? 'Hide' : 'Show', " Metrics Graph"] })) : null, showMetricsGraph && (_jsx(_Fragment, { children: _jsx("div", { style: { height: heightStyle }, children: querySelection.expression !== '' &&
|
|
94
96
|
querySelection.from !== undefined &&
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/ProfileView/components/Toolbars/index.tsx"],"names":[],"mappings":"AAaA,OAAO,EAAC,EAAE,EAAC,MAAM,OAAO,CAAC;AAIzB,OAAO,EAAC,kBAAkB,EAAC,MAAM,eAAe,CAAC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,CAAC,EAAE,MAAM,CAAC;IAC7B,eAAe,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAC1C,aAAa,EAAE,MAAM,EAAE,CAAC;IACxB,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,6BAA6B,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAChD,cAAc,EAAE,MAAM,IAAI,CAAC;IAC3B,gBAAgB,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,IAAI,CAAC;IAC7C,yBAAyB,CAAC,EAAE,OAAO,CAAC;CACrC;AAED,MAAM,WAAW,iBAAiB;IAChC,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,cAAc,EAAE,MAAM,IAAI,CAAC;IAC3B,mBAAmB,CAAC,EAAE,MAAM,CAAC;CAC9B;AAED,MAAM,WAAW,uBAAuB;IACtC,OAAO,EAAE,gBAAgB,EAAE,CAAC;IAC5B,aAAa,EAAE,CAAC,IAAI,EAAE,gBAAgB,EAAE,KAAK,IAAI,CAAC;CACnD;AAED,eAAO,MAAM,YAAY,EAAE,EAAE,CAAC,iBAAiB,CAuB9C,CAAC;AAEF,eAAO,MAAM,kBAAkB,EAAE,EAAE,CAAC,uBAAuB,CAiB1D,CAAC;AAMF,eAAO,MAAM,oBAAoB,EAAE,EAAE,CAAC,yBAAyB,CAmF9D,CAAC"}
|
|
@@ -20,5 +20,11 @@ export const VisualisationToolbar = ({ groupBy, toggleGroupBy, groupByLabels, se
|
|
|
20
20
|
const { dashboardItems } = useDashboard();
|
|
21
21
|
const isTableViz = dashboardItems?.includes('table');
|
|
22
22
|
const isGraphViz = dashboardItems?.includes('icicle');
|
|
23
|
-
|
|
23
|
+
const req = profileSource?.QueryRequest();
|
|
24
|
+
if (req !== null && req !== undefined) {
|
|
25
|
+
req.groupBy = {
|
|
26
|
+
fields: groupBy ?? [],
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
return (_jsxs(_Fragment, { children: [_jsxs("div", { className: "flex w-full justify-between items-end", children: [_jsxs("div", { className: "flex gap-3 items-end", children: [_jsxs(_Fragment, { children: [_jsx(GroupByDropdown, { groupBy: groupBy, toggleGroupBy: toggleGroupBy, labels: groupByLabels, setGroupByLabels: setGroupByLabels }), _jsx(MultiLevelDropdown, { profileType: profileType, onSelect: () => { } })] }), _jsx(FilterByFunctionButton, {}), profileViewExternalSubActions != null ? profileViewExternalSubActions : null] }), _jsxs("div", { className: "flex gap-3", children: [preferencesModal === true && _jsx(UserPreferencesModal, {}), _jsx(ShareButton, { profileSource: profileSource, queryClient: queryClient, queryRequest: req, onDownloadPProf: onDownloadPProf, pprofdownloading: pprofdownloading ?? false, profileViewExternalSubActions: profileViewExternalSubActions }), showVisualizationSelector ? _jsx(ViewSelector, {}) : null] })] }), isGraphViz && !isTableViz && (_jsxs(_Fragment, { children: [_jsx(Divider, {}), _jsx(IcicleGraphToolbar, { curPath: curPath, setNewCurPath: setNewCurPath })] })), isTableViz && !isGraphViz && (_jsxs(_Fragment, { children: [_jsx(Divider, {}), _jsx(TableToolbar, { profileType: profileType, total: total, filtered: filtered, clearSelection: clearSelection, currentSearchString: currentSearchString })] }))] }));
|
|
24
30
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProfileViewWithData.d.ts","sourceRoot":"","sources":["../src/ProfileViewWithData.tsx"],"names":[],"mappings":"AAeA,OAAO,EAA0B,kBAAkB,EAAC,MAAM,eAAe,CAAC;AAK1E,OAAO,EAAC,aAAa,EAAC,MAAM,iBAAiB,CAAC;AAK9C,UAAU,wBAAwB;IAChC,WAAW,EAAE,kBAAkB,CAAC;IAChC,aAAa,EAAE,aAAa,CAAC;IAC7B,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,yBAAyB,CAAC,EAAE,OAAO,CAAC;CACrC;AAED,eAAO,MAAM,mBAAmB,+DAI7B,wBAAwB,KAAG,GAAG,CAAC,
|
|
1
|
+
{"version":3,"file":"ProfileViewWithData.d.ts","sourceRoot":"","sources":["../src/ProfileViewWithData.tsx"],"names":[],"mappings":"AAeA,OAAO,EAA0B,kBAAkB,EAAC,MAAM,eAAe,CAAC;AAK1E,OAAO,EAAC,aAAa,EAAC,MAAM,iBAAiB,CAAC;AAK9C,UAAU,wBAAwB;IAChC,WAAW,EAAE,kBAAkB,CAAC;IAChC,aAAa,EAAE,aAAa,CAAC;IAC7B,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,yBAAyB,CAAC,EAAE,OAAO,CAAC;CACrC;AAED,eAAO,MAAM,mBAAmB,+DAI7B,wBAAwB,KAAG,GAAG,CAAC,OAqPjC,CAAC;AAEF,eAAe,mBAAmB,CAAC"}
|
|
@@ -107,7 +107,9 @@ export const ProfileViewWithData = ({ queryClient, profileSource, showVisualizat
|
|
|
107
107
|
}
|
|
108
108
|
try {
|
|
109
109
|
setPprofDownloading(true);
|
|
110
|
-
const
|
|
110
|
+
const req = profileSource.QueryRequest();
|
|
111
|
+
req.groupBy = { fields: groupBy };
|
|
112
|
+
const blob = await downloadPprof(req, queryClient, metadata);
|
|
111
113
|
saveAsBlob(blob, `profile.pb.gz`);
|
|
112
114
|
setPprofDownloading(false);
|
|
113
115
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@parca/profile",
|
|
3
|
-
"version": "0.16.
|
|
3
|
+
"version": "0.16.504",
|
|
4
4
|
"description": "Profile viewing libraries",
|
|
5
5
|
"dependencies": {
|
|
6
6
|
"@headlessui/react": "^1.7.19",
|
|
@@ -77,5 +77,5 @@
|
|
|
77
77
|
"access": "public",
|
|
78
78
|
"registry": "https://registry.npmjs.org/"
|
|
79
79
|
},
|
|
80
|
-
"gitHead": "
|
|
80
|
+
"gitHead": "7785690f42c61f65195f1020640c69ea068843f4"
|
|
81
81
|
}
|
|
@@ -27,6 +27,7 @@ import {type UtilizationMetrics as MetricSeries} from '../../ProfileSelector';
|
|
|
27
27
|
import MetricsContextMenu from '../MetricsContextMenu';
|
|
28
28
|
import MetricsTooltip from '../MetricsTooltip';
|
|
29
29
|
import {useMetricsGraphDimensions} from '../useMetricsGraphDimensions';
|
|
30
|
+
import {getSeriesColor} from '../utils/colorMapping';
|
|
30
31
|
|
|
31
32
|
interface NetworkLabel {
|
|
32
33
|
name: string;
|
|
@@ -207,12 +208,6 @@ const RawAreaChart = ({
|
|
|
207
208
|
[show]
|
|
208
209
|
);
|
|
209
210
|
|
|
210
|
-
const color = d3.scaleOrdinal(d3.schemeCategory10);
|
|
211
|
-
|
|
212
|
-
const getSeriesColor = (series: NetworkSeries): string => {
|
|
213
|
-
return color(series.labelset);
|
|
214
|
-
};
|
|
215
|
-
|
|
216
211
|
// Create line generator for both transmit and receive
|
|
217
212
|
const lineGenerator = d3
|
|
218
213
|
.line<number[]>()
|
|
@@ -502,15 +497,12 @@ const RawAreaChart = ({
|
|
|
502
497
|
});
|
|
503
498
|
}
|
|
504
499
|
|
|
505
|
-
const seriesColor = getSeriesColor(s);
|
|
506
|
-
const strokeOpacity = isSelected ? 1 : 0.8;
|
|
507
|
-
|
|
508
500
|
return (
|
|
509
501
|
<g key={i} className="line cursor-pointer">
|
|
510
502
|
<path
|
|
511
503
|
d={lineGenerator(s.values) ?? ''}
|
|
512
504
|
fill="none"
|
|
513
|
-
stroke={
|
|
505
|
+
stroke={getSeriesColor(s.metric)}
|
|
514
506
|
strokeWidth={
|
|
515
507
|
isSelected
|
|
516
508
|
? lineStrokeSelected
|
|
@@ -518,7 +510,7 @@ const RawAreaChart = ({
|
|
|
518
510
|
? lineStrokeHover
|
|
519
511
|
: lineStroke
|
|
520
512
|
}
|
|
521
|
-
strokeOpacity={
|
|
513
|
+
strokeOpacity={isSelected ? 1 : 0.8}
|
|
522
514
|
onClick={() => {
|
|
523
515
|
if (highlighted != null) {
|
|
524
516
|
setSelectedSeries(
|
|
@@ -29,6 +29,7 @@ import MetricsContextMenu from '../MetricsContextMenu';
|
|
|
29
29
|
import MetricsTooltip from '../MetricsTooltip';
|
|
30
30
|
import {type Series} from '../index';
|
|
31
31
|
import {useMetricsGraphDimensions} from '../useMetricsGraphDimensions';
|
|
32
|
+
import {getSeriesColor} from '../utils/colorMapping';
|
|
32
33
|
|
|
33
34
|
interface CommonProps {
|
|
34
35
|
data: MetricSeries[];
|
|
@@ -203,8 +204,6 @@ const RawUtilizationMetrics = ({
|
|
|
203
204
|
[show]
|
|
204
205
|
);
|
|
205
206
|
|
|
206
|
-
const color = d3.scaleOrdinal(d3.schemeCategory10);
|
|
207
|
-
|
|
208
207
|
const l = d3.line(
|
|
209
208
|
d => xScale(d[0]),
|
|
210
209
|
d => yScale(d[1])
|
|
@@ -487,7 +486,7 @@ const RawUtilizationMetrics = ({
|
|
|
487
486
|
<MetricsSeries
|
|
488
487
|
data={s}
|
|
489
488
|
line={l}
|
|
490
|
-
color={
|
|
489
|
+
color={getSeriesColor(s.metric)}
|
|
491
490
|
strokeWidth={
|
|
492
491
|
isSelected
|
|
493
492
|
? lineStrokeSelected
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
// Copyright 2022 The Parca Authors
|
|
2
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
3
|
+
// you may not use this file except in compliance with the License.
|
|
4
|
+
// You may obtain a copy of the License at
|
|
5
|
+
//
|
|
6
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
|
7
|
+
//
|
|
8
|
+
// Unless required by applicable law or agreed to in writing, software
|
|
9
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
10
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
11
|
+
// See the License for the specific language governing permissions and
|
|
12
|
+
// limitations under the License.
|
|
13
|
+
|
|
14
|
+
import * as d3 from 'd3';
|
|
15
|
+
|
|
16
|
+
// Cache to store color mappings
|
|
17
|
+
const colorCache = new Map<string, string>();
|
|
18
|
+
|
|
19
|
+
// Create a color scale using d3's category10 scheme
|
|
20
|
+
const colorScale = d3.scaleOrdinal(d3.schemeCategory10);
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Generates a consistent color for a series based on its identifying properties
|
|
24
|
+
*/
|
|
25
|
+
export function getSeriesColor(labels: Array<{name: string; value: string}>): string {
|
|
26
|
+
// Create a key from all labels to ensure unique identification
|
|
27
|
+
const key = labels
|
|
28
|
+
.map(l => `${l.name}=${l.value}`)
|
|
29
|
+
.sort()
|
|
30
|
+
.join(',');
|
|
31
|
+
|
|
32
|
+
// Return cached color if exists
|
|
33
|
+
if (colorCache.has(key)) {
|
|
34
|
+
return colorCache.get(key)!;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
// Generate new color and cache it
|
|
38
|
+
const color = colorScale(key);
|
|
39
|
+
colorCache.set(key, color);
|
|
40
|
+
return color;
|
|
41
|
+
}
|
|
@@ -184,8 +184,14 @@ export function MetricsGraphSection({
|
|
|
184
184
|
})}
|
|
185
185
|
{throughputMetrics.length > 0 && (
|
|
186
186
|
<AreaChart
|
|
187
|
-
transmitData={
|
|
188
|
-
|
|
187
|
+
transmitData={
|
|
188
|
+
throughputMetrics.find(metric => metric.name === 'gpu_pcie_throughput_transmit_bytes')
|
|
189
|
+
?.data ?? []
|
|
190
|
+
}
|
|
191
|
+
receiveData={
|
|
192
|
+
throughputMetrics.find(metric => metric.name === 'gpu_pcie_throughput_receive_bytes')
|
|
193
|
+
?.data ?? []
|
|
194
|
+
}
|
|
189
195
|
addLabelMatcher={addLabelMatcher}
|
|
190
196
|
setTimeRange={handleTimeRangeChange}
|
|
191
197
|
name={throughputMetrics[0].name}
|
|
@@ -139,6 +139,12 @@ export const VisualisationToolbar: FC<VisualisationToolbarProps> = ({
|
|
|
139
139
|
const isTableViz = dashboardItems?.includes('table');
|
|
140
140
|
const isGraphViz = dashboardItems?.includes('icicle');
|
|
141
141
|
|
|
142
|
+
const req = profileSource?.QueryRequest();
|
|
143
|
+
if (req !== null && req !== undefined) {
|
|
144
|
+
req.groupBy = {
|
|
145
|
+
fields: groupBy ?? [],
|
|
146
|
+
};
|
|
147
|
+
}
|
|
142
148
|
return (
|
|
143
149
|
<>
|
|
144
150
|
<div className="flex w-full justify-between items-end">
|
|
@@ -162,7 +168,7 @@ export const VisualisationToolbar: FC<VisualisationToolbarProps> = ({
|
|
|
162
168
|
<ShareButton
|
|
163
169
|
profileSource={profileSource}
|
|
164
170
|
queryClient={queryClient}
|
|
165
|
-
queryRequest={
|
|
171
|
+
queryRequest={req}
|
|
166
172
|
onDownloadPProf={onDownloadPProf}
|
|
167
173
|
pprofdownloading={pprofdownloading ?? false}
|
|
168
174
|
profileViewExternalSubActions={profileViewExternalSubActions}
|
|
@@ -166,7 +166,9 @@ export const ProfileViewWithData = ({
|
|
|
166
166
|
|
|
167
167
|
try {
|
|
168
168
|
setPprofDownloading(true);
|
|
169
|
-
const
|
|
169
|
+
const req = profileSource.QueryRequest();
|
|
170
|
+
req.groupBy = {fields: groupBy};
|
|
171
|
+
const blob = await downloadPprof(req, queryClient, metadata);
|
|
170
172
|
saveAsBlob(blob, `profile.pb.gz`);
|
|
171
173
|
setPprofDownloading(false);
|
|
172
174
|
} catch (error) {
|