Skip to content
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

Panic on wasm: time not implemented on this platform #187

Closed
andylokandy opened this issue Jan 23, 2024 · 5 comments
Closed

Panic on wasm: time not implemented on this platform #187

andylokandy opened this issue Jan 23, 2024 · 5 comments

Comments

@andylokandy
Copy link
Collaborator

andylokandy commented Jan 23, 2024

I gave it a spin and it seems to fail at runtime: time not implemented on this platform (on WASM runtime).

All I did so far it to add minitrace with features = ["enable"] and did the following at startup:

  let collector = LocalCollector::start();
  let result = run_flow(req, env).await;
  let local_spans = collector.collect();
  let parent_context = SpanContext::random();
  let span_records = local_spans.to_span_records(parent_context); // ❗ 

I'm pretty sure this originates in to_span_records, because without calling it, it seems to work fine. I printed local_spans and it seems to correctly contain the spans 🎉

Originally posted by @dotansimha in #185 (comment)

@andylokandy
Copy link
Collaborator Author

andylokandy commented Jan 23, 2024

It'll be hard to get timing done without a wall clock timer... Do you have any idea? @dotansimha

@andylokandy
Copy link
Collaborator Author

what about https://lib.rs/crates/web-time? @andylokandy

Originally posted by @dotansimha

@andylokandy
Copy link
Collaborator Author

Seems good. Would you like to create a PR for adding web-time to minstant? SystemTime is only used in https://docs.rs/minstant/latest/minstant/struct.Anchor.html#method.new

@dotansimha
Copy link
Contributor

dotansimha commented Jan 24, 2024

@andylokandy Sure! tikv/minstant#34

@andylokandy
Copy link
Collaborator Author

Closed by tikv/minstant#34

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants