-
Notifications
You must be signed in to change notification settings - Fork 5.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore: migrate to new deno_core and metrics #21057
Conversation
mmastrac
commented
Nov 2, 2023
•
edited
Loading
edited
- Uses the new OpMetrics system for sync and async calls
- Partial revert of feat: enable Array.fromAsync #21048 as we moved Array.fromAsync upstream to deno_core
/bench http[minimal,realistic] |
Benchmark failed! 😵 start: id: server: |
/bench http[minimal,realistic] |
http[minimal]
http[realistic]
start: id: server: |
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license. | ||
import { assert, assertEquals } from "./test_util.ts"; | ||
|
||
Deno.test(async function metrics() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is tested in deno_core now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's still keep it?
@@ -412,19 +412,6 @@ Deno.test(function clearTimeoutAndClearIntervalNotBeEquals() { | |||
assertNotEquals(clearTimeout, clearInterval); | |||
}); | |||
|
|||
Deno.test(async function timerMaxCpuBug() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I couldn't think of a good way to replicate this test without using metrics... thoughts?
e727161
to
2b8e654
Compare
@@ -3425,11 +3425,6 @@ itest!(unstable_ffi_19 { | |||
exit_code: 70, | |||
}); | |||
|
|||
itest!(future_check2 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Was effectively doing and testing nothing.
@@ -398,6 +398,7 @@ pub struct Flags { | |||
pub config_flag: ConfigFlag, | |||
pub node_modules_dir: Option<bool>, | |||
pub vendor: Option<bool>, | |||
pub enable_op_summary_metrics: bool, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a flag but isn't currently exposed on the CLI args yet.
runtime/worker.rs
Outdated
let op_summary_metrics = Rc::new(OpMetricsSummaryTracker::default()); | ||
deno_core::extension!(deno_op_metrics, | ||
options = { | ||
op_summary_metrics: Rc<OpMetricsSummaryTracker> | ||
}, | ||
state = |state, options| { | ||
state.put(options.op_summary_metrics) | ||
} | ||
); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it only for MainWorker
? What about WebWorker
?
Also seems strange to define an extension to put a default object in the state. Maybe do it directly after creating JsRuntime
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added code for WebWorker as well -- the metrics there are never fetched (AFAICT) but I suppose it's good for consistency.
I switched it up to manually add it to the JsRuntime after as suggested but deno_permissions_worker
is also doing something similar. I'm OK either way.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM once CI passes