Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
gjasny committed Dec 17, 2023
1 parent f397553 commit b25c251
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 7 deletions.
2 changes: 1 addition & 1 deletion push/src/detail/label_encoder.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
namespace prometheus {
namespace detail {

std::ostream &operator<<(std::ostream &os, const Label &label);
void encodeLabel(std::ostream &os, const Label &label);

}
}
3 changes: 1 addition & 2 deletions push/src/gateway.cc
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,7 @@ Gateway::Gateway(const std::string& host, const std::string& port,

std::stringstream labelStream;
for (auto& label : labels) {
using detail::operator<<;
labelStream << label;
detail::encodeLabel(labelStream, label);
}
labels_ = labelStream.str();
}
Expand Down
3 changes: 1 addition & 2 deletions push/src/label_encoder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,8 @@
namespace prometheus {
namespace detail {

std::ostream &operator<<(std::ostream &os, const Label &label) {
void detail::encodeLabel(std::ostream &os, const Label &label) {
os << "/" << label.first << "/" << label.second;
return os;
}

}}
3 changes: 1 addition & 2 deletions push/tests/internal/label_encoder_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,8 @@ namespace {
class LabelEncoderTest : public testing::Test {
protected:
std::string Encode(const Label& label) {
using detail::operator<<;
std::strstream ss;
ss << label;
detail::encodeLabel(ss, label);
return ss.str();
}
};
Expand Down

0 comments on commit b25c251

Please sign in to comment.