Skip to content

Commit b4a8202

Browse files
committed
prometheus_text_format: Inline render_series/4 and render_value/2
These two functions are called once per metric series during every scrape (~2.3M calls each in profiled RabbitMQ workloads), together accounting for ~15.6% of scrape time. Inlining eliminates the function call overhead and allows the compiler to optimize the binary append operations across call boundaries.
1 parent 12bc74a commit b4a8202

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/formats/prometheus_text_format.erl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ http_request_duration_milliseconds_sum{method=\"post\"} 4350
3535
-include("prometheus_model.hrl").
3636

3737
-behaviour(prometheus_format).
38-
-compile({inline, [render_label_pair/1]}).
38+
-compile({inline, [render_label_pair/1, render_series/4, render_value/2]}).
3939

4040
?DOC("""
4141
Returns content type of the latest \[text format](https://bit.ly/2cxSuJP).

0 commit comments

Comments
 (0)