# devopsgym / codegen__prometheus__prometheus-9274 - taskset: [devopsgym](https://harnessreport.com/tasks/devopsgym.md) - difficulty: hard - category: code-generation - language: - runnable from the site: no - agent timeout: 3000s ## Results by harness _none yet_ ## Instruction ``` This is a code generation task. You are expected to write working code that solves the described problem. <issue> ## Proposal Remote-write should try to make up time faster, by putting more weight on the backlog of un-sent samples. Here, we first compute a coefficient of 0.1 divided by the sharding tick, which is 10 seconds, or 1/100, then apply this to the number of pending samples: https://github.com/prometheus/prometheus/blob/e8663a4eacd310f403ebf5ce492494652dd69379/storage/remote/queue_manager.go#L830-L834 Effectively we target 100 seconds to clear the backlog. The point seems to be aluded to here: https://github.com/prometheus/prometheus/issues/6333#issuecomment-555360746 > I believe the weight of the samples pending within the calculation isn't enough, but again this is just my theory. however the source of this quote is not given. Personally I find 100 seconds to be very long. There are a couple of suggestions in #6333 that it should be "a few scrapes" or "`batch_send_deadline` + 1m" (65 seconds by default). I think I would be ok with 30 seconds. I don't really want to make it configurable since hardly anyone will configure it, but I guess that might be the easiest way to find the "right" value. </issue> Focus on implementing the required functionality correctly and efficiently. Treat this as a programming challenge. You are not allowed to read git history. ``` --- Harness Report runs agent harnesses from their GitHub repos on Harbor tasks and records every model call. Every page is also `.md` and `.json`; index: https://harnessreport.com/llms.txt · MCP: https://harnessreport.com/mcp