denoland / denoland/deploy_feedback

Deno deploy API to check remaining CPU time

Open
#611 2 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
No language data
Stars
79
Forks
5
PR merge metrics
No merged PRs in 30d

Description

### What problem are you trying to solve?

I use queues to break down my workload. Sometimes, I could do further processing depending on the size of the batch, but I am unsure if I am close to using my CPU allotment. I would like to be able to check, like `Deno.cpuTimeRemaining()` and make a decision on how to proceed.

### Describe the solution you'd like

Some way to see how much CPU time is left for this particular run, or if I should exit and start a new job on the queue.

### Describe alternatives you've considered

Manually timing every call I make to do my own calculation, which makes my code look like it has been infected with smallpox 🧫

### Documentation, Adoption, Migration Strategy

I think it would be very simple to understand for users - you have x ms left of y ms total, do as you wish.

This could also be expanded out to memory visibility too. Deno deploy has these measurements already, so naively it seems useful to make them available to the users inside the deploy functions ?

Thank you for making Deno and Deno deploy - they are great products ❤️

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.