Gateway need a new Constructor
love19862003 opened this issue · 0 comments
love19862003 commented
some times we use gateway address is like "https://pushgateway.address.com/service_a/xxx/"
so need a new Constructor function like
`Gateway::Gateway(const std::string& url, const std::string& jobname,
const Labels& labels, const std::string& username,
const std::string& password) {
curlWrapper_ = std::make_uniquedetail::CurlWrapper(username, password);
std::stringstream jobUriStream;
jobUriStream << url << "/metrics/job/" << jobname;
jobUri_ = jobUriStream.str();
std::stringstream labelStream;
for (auto& label : labels) {
labelStream << "/" << label.first << "/" << label.second;
}
labels_ = labelStream.str();
}`