Skip to content

Make gettime a labelled argument in the new API - #67

Open
talex5 wants to merge 1 commit into
mirage:masterfrom
talex5:label-gettime
Open

Make gettime a labelled argument in the new API#67
talex5 wants to merge 1 commit into
mirage:masterfrom
talex5:label-gettime

Conversation

@talex5

@talex5 talex5 commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Clearer, and makes it easy to make it optional in future if we want.

(deprecating the old API is the ideal time to fix this)

Clearer, and makes it easy to make it optional in future if we want.
Comment thread lwt/test/test_lwt.ml
let clock = ref 0.0 in
let gettime () = !clock in
Prometheus_lwt.Gauge.set_time gauge gettime
Prometheus_lwt.Gauge.set_time gauge ~gettime

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you want this to be optional in the future then the label should go before the fixed parameter shouldn’t it?

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

Successfully merging this pull request may close these issues.

2 participants