@parca/profile 0.16.329 → 0.16.331

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,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.331](https://github.com/parca-dev/parca/compare/@parca/profile@0.16.330...@parca/profile@0.16.331) (2024-01-05)
7
+
8
+ **Note:** Version bump only for package @parca/profile
9
+
10
+ ## [0.16.330](https://github.com/parca-dev/parca/compare/@parca/profile@0.16.329...@parca/profile@0.16.330) (2024-01-03)
11
+
12
+ **Note:** Version bump only for package @parca/profile
13
+
6
14
  ## [0.16.329](https://github.com/parca-dev/parca/compare/@parca/profile@0.16.328...@parca/profile@0.16.329) (2024-01-03)
7
15
 
8
16
  **Note:** Version bump only for package @parca/profile
@@ -30,7 +30,7 @@ const getExpressionAsAString = (expression) => {
30
30
  const DEFAULT_DASHBOARD_ITEMS = ['icicle'];
31
31
  /* eslint-disable @typescript-eslint/naming-convention */
32
32
  const sanitizeDateRange = (time_selection_a, from_a, to_a) => {
33
- const range = DateTimeRange.fromRangeKey(time_selection_a);
33
+ const range = DateTimeRange.fromRangeKey(time_selection_a, from_a, to_a);
34
34
  if (from_a == null && to_a == null) {
35
35
  from_a = range.getFromMs();
36
36
  to_a = range.getToMs();
@@ -45,7 +45,7 @@ const ProfileSelector = ({ queryClient, querySelection, selectProfile, selectQue
45
45
  const [isDataLoading, setIsDataLoading] = useState(false);
46
46
  const { heightStyle } = useMetricsGraphDimensions(comparing);
47
47
  const { viewComponent } = useParcaContext();
48
- const [timeRangeSelection, setTimeRangeSelection] = useState(DateTimeRange.fromRangeKey(querySelection.timeSelection));
48
+ const [timeRangeSelection, setTimeRangeSelection] = useState(DateTimeRange.fromRangeKey(querySelection.timeSelection, querySelection.from, querySelection.to));
49
49
  const [queryExpressionString, setQueryExpressionString] = useState(querySelection.expression);
50
50
  useEffect(() => {
51
51
  if (querySelection.expression === undefined) {
@@ -73,11 +73,11 @@ const ProfileSelector = ({ queryClient, querySelection, selectProfile, selectQue
73
73
  };
74
74
  const query = enforcedProfileName !== '' ? enforcedProfileNameQuery() : Query.parse(queryExpressionString);
75
75
  const selectedProfileName = query.profileName();
76
- const setNewQueryExpression = (expr) => {
76
+ const setNewQueryExpression = (expr, updateTs = false) => {
77
77
  const query = enforcedProfileName !== '' ? enforcedProfileNameQuery() : Query.parse(expr);
78
78
  const delta = query.profileType().delta;
79
- const from = timeRangeSelection.getFromMs();
80
- const to = timeRangeSelection.getToMs();
79
+ const from = timeRangeSelection.getFromMs(updateTs);
80
+ const to = timeRangeSelection.getToMs(updateTs);
81
81
  const mergeParams = delta
82
82
  ? {
83
83
  mergeFrom: from,
@@ -92,8 +92,8 @@ const ProfileSelector = ({ queryClient, querySelection, selectProfile, selectQue
92
92
  ...mergeParams,
93
93
  });
94
94
  };
95
- const setQueryExpression = () => {
96
- setNewQueryExpression(query.toString());
95
+ const setQueryExpression = (updateTs = false) => {
96
+ setNewQueryExpression(query.toString(), updateTs);
97
97
  };
98
98
  const addLabelMatcher = (labels) => {
99
99
  // When a user clicks on a label on the metrics graph tooltip,
@@ -157,7 +157,7 @@ const ProfileSelector = ({ queryClient, querySelection, selectProfile, selectQue
157
157
  return (_jsxs(_Fragment, { children: [_jsxs("div", { className: "mb-2 flex gap-2", children: [_jsxs("div", { className: "flex w-full flex-wrap content-start items-center justify-between gap-2", children: [_jsxs("div", { className: "pb-6", children: [_jsx("label", { className: "text-xs", children: "Profile type" }), _jsx(ProfileTypeSelector, { profileTypesData: profileTypesData, loading: profileTypesLoading, selectedKey: selectedProfileName, onSelection: setProfileName, error: error })] }), _jsxs("div", { className: "w-full flex-1 pb-6", children: [_jsxs("div", { className: "mb-0.5 mt-1.5 flex items-center justify-between", children: [_jsx("label", { className: "text-xs", children: "Query" }), (query.matchers.length > 0 || query.inputMatcherString.length > 0) &&
158
158
  viewComponent !== undefined && _jsx("div", { children: viewComponent?.createViewComponent })] }), _jsx(MatchersInput, { queryClient: queryClient, setMatchersString: setMatchersString, runQuery: setQueryExpression, currentQuery: query })] }), _jsx(DateTimeRangePicker, { onRangeSelection: setTimeRangeSelection, range: timeRangeSelection }), _jsxs(ButtonGroup, { children: [!searchDisabled && (_jsx(_Fragment, { children: !comparing && (_jsx(CompareButton, { disabled: compareDisabled, onClick: handleCompareClick })) })), _jsx(Button, { disabled: searchDisabled, onClick: (e) => {
159
159
  e.preventDefault();
160
- setQueryExpression();
160
+ setQueryExpression(true);
161
161
  }, id: "matcher-search-button", children: "Search" })] })] }), _jsx("div", { children: comparing && _jsx(IconButton, { onClick: () => closeProfile(), icon: _jsx(CloseIcon, {}) }) })] }), _jsx("div", { className: "rounded bg-white shadow dark:border-gray-500 dark:bg-gray-700", children: _jsx("div", { style: { height: heightStyle }, children: !isDataLoading &&
162
162
  querySelection.expression !== undefined &&
163
163
  querySelection.expression.length > 0 &&
@@ -16,8 +16,7 @@ export interface ProfileSelection {
16
16
  ProfileSource: () => ProfileSource;
17
17
  Type: () => string;
18
18
  }
19
- export declare const timeFormat = "MMM d, 'at' h:mm:s a '(UTC)'";
20
- export declare const timeFormatShort = "MMM d, h:mma";
19
+ export declare const timeFormat = "MMM d, 'at' HH:mm:ss '(UTC)'";
21
20
  export declare function ParamsString(params: {
22
21
  [key: string]: string;
23
22
  }): string;
@@ -14,8 +14,7 @@ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-run
14
14
  import { ProfileDiffSelection_Mode, QueryRequest_Mode, QueryRequest_ReportType, Timestamp, } from '@parca/client';
15
15
  import { ProfileType, Query } from '@parca/parser';
16
16
  import { formatDate } from '@parca/utilities';
17
- export const timeFormat = "MMM d, 'at' h:mm:s a '(UTC)'";
18
- export const timeFormatShort = 'MMM d, h:mma';
17
+ export const timeFormat = "MMM d, 'at' HH:mm:ss '(UTC)'";
19
18
  export function ParamsString(params) {
20
19
  return Object.keys(params)
21
20
  .map(function (key) {
package/package.json CHANGED
@@ -1,15 +1,15 @@
1
1
  {
2
2
  "name": "@parca/profile",
3
- "version": "0.16.329",
3
+ "version": "0.16.331",
4
4
  "description": "Profile viewing libraries",
5
5
  "dependencies": {
6
6
  "@parca/client": "^0.16.100",
7
- "@parca/components": "^0.16.240",
7
+ "@parca/components": "^0.16.242",
8
8
  "@parca/dynamicsize": "^0.16.60",
9
9
  "@parca/hooks": "^0.0.38",
10
10
  "@parca/parser": "^0.16.68",
11
- "@parca/store": "^0.16.121",
12
- "@parca/utilities": "^0.0.49",
11
+ "@parca/store": "^0.16.122",
12
+ "@parca/utilities": "^0.0.50",
13
13
  "@tanstack/react-query": "^4.0.5",
14
14
  "@types/react-beautiful-dnd": "^13.1.3",
15
15
  "apache-arrow": "^12.0.0",
@@ -40,7 +40,7 @@
40
40
  "test": "jest --coverage --config ../../../jest.config.js ./src/*",
41
41
  "prepublish": "yarn build",
42
42
  "build": "tsc && yarn compile:styles",
43
- "watch": "tsc-watch --onSuccess 'yarn compile:styles'",
43
+ "watch": "tsc-watch --onCompilationComplete 'yarn compile:styles'",
44
44
  "compile:styles": "tailwindcss -o dist/styles.css --minify"
45
45
  },
46
46
  "keywords": [],
@@ -50,5 +50,5 @@
50
50
  "access": "public",
51
51
  "registry": "https://registry.npmjs.org/"
52
52
  },
53
- "gitHead": "609093d9e68e941b4daf85dc99ae622c320b0e46"
53
+ "gitHead": "42c203727e73b372def7eb2b608a4231787f324d"
54
54
  }
@@ -55,7 +55,7 @@ const sanitizeDateRange = (
55
55
  from_a: number,
56
56
  to_a: number
57
57
  ): {time_selection_a: string; from_a: number; to_a: number} => {
58
- const range = DateTimeRange.fromRangeKey(time_selection_a);
58
+ const range = DateTimeRange.fromRangeKey(time_selection_a, from_a, to_a);
59
59
  if (from_a == null && to_a == null) {
60
60
  from_a = range.getFromMs();
61
61
  to_a = range.getToMs();
@@ -105,7 +105,7 @@ const ProfileSelector = ({
105
105
  const {viewComponent} = useParcaContext();
106
106
 
107
107
  const [timeRangeSelection, setTimeRangeSelection] = useState(
108
- DateTimeRange.fromRangeKey(querySelection.timeSelection)
108
+ DateTimeRange.fromRangeKey(querySelection.timeSelection, querySelection.from, querySelection.to)
109
109
  );
110
110
 
111
111
  const [queryExpressionString, setQueryExpressionString] = useState(querySelection.expression);
@@ -116,7 +116,6 @@ const ProfileSelector = ({
116
116
  }
117
117
 
118
118
  setIsDataLoading(true);
119
-
120
119
  setQueryExpression();
121
120
  setIsDataLoading(false);
122
121
 
@@ -146,11 +145,11 @@ const ProfileSelector = ({
146
145
  enforcedProfileName !== '' ? enforcedProfileNameQuery() : Query.parse(queryExpressionString);
147
146
  const selectedProfileName = query.profileName();
148
147
 
149
- const setNewQueryExpression = (expr: string): void => {
148
+ const setNewQueryExpression = (expr: string, updateTs = false): void => {
150
149
  const query = enforcedProfileName !== '' ? enforcedProfileNameQuery() : Query.parse(expr);
151
150
  const delta = query.profileType().delta;
152
- const from = timeRangeSelection.getFromMs();
153
- const to = timeRangeSelection.getToMs();
151
+ const from = timeRangeSelection.getFromMs(updateTs);
152
+ const to = timeRangeSelection.getToMs(updateTs);
154
153
  const mergeParams = delta
155
154
  ? {
156
155
  mergeFrom: from,
@@ -167,8 +166,8 @@ const ProfileSelector = ({
167
166
  });
168
167
  };
169
168
 
170
- const setQueryExpression = (): void => {
171
- setNewQueryExpression(query.toString());
169
+ const setQueryExpression = (updateTs = false): void => {
170
+ setNewQueryExpression(query.toString(), updateTs);
172
171
  };
173
172
 
174
173
  const addLabelMatcher = (
@@ -286,7 +285,7 @@ const ProfileSelector = ({
286
285
  disabled={searchDisabled}
287
286
  onClick={(e: React.MouseEvent<HTMLElement>) => {
288
287
  e.preventDefault();
289
- setQueryExpression();
288
+ setQueryExpression(true);
290
289
  }}
291
290
  id="matcher-search-button"
292
291
  >
@@ -38,8 +38,7 @@ export interface ProfileSelection {
38
38
  Type: () => string;
39
39
  }
40
40
 
41
- export const timeFormat = "MMM d, 'at' h:mm:s a '(UTC)'";
42
- export const timeFormatShort = 'MMM d, h:mma';
41
+ export const timeFormat = "MMM d, 'at' HH:mm:ss '(UTC)'";
43
42
 
44
43
  export function ParamsString(params: {[key: string]: string}): string {
45
44
  return Object.keys(params)