rails-profiler 0.34.1 → 0.34.2
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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +27 -0
- data/app/assets/builds/profiler-toolbar.js +14 -3
- data/app/assets/builds/profiler.js +103 -85
- data/app/controllers/profiler/assets_controller.rb +14 -11
- data/lib/profiler/mcp/tools/explain_query.rb +3 -0
- data/lib/profiler/version.rb +1 -1
- metadata +7 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: b6365d7a34d882d20ca0257247629d6099917508ad78cecc96726dc6788c7a75
|
|
4
|
+
data.tar.gz: e7dffe134ddcac64202aae83bb73963837068ae258b1cdc1d959e78504b31861
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 8912bad06bc0824942c4e696d9fd408dff3a76238af92faaa7c262815e477e3850fe90c14d9acd6ceced45271180c990c8d6d597cf591d998eae48edf3dc9e11
|
|
7
|
+
data.tar.gz: aeb7cec816ce9de90ab3dcc72629d36c6f9b1ff69bfa618416e72fa5cbb6301cae5a5d12dd09d6d0a4c247c76095c397777dad9f42a18bbf5aaafa7d375b7248
|
data/CHANGELOG.md
CHANGED
|
@@ -19,6 +19,33 @@ every commit of every tag interval is accounted for one way or the other.
|
|
|
19
19
|
|
|
20
20
|
## [Unreleased]
|
|
21
21
|
|
|
22
|
+
## [0.34.2] - 2026-10-15
|
|
23
|
+
|
|
24
|
+
<!-- stamped -->
|
|
25
|
+
|
|
26
|
+
### Changed
|
|
27
|
+
|
|
28
|
+
- **Dependencies:** The gem now requires `mcp` below 2.0 (`>= 0.3, < 2`). The upper bound keeps
|
|
29
|
+
a future major of `mcp` from being picked up by `bundle update` and breaking the MCP server; the
|
|
30
|
+
test suite passes on both ends of the range, `mcp` 0.3.0 and 1.7.0. An application already on
|
|
31
|
+
`mcp` 2.x would have to stay on an earlier version of the gem until it supports it.
|
|
32
|
+
|
|
33
|
+
### Fixed
|
|
34
|
+
|
|
35
|
+
- **MCP:** `explain_query` called against an unknown, offline or refused slave profiler now answers the dedicated message (`Error: Unknown slave profiler: ...`) instead of the generic `EXPLAIN failed`.
|
|
36
|
+
- **Assets:** The toolbar assets endpoints now answer a 404 that names the command to run (`yarn build:full` in the gem) when `app/assets/builds/` is empty or incomplete, instead of a 500.
|
|
37
|
+
|
|
38
|
+
### Security
|
|
39
|
+
|
|
40
|
+
- **Build:** The client the dashboard is built from is now generated with `orval` 8
|
|
41
|
+
(`^8.41.0`, locked at 8.41.0) instead of 7.21.0, which carried eleven critical advisories of
|
|
42
|
+
code execution while generating from an OpenAPI document. `orval` only runs when the assets are
|
|
43
|
+
built, never in an application using the gem, and the generated client calls the same URLs with
|
|
44
|
+
the same methods and cache keys as before. Building the assets now needs Node.js 22.18 or later.
|
|
45
|
+
- **CI:** A `yarn:audit` job reports the advisories at level high and above on the JavaScript
|
|
46
|
+
build dependencies. It is informational: a finding shows as a warning and does not hold back a
|
|
47
|
+
publication.
|
|
48
|
+
|
|
22
49
|
## [0.34.1] - 2026-10-15
|
|
23
50
|
|
|
24
51
|
<!-- stamped -->
|
|
@@ -4211,6 +4211,18 @@
|
|
|
4211
4211
|
}
|
|
4212
4212
|
|
|
4213
4213
|
// app/assets/typescript/profiler/generated/api.ts
|
|
4214
|
+
var withQueryKey = (query, queryKey) => {
|
|
4215
|
+
const result = { queryKey };
|
|
4216
|
+
for (const key of Object.keys(query)) {
|
|
4217
|
+
if (key === "queryKey") continue;
|
|
4218
|
+
Object.defineProperty(result, key, {
|
|
4219
|
+
enumerable: true,
|
|
4220
|
+
configurable: true,
|
|
4221
|
+
get: () => query[key]
|
|
4222
|
+
});
|
|
4223
|
+
}
|
|
4224
|
+
return result;
|
|
4225
|
+
};
|
|
4214
4226
|
var getToolbar = (token, signal) => {
|
|
4215
4227
|
return apiFetch(
|
|
4216
4228
|
{
|
|
@@ -4229,13 +4241,12 @@
|
|
|
4229
4241
|
const { query: queryOptions } = options ?? {};
|
|
4230
4242
|
const queryKey = queryOptions?.queryKey ?? getGetToolbarQueryKey(token);
|
|
4231
4243
|
const queryFn = ({ signal }) => getToolbar(token, signal);
|
|
4232
|
-
return { queryKey, queryFn, enabled:
|
|
4244
|
+
return { queryKey, queryFn, enabled: token !== null && token !== void 0, ...queryOptions };
|
|
4233
4245
|
};
|
|
4234
4246
|
function useGetToolbar(token, options) {
|
|
4235
4247
|
const queryOptions = getGetToolbarQueryOptions(token, options);
|
|
4236
4248
|
const query = useQuery(queryOptions);
|
|
4237
|
-
query
|
|
4238
|
-
return query;
|
|
4249
|
+
return withQueryKey(query, queryOptions.queryKey);
|
|
4239
4250
|
}
|
|
4240
4251
|
|
|
4241
4252
|
// app/assets/typescript/profiler/hooks/profileUpdatePoller.ts
|
|
@@ -3472,6 +3472,18 @@
|
|
|
3472
3472
|
}
|
|
3473
3473
|
|
|
3474
3474
|
// app/assets/typescript/profiler/generated/api.ts
|
|
3475
|
+
var withQueryKey = (query, queryKey) => {
|
|
3476
|
+
const result = { queryKey };
|
|
3477
|
+
for (const key of Object.keys(query)) {
|
|
3478
|
+
if (key === "queryKey") continue;
|
|
3479
|
+
Object.defineProperty(result, key, {
|
|
3480
|
+
enumerable: true,
|
|
3481
|
+
configurable: true,
|
|
3482
|
+
get: () => query[key]
|
|
3483
|
+
});
|
|
3484
|
+
}
|
|
3485
|
+
return result;
|
|
3486
|
+
};
|
|
3475
3487
|
var listConsoles = (params, signal) => {
|
|
3476
3488
|
return apiFetch(
|
|
3477
3489
|
{
|
|
@@ -3498,19 +3510,20 @@
|
|
|
3498
3510
|
function useListConsolesInfinite(params, options) {
|
|
3499
3511
|
const queryOptions = getListConsolesInfiniteQueryOptions(params, options);
|
|
3500
3512
|
const query = useInfiniteQuery(queryOptions);
|
|
3501
|
-
query
|
|
3502
|
-
return query;
|
|
3513
|
+
return withQueryKey(query, queryOptions.queryKey);
|
|
3503
3514
|
}
|
|
3504
|
-
var deleteConsole = (id) => {
|
|
3515
|
+
var deleteConsole = (id, signal) => {
|
|
3505
3516
|
return apiFetch(
|
|
3506
3517
|
{
|
|
3507
3518
|
url: `/_profiler/api/console/${id}`,
|
|
3508
|
-
method: "DELETE"
|
|
3519
|
+
method: "DELETE",
|
|
3520
|
+
signal
|
|
3509
3521
|
}
|
|
3510
3522
|
);
|
|
3511
3523
|
};
|
|
3524
|
+
var getDeleteConsoleMutationKey = () => ["deleteConsole"];
|
|
3512
3525
|
var getDeleteConsoleMutationOptions = (options) => {
|
|
3513
|
-
const mutationKey =
|
|
3526
|
+
const mutationKey = getDeleteConsoleMutationKey();
|
|
3514
3527
|
const { mutation: mutationOptions } = options ? options.mutation && "mutationKey" in options.mutation && options.mutation.mutationKey ? options : { ...options, mutation: { ...options.mutation, mutationKey } } : { mutation: { mutationKey } };
|
|
3515
3528
|
const mutationFn = (props) => {
|
|
3516
3529
|
const { id } = props ?? {};
|
|
@@ -3519,19 +3532,20 @@
|
|
|
3519
3532
|
return { mutationFn, ...mutationOptions };
|
|
3520
3533
|
};
|
|
3521
3534
|
var useDeleteConsole = (options) => {
|
|
3522
|
-
|
|
3523
|
-
return useMutation(mutationOptions);
|
|
3535
|
+
return useMutation(getDeleteConsoleMutationOptions(options));
|
|
3524
3536
|
};
|
|
3525
|
-
var clearConsoles = () => {
|
|
3537
|
+
var clearConsoles = (signal) => {
|
|
3526
3538
|
return apiFetch(
|
|
3527
3539
|
{
|
|
3528
3540
|
url: `/_profiler/api/console/clear`,
|
|
3529
|
-
method: "DELETE"
|
|
3541
|
+
method: "DELETE",
|
|
3542
|
+
signal
|
|
3530
3543
|
}
|
|
3531
3544
|
);
|
|
3532
3545
|
};
|
|
3546
|
+
var getClearConsolesMutationKey = () => ["clearConsoles"];
|
|
3533
3547
|
var getClearConsolesMutationOptions = (options) => {
|
|
3534
|
-
const mutationKey =
|
|
3548
|
+
const mutationKey = getClearConsolesMutationKey();
|
|
3535
3549
|
const { mutation: mutationOptions } = options ? options.mutation && "mutationKey" in options.mutation && options.mutation.mutationKey ? options : { ...options, mutation: { ...options.mutation, mutationKey } } : { mutation: { mutationKey } };
|
|
3536
3550
|
const mutationFn = () => {
|
|
3537
3551
|
return clearConsoles();
|
|
@@ -3539,8 +3553,7 @@
|
|
|
3539
3553
|
return { mutationFn, ...mutationOptions };
|
|
3540
3554
|
};
|
|
3541
3555
|
var useClearConsoles = (options) => {
|
|
3542
|
-
|
|
3543
|
-
return useMutation(mutationOptions);
|
|
3556
|
+
return useMutation(getClearConsolesMutationOptions(options));
|
|
3544
3557
|
};
|
|
3545
3558
|
var getEnvVars = (signal) => {
|
|
3546
3559
|
return apiFetch(
|
|
@@ -3565,21 +3578,22 @@
|
|
|
3565
3578
|
function useGetEnvVars(options) {
|
|
3566
3579
|
const queryOptions = getGetEnvVarsQueryOptions(options);
|
|
3567
3580
|
const query = useQuery(queryOptions);
|
|
3568
|
-
query
|
|
3569
|
-
return query;
|
|
3581
|
+
return withQueryKey(query, queryOptions.queryKey);
|
|
3570
3582
|
}
|
|
3571
|
-
var updateEnvVar = (updateEnvVarBody) => {
|
|
3583
|
+
var updateEnvVar = (updateEnvVarBody, signal) => {
|
|
3572
3584
|
return apiFetch(
|
|
3573
3585
|
{
|
|
3574
3586
|
url: `/_profiler/api/env_vars`,
|
|
3575
3587
|
method: "PATCH",
|
|
3576
3588
|
headers: { "Content-Type": "application/json" },
|
|
3577
|
-
data: updateEnvVarBody
|
|
3589
|
+
data: updateEnvVarBody,
|
|
3590
|
+
signal
|
|
3578
3591
|
}
|
|
3579
3592
|
);
|
|
3580
3593
|
};
|
|
3594
|
+
var getUpdateEnvVarMutationKey = () => ["updateEnvVar"];
|
|
3581
3595
|
var getUpdateEnvVarMutationOptions = (options) => {
|
|
3582
|
-
const mutationKey =
|
|
3596
|
+
const mutationKey = getUpdateEnvVarMutationKey();
|
|
3583
3597
|
const { mutation: mutationOptions } = options ? options.mutation && "mutationKey" in options.mutation && options.mutation.mutationKey ? options : { ...options, mutation: { ...options.mutation, mutationKey } } : { mutation: { mutationKey } };
|
|
3584
3598
|
const mutationFn = (props) => {
|
|
3585
3599
|
const { data } = props ?? {};
|
|
@@ -3588,20 +3602,21 @@
|
|
|
3588
3602
|
return { mutationFn, ...mutationOptions };
|
|
3589
3603
|
};
|
|
3590
3604
|
var useUpdateEnvVar = (options) => {
|
|
3591
|
-
|
|
3592
|
-
return useMutation(mutationOptions);
|
|
3605
|
+
return useMutation(getUpdateEnvVarMutationOptions(options));
|
|
3593
3606
|
};
|
|
3594
|
-
var resetEnvVar = (params) => {
|
|
3607
|
+
var resetEnvVar = (params, signal) => {
|
|
3595
3608
|
return apiFetch(
|
|
3596
3609
|
{
|
|
3597
3610
|
url: `/_profiler/api/env_vars/reset`,
|
|
3598
3611
|
method: "DELETE",
|
|
3599
|
-
params
|
|
3612
|
+
params,
|
|
3613
|
+
signal
|
|
3600
3614
|
}
|
|
3601
3615
|
);
|
|
3602
3616
|
};
|
|
3617
|
+
var getResetEnvVarMutationKey = () => ["resetEnvVar"];
|
|
3603
3618
|
var getResetEnvVarMutationOptions = (options) => {
|
|
3604
|
-
const mutationKey =
|
|
3619
|
+
const mutationKey = getResetEnvVarMutationKey();
|
|
3605
3620
|
const { mutation: mutationOptions } = options ? options.mutation && "mutationKey" in options.mutation && options.mutation.mutationKey ? options : { ...options, mutation: { ...options.mutation, mutationKey } } : { mutation: { mutationKey } };
|
|
3606
3621
|
const mutationFn = (props) => {
|
|
3607
3622
|
const { params } = props ?? {};
|
|
@@ -3610,19 +3625,20 @@
|
|
|
3610
3625
|
return { mutationFn, ...mutationOptions };
|
|
3611
3626
|
};
|
|
3612
3627
|
var useResetEnvVar = (options) => {
|
|
3613
|
-
|
|
3614
|
-
return useMutation(mutationOptions);
|
|
3628
|
+
return useMutation(getResetEnvVarMutationOptions(options));
|
|
3615
3629
|
};
|
|
3616
|
-
var resetAllEnvVars = () => {
|
|
3630
|
+
var resetAllEnvVars = (signal) => {
|
|
3617
3631
|
return apiFetch(
|
|
3618
3632
|
{
|
|
3619
3633
|
url: `/_profiler/api/env_vars/reset_all`,
|
|
3620
|
-
method: "DELETE"
|
|
3634
|
+
method: "DELETE",
|
|
3635
|
+
signal
|
|
3621
3636
|
}
|
|
3622
3637
|
);
|
|
3623
3638
|
};
|
|
3639
|
+
var getResetAllEnvVarsMutationKey = () => ["resetAllEnvVars"];
|
|
3624
3640
|
var getResetAllEnvVarsMutationOptions = (options) => {
|
|
3625
|
-
const mutationKey =
|
|
3641
|
+
const mutationKey = getResetAllEnvVarsMutationKey();
|
|
3626
3642
|
const { mutation: mutationOptions } = options ? options.mutation && "mutationKey" in options.mutation && options.mutation.mutationKey ? options : { ...options, mutation: { ...options.mutation, mutationKey } } : { mutation: { mutationKey } };
|
|
3627
3643
|
const mutationFn = () => {
|
|
3628
3644
|
return resetAllEnvVars();
|
|
@@ -3630,8 +3646,7 @@
|
|
|
3630
3646
|
return { mutationFn, ...mutationOptions };
|
|
3631
3647
|
};
|
|
3632
3648
|
var useResetAllEnvVars = (options) => {
|
|
3633
|
-
|
|
3634
|
-
return useMutation(mutationOptions);
|
|
3649
|
+
return useMutation(getResetAllEnvVarsMutationOptions(options));
|
|
3635
3650
|
};
|
|
3636
3651
|
var explainQuery = (explainQueryBody, signal) => {
|
|
3637
3652
|
return apiFetch(
|
|
@@ -3644,8 +3659,9 @@
|
|
|
3644
3659
|
}
|
|
3645
3660
|
);
|
|
3646
3661
|
};
|
|
3662
|
+
var getExplainQueryMutationKey = () => ["explainQuery"];
|
|
3647
3663
|
var getExplainQueryMutationOptions = (options) => {
|
|
3648
|
-
const mutationKey =
|
|
3664
|
+
const mutationKey = getExplainQueryMutationKey();
|
|
3649
3665
|
const { mutation: mutationOptions } = options ? options.mutation && "mutationKey" in options.mutation && options.mutation.mutationKey ? options : { ...options, mutation: { ...options.mutation, mutationKey } } : { mutation: { mutationKey } };
|
|
3650
3666
|
const mutationFn = (props) => {
|
|
3651
3667
|
const { data } = props ?? {};
|
|
@@ -3654,21 +3670,22 @@
|
|
|
3654
3670
|
return { mutationFn, ...mutationOptions };
|
|
3655
3671
|
};
|
|
3656
3672
|
var useExplainQuery = (options) => {
|
|
3657
|
-
|
|
3658
|
-
return useMutation(mutationOptions);
|
|
3673
|
+
return useMutation(getExplainQueryMutationOptions(options));
|
|
3659
3674
|
};
|
|
3660
|
-
var updateFunctionProfiling = (updateFunctionProfilingBody) => {
|
|
3675
|
+
var updateFunctionProfiling = (updateFunctionProfilingBody, signal) => {
|
|
3661
3676
|
return apiFetch(
|
|
3662
3677
|
{
|
|
3663
3678
|
url: `/_profiler/api/function_profiling`,
|
|
3664
3679
|
method: "PATCH",
|
|
3665
3680
|
headers: { "Content-Type": "application/json" },
|
|
3666
|
-
data: updateFunctionProfilingBody
|
|
3681
|
+
data: updateFunctionProfilingBody,
|
|
3682
|
+
signal
|
|
3667
3683
|
}
|
|
3668
3684
|
);
|
|
3669
3685
|
};
|
|
3686
|
+
var getUpdateFunctionProfilingMutationKey = () => ["updateFunctionProfiling"];
|
|
3670
3687
|
var getUpdateFunctionProfilingMutationOptions = (options) => {
|
|
3671
|
-
const mutationKey =
|
|
3688
|
+
const mutationKey = getUpdateFunctionProfilingMutationKey();
|
|
3672
3689
|
const { mutation: mutationOptions } = options ? options.mutation && "mutationKey" in options.mutation && options.mutation.mutationKey ? options : { ...options, mutation: { ...options.mutation, mutationKey } } : { mutation: { mutationKey } };
|
|
3673
3690
|
const mutationFn = (props) => {
|
|
3674
3691
|
const { data } = props ?? {};
|
|
@@ -3677,8 +3694,7 @@
|
|
|
3677
3694
|
return { mutationFn, ...mutationOptions };
|
|
3678
3695
|
};
|
|
3679
3696
|
var useUpdateFunctionProfiling = (options) => {
|
|
3680
|
-
|
|
3681
|
-
return useMutation(mutationOptions);
|
|
3697
|
+
return useMutation(getUpdateFunctionProfilingMutationOptions(options));
|
|
3682
3698
|
};
|
|
3683
3699
|
var listJobs = (params, signal) => {
|
|
3684
3700
|
return apiFetch(
|
|
@@ -3706,19 +3722,20 @@
|
|
|
3706
3722
|
function useListJobsInfinite(params, options) {
|
|
3707
3723
|
const queryOptions = getListJobsInfiniteQueryOptions(params, options);
|
|
3708
3724
|
const query = useInfiniteQuery(queryOptions);
|
|
3709
|
-
query
|
|
3710
|
-
return query;
|
|
3725
|
+
return withQueryKey(query, queryOptions.queryKey);
|
|
3711
3726
|
}
|
|
3712
|
-
var deleteJob = (id) => {
|
|
3727
|
+
var deleteJob = (id, signal) => {
|
|
3713
3728
|
return apiFetch(
|
|
3714
3729
|
{
|
|
3715
3730
|
url: `/_profiler/api/jobs/${id}`,
|
|
3716
|
-
method: "DELETE"
|
|
3731
|
+
method: "DELETE",
|
|
3732
|
+
signal
|
|
3717
3733
|
}
|
|
3718
3734
|
);
|
|
3719
3735
|
};
|
|
3736
|
+
var getDeleteJobMutationKey = () => ["deleteJob"];
|
|
3720
3737
|
var getDeleteJobMutationOptions = (options) => {
|
|
3721
|
-
const mutationKey =
|
|
3738
|
+
const mutationKey = getDeleteJobMutationKey();
|
|
3722
3739
|
const { mutation: mutationOptions } = options ? options.mutation && "mutationKey" in options.mutation && options.mutation.mutationKey ? options : { ...options, mutation: { ...options.mutation, mutationKey } } : { mutation: { mutationKey } };
|
|
3723
3740
|
const mutationFn = (props) => {
|
|
3724
3741
|
const { id } = props ?? {};
|
|
@@ -3727,19 +3744,20 @@
|
|
|
3727
3744
|
return { mutationFn, ...mutationOptions };
|
|
3728
3745
|
};
|
|
3729
3746
|
var useDeleteJob = (options) => {
|
|
3730
|
-
|
|
3731
|
-
return useMutation(mutationOptions);
|
|
3747
|
+
return useMutation(getDeleteJobMutationOptions(options));
|
|
3732
3748
|
};
|
|
3733
|
-
var clearJobs = () => {
|
|
3749
|
+
var clearJobs = (signal) => {
|
|
3734
3750
|
return apiFetch(
|
|
3735
3751
|
{
|
|
3736
3752
|
url: `/_profiler/api/jobs/clear`,
|
|
3737
|
-
method: "DELETE"
|
|
3753
|
+
method: "DELETE",
|
|
3754
|
+
signal
|
|
3738
3755
|
}
|
|
3739
3756
|
);
|
|
3740
3757
|
};
|
|
3758
|
+
var getClearJobsMutationKey = () => ["clearJobs"];
|
|
3741
3759
|
var getClearJobsMutationOptions = (options) => {
|
|
3742
|
-
const mutationKey =
|
|
3760
|
+
const mutationKey = getClearJobsMutationKey();
|
|
3743
3761
|
const { mutation: mutationOptions } = options ? options.mutation && "mutationKey" in options.mutation && options.mutation.mutationKey ? options : { ...options, mutation: { ...options.mutation, mutationKey } } : { mutation: { mutationKey } };
|
|
3744
3762
|
const mutationFn = () => {
|
|
3745
3763
|
return clearJobs();
|
|
@@ -3747,8 +3765,7 @@
|
|
|
3747
3765
|
return { mutationFn, ...mutationOptions };
|
|
3748
3766
|
};
|
|
3749
3767
|
var useClearJobs = (options) => {
|
|
3750
|
-
|
|
3751
|
-
return useMutation(mutationOptions);
|
|
3768
|
+
return useMutation(getClearJobsMutationOptions(options));
|
|
3752
3769
|
};
|
|
3753
3770
|
var listOutboundRequests = (signal) => {
|
|
3754
3771
|
return apiFetch(
|
|
@@ -3773,8 +3790,7 @@
|
|
|
3773
3790
|
function useListOutboundRequests(options) {
|
|
3774
3791
|
const queryOptions = getListOutboundRequestsQueryOptions(options);
|
|
3775
3792
|
const query = useQuery(queryOptions);
|
|
3776
|
-
query
|
|
3777
|
-
return query;
|
|
3793
|
+
return withQueryKey(query, queryOptions.queryKey);
|
|
3778
3794
|
}
|
|
3779
3795
|
var listProfiles = (params, signal) => {
|
|
3780
3796
|
return apiFetch(
|
|
@@ -3802,19 +3818,20 @@
|
|
|
3802
3818
|
function useListProfilesInfinite(params, options) {
|
|
3803
3819
|
const queryOptions = getListProfilesInfiniteQueryOptions(params, options);
|
|
3804
3820
|
const query = useInfiniteQuery(queryOptions);
|
|
3805
|
-
query
|
|
3806
|
-
return query;
|
|
3821
|
+
return withQueryKey(query, queryOptions.queryKey);
|
|
3807
3822
|
}
|
|
3808
|
-
var deleteProfile = (id) => {
|
|
3823
|
+
var deleteProfile = (id, signal) => {
|
|
3809
3824
|
return apiFetch(
|
|
3810
3825
|
{
|
|
3811
3826
|
url: `/_profiler/api/profiles/${id}`,
|
|
3812
|
-
method: "DELETE"
|
|
3827
|
+
method: "DELETE",
|
|
3828
|
+
signal
|
|
3813
3829
|
}
|
|
3814
3830
|
);
|
|
3815
3831
|
};
|
|
3832
|
+
var getDeleteProfileMutationKey = () => ["deleteProfile"];
|
|
3816
3833
|
var getDeleteProfileMutationOptions = (options) => {
|
|
3817
|
-
const mutationKey =
|
|
3834
|
+
const mutationKey = getDeleteProfileMutationKey();
|
|
3818
3835
|
const { mutation: mutationOptions } = options ? options.mutation && "mutationKey" in options.mutation && options.mutation.mutationKey ? options : { ...options, mutation: { ...options.mutation, mutationKey } } : { mutation: { mutationKey } };
|
|
3819
3836
|
const mutationFn = (props) => {
|
|
3820
3837
|
const { id } = props ?? {};
|
|
@@ -3823,19 +3840,20 @@
|
|
|
3823
3840
|
return { mutationFn, ...mutationOptions };
|
|
3824
3841
|
};
|
|
3825
3842
|
var useDeleteProfile = (options) => {
|
|
3826
|
-
|
|
3827
|
-
return useMutation(mutationOptions);
|
|
3843
|
+
return useMutation(getDeleteProfileMutationOptions(options));
|
|
3828
3844
|
};
|
|
3829
|
-
var clearProfiles = () => {
|
|
3845
|
+
var clearProfiles = (signal) => {
|
|
3830
3846
|
return apiFetch(
|
|
3831
3847
|
{
|
|
3832
3848
|
url: `/_profiler/api/profiles/clear`,
|
|
3833
|
-
method: "DELETE"
|
|
3849
|
+
method: "DELETE",
|
|
3850
|
+
signal
|
|
3834
3851
|
}
|
|
3835
3852
|
);
|
|
3836
3853
|
};
|
|
3854
|
+
var getClearProfilesMutationKey = () => ["clearProfiles"];
|
|
3837
3855
|
var getClearProfilesMutationOptions = (options) => {
|
|
3838
|
-
const mutationKey =
|
|
3856
|
+
const mutationKey = getClearProfilesMutationKey();
|
|
3839
3857
|
const { mutation: mutationOptions } = options ? options.mutation && "mutationKey" in options.mutation && options.mutation.mutationKey ? options : { ...options, mutation: { ...options.mutation, mutationKey } } : { mutation: { mutationKey } };
|
|
3840
3858
|
const mutationFn = () => {
|
|
3841
3859
|
return clearProfiles();
|
|
@@ -3843,8 +3861,7 @@
|
|
|
3843
3861
|
return { mutationFn, ...mutationOptions };
|
|
3844
3862
|
};
|
|
3845
3863
|
var useClearProfiles = (options) => {
|
|
3846
|
-
|
|
3847
|
-
return useMutation(mutationOptions);
|
|
3864
|
+
return useMutation(getClearProfilesMutationOptions(options));
|
|
3848
3865
|
};
|
|
3849
3866
|
var getTestRunnerFiles = (params, signal) => {
|
|
3850
3867
|
return apiFetch(
|
|
@@ -3871,8 +3888,7 @@
|
|
|
3871
3888
|
function useGetTestRunnerFiles(params, options) {
|
|
3872
3889
|
const queryOptions = getGetTestRunnerFilesQueryOptions(params, options);
|
|
3873
3890
|
const query = useQuery(queryOptions);
|
|
3874
|
-
query
|
|
3875
|
-
return query;
|
|
3891
|
+
return withQueryKey(query, queryOptions.queryKey);
|
|
3876
3892
|
}
|
|
3877
3893
|
var createTestRun = (createTestRunBody, signal) => {
|
|
3878
3894
|
return apiFetch(
|
|
@@ -3885,8 +3901,9 @@
|
|
|
3885
3901
|
}
|
|
3886
3902
|
);
|
|
3887
3903
|
};
|
|
3904
|
+
var getCreateTestRunMutationKey = () => ["createTestRun"];
|
|
3888
3905
|
var getCreateTestRunMutationOptions = (options) => {
|
|
3889
|
-
const mutationKey =
|
|
3906
|
+
const mutationKey = getCreateTestRunMutationKey();
|
|
3890
3907
|
const { mutation: mutationOptions } = options ? options.mutation && "mutationKey" in options.mutation && options.mutation.mutationKey ? options : { ...options, mutation: { ...options.mutation, mutationKey } } : { mutation: { mutationKey } };
|
|
3891
3908
|
const mutationFn = (props) => {
|
|
3892
3909
|
const { data } = props ?? {};
|
|
@@ -3895,19 +3912,20 @@
|
|
|
3895
3912
|
return { mutationFn, ...mutationOptions };
|
|
3896
3913
|
};
|
|
3897
3914
|
var useCreateTestRun = (options) => {
|
|
3898
|
-
|
|
3899
|
-
return useMutation(mutationOptions);
|
|
3915
|
+
return useMutation(getCreateTestRunMutationOptions(options));
|
|
3900
3916
|
};
|
|
3901
|
-
var deleteTestRun = (id) => {
|
|
3917
|
+
var deleteTestRun = (id, signal) => {
|
|
3902
3918
|
return apiFetch(
|
|
3903
3919
|
{
|
|
3904
3920
|
url: `/_profiler/api/test_runner/runs/${id}`,
|
|
3905
|
-
method: "DELETE"
|
|
3921
|
+
method: "DELETE",
|
|
3922
|
+
signal
|
|
3906
3923
|
}
|
|
3907
3924
|
);
|
|
3908
3925
|
};
|
|
3926
|
+
var getDeleteTestRunMutationKey = () => ["deleteTestRun"];
|
|
3909
3927
|
var getDeleteTestRunMutationOptions = (options) => {
|
|
3910
|
-
const mutationKey =
|
|
3928
|
+
const mutationKey = getDeleteTestRunMutationKey();
|
|
3911
3929
|
const { mutation: mutationOptions } = options ? options.mutation && "mutationKey" in options.mutation && options.mutation.mutationKey ? options : { ...options, mutation: { ...options.mutation, mutationKey } } : { mutation: { mutationKey } };
|
|
3912
3930
|
const mutationFn = (props) => {
|
|
3913
3931
|
const { id } = props ?? {};
|
|
@@ -3916,8 +3934,7 @@
|
|
|
3916
3934
|
return { mutationFn, ...mutationOptions };
|
|
3917
3935
|
};
|
|
3918
3936
|
var useDeleteTestRun = (options) => {
|
|
3919
|
-
|
|
3920
|
-
return useMutation(mutationOptions);
|
|
3937
|
+
return useMutation(getDeleteTestRunMutationOptions(options));
|
|
3921
3938
|
};
|
|
3922
3939
|
var listTests = (params, signal) => {
|
|
3923
3940
|
return apiFetch(
|
|
@@ -3945,19 +3962,20 @@
|
|
|
3945
3962
|
function useListTestsInfinite(params, options) {
|
|
3946
3963
|
const queryOptions = getListTestsInfiniteQueryOptions(params, options);
|
|
3947
3964
|
const query = useInfiniteQuery(queryOptions);
|
|
3948
|
-
query
|
|
3949
|
-
return query;
|
|
3965
|
+
return withQueryKey(query, queryOptions.queryKey);
|
|
3950
3966
|
}
|
|
3951
|
-
var deleteTest = (id) => {
|
|
3967
|
+
var deleteTest = (id, signal) => {
|
|
3952
3968
|
return apiFetch(
|
|
3953
3969
|
{
|
|
3954
3970
|
url: `/_profiler/api/tests/${id}`,
|
|
3955
|
-
method: "DELETE"
|
|
3971
|
+
method: "DELETE",
|
|
3972
|
+
signal
|
|
3956
3973
|
}
|
|
3957
3974
|
);
|
|
3958
3975
|
};
|
|
3976
|
+
var getDeleteTestMutationKey = () => ["deleteTest"];
|
|
3959
3977
|
var getDeleteTestMutationOptions = (options) => {
|
|
3960
|
-
const mutationKey =
|
|
3978
|
+
const mutationKey = getDeleteTestMutationKey();
|
|
3961
3979
|
const { mutation: mutationOptions } = options ? options.mutation && "mutationKey" in options.mutation && options.mutation.mutationKey ? options : { ...options, mutation: { ...options.mutation, mutationKey } } : { mutation: { mutationKey } };
|
|
3962
3980
|
const mutationFn = (props) => {
|
|
3963
3981
|
const { id } = props ?? {};
|
|
@@ -3966,19 +3984,20 @@
|
|
|
3966
3984
|
return { mutationFn, ...mutationOptions };
|
|
3967
3985
|
};
|
|
3968
3986
|
var useDeleteTest = (options) => {
|
|
3969
|
-
|
|
3970
|
-
return useMutation(mutationOptions);
|
|
3987
|
+
return useMutation(getDeleteTestMutationOptions(options));
|
|
3971
3988
|
};
|
|
3972
|
-
var clearTests = () => {
|
|
3989
|
+
var clearTests = (signal) => {
|
|
3973
3990
|
return apiFetch(
|
|
3974
3991
|
{
|
|
3975
3992
|
url: `/_profiler/api/tests/clear`,
|
|
3976
|
-
method: "DELETE"
|
|
3993
|
+
method: "DELETE",
|
|
3994
|
+
signal
|
|
3977
3995
|
}
|
|
3978
3996
|
);
|
|
3979
3997
|
};
|
|
3998
|
+
var getClearTestsMutationKey = () => ["clearTests"];
|
|
3980
3999
|
var getClearTestsMutationOptions = (options) => {
|
|
3981
|
-
const mutationKey =
|
|
4000
|
+
const mutationKey = getClearTestsMutationKey();
|
|
3982
4001
|
const { mutation: mutationOptions } = options ? options.mutation && "mutationKey" in options.mutation && options.mutation.mutationKey ? options : { ...options, mutation: { ...options.mutation, mutationKey } } : { mutation: { mutationKey } };
|
|
3983
4002
|
const mutationFn = () => {
|
|
3984
4003
|
return clearTests();
|
|
@@ -3986,8 +4005,7 @@
|
|
|
3986
4005
|
return { mutationFn, ...mutationOptions };
|
|
3987
4006
|
};
|
|
3988
4007
|
var useClearTests = (options) => {
|
|
3989
|
-
|
|
3990
|
-
return useMutation(mutationOptions);
|
|
4008
|
+
return useMutation(getClearTestsMutationOptions(options));
|
|
3991
4009
|
};
|
|
3992
4010
|
|
|
3993
4011
|
// app/assets/typescript/profiler/dashboard/utils.ts
|
|
@@ -8,25 +8,28 @@ module Profiler
|
|
|
8
8
|
skip_before_action :check_authorization
|
|
9
9
|
skip_before_action :authorize_request
|
|
10
10
|
|
|
11
|
+
BUILD_MISSING = "Profiler assets are not built (%s is missing). Run `yarn build:full` in the profiler gem."
|
|
12
|
+
|
|
11
13
|
def toolbar_js
|
|
12
|
-
|
|
13
|
-
js = File.read(path)
|
|
14
|
-
expires_in 1.hour, public: true
|
|
15
|
-
render plain: js, content_type: "application/javascript"
|
|
14
|
+
serve("profiler-toolbar.js", "application/javascript")
|
|
16
15
|
end
|
|
17
16
|
|
|
18
17
|
def main_js
|
|
19
|
-
|
|
20
|
-
js = File.read(path)
|
|
21
|
-
expires_in 1.hour, public: true
|
|
22
|
-
render plain: js, content_type: "application/javascript"
|
|
18
|
+
serve("profiler.js", "application/javascript")
|
|
23
19
|
end
|
|
24
20
|
|
|
25
21
|
def main_css
|
|
26
|
-
|
|
27
|
-
|
|
22
|
+
serve("profiler.css", "text/css")
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
private
|
|
26
|
+
|
|
27
|
+
def serve(name, content_type)
|
|
28
|
+
body = File.read(Profiler::Engine.root.join("app", "assets", "builds", name))
|
|
28
29
|
expires_in 1.hour, public: true
|
|
29
|
-
render plain:
|
|
30
|
+
render plain: body, content_type: content_type
|
|
31
|
+
rescue Errno::ENOENT
|
|
32
|
+
render plain: format(BUILD_MISSING, name), status: :not_found
|
|
30
33
|
end
|
|
31
34
|
end
|
|
32
35
|
end
|
|
@@ -49,6 +49,9 @@ module Profiler
|
|
|
49
49
|
[{ type: "text", text: lines.join("\n") }]
|
|
50
50
|
rescue Profiler::ExplainRunner::RefusedError => e
|
|
51
51
|
[{ type: "text", text: "Error: #{e.message}" }]
|
|
52
|
+
rescue Profiler::Error => e
|
|
53
|
+
# The profiler's own refusals (unknown, offline or refused slave) carry a message made for the caller.
|
|
54
|
+
[{ type: "text", text: "Error: #{e.message}" }]
|
|
52
55
|
rescue StandardError => e
|
|
53
56
|
# The database's message carries the SQL, and sometimes a path: the log only.
|
|
54
57
|
Profiler.log_error("MCP explain_query: failed for query #{query_index.to_i} of profile #{token.to_s.inspect}", e)
|
data/lib/profiler/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: rails-profiler
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.34.
|
|
4
|
+
version: 0.34.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Sébastien Duplessy
|
|
@@ -59,6 +59,9 @@ dependencies:
|
|
|
59
59
|
- - ">="
|
|
60
60
|
- !ruby/object:Gem::Version
|
|
61
61
|
version: '0.3'
|
|
62
|
+
- - "<"
|
|
63
|
+
- !ruby/object:Gem::Version
|
|
64
|
+
version: '2'
|
|
62
65
|
type: :runtime
|
|
63
66
|
prerelease: false
|
|
64
67
|
version_requirements: !ruby/object:Gem::Requirement
|
|
@@ -66,6 +69,9 @@ dependencies:
|
|
|
66
69
|
- - ">="
|
|
67
70
|
- !ruby/object:Gem::Version
|
|
68
71
|
version: '0.3'
|
|
72
|
+
- - "<"
|
|
73
|
+
- !ruby/object:Gem::Version
|
|
74
|
+
version: '2'
|
|
69
75
|
- !ruby/object:Gem::Dependency
|
|
70
76
|
name: webmock
|
|
71
77
|
requirement: !ruby/object:Gem::Requirement
|