This PR changes the http handler to store the internal http.Handler object for every filter combination, instead of recreating them for every request.
The node exporter only stores the unfiltered one, and recreates the filtered ones, if they are needed.
I believe it is fine to store the filtered ones in this project, because having only 3 collectors means there are 7 filter combinations(plus the unfiltered one) at most.
However I would be fine with recreating the filtered ones, if you believe this isn't worth the additional RAM it uses.
This PR changes the http handler to store the internal
http.Handler
object for every filter combination, instead of recreating them for every request.The node exporter only stores the unfiltered one, and recreates the filtered ones, if they are needed.
I believe it is fine to store the filtered ones in this project, because having only 3 collectors means there are 7 filter combinations(plus the unfiltered one) at most.
However I would be fine with recreating the filtered ones, if you believe this isn't worth the additional RAM it uses.
Closes #22