Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 0 additions & 29 deletions source/server/http/admin.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1104,35 +1104,6 @@ Http::Code AdminImpl::handlerRuntime(absl::string_view url, Http::HeaderMap& res
return Http::Code::OK;
}

std::string AdminImpl::runtimeAsJson(
const std::vector<std::pair<std::string, Runtime::Snapshot::Entry>>& entries) {
rapidjson::Document document;
document.SetObject();
rapidjson::Value entries_array(rapidjson::kArrayType);
rapidjson::Document::AllocatorType& allocator = document.GetAllocator();
for (const auto& entry : entries) {
Value entry_obj;
entry_obj.SetObject();

entry_obj.AddMember("name", {entry.first.c_str(), allocator}, allocator);

Value entry_value;
if (entry.second.uint_value_) {
entry_value.SetUint64(entry.second.uint_value_.value());
} else {
entry_value.SetString(entry.second.raw_string_value_.c_str(), allocator);
}
entry_obj.AddMember("value", entry_value, allocator);

entries_array.PushBack(entry_obj, allocator);
}
document.AddMember("runtime", entries_array, allocator);
rapidjson::StringBuffer strbuf;
rapidjson::PrettyWriter<StringBuffer> writer(strbuf);
document.Accept(writer);
return strbuf.GetString();
}

bool AdminImpl::isFormUrlEncoded(const Http::HeaderEntry* content_type) const {
if (content_type == nullptr) {
return false;
Expand Down
4 changes: 0 additions & 4 deletions source/server/http/admin.h
Original file line number Diff line number Diff line change
Expand Up @@ -235,11 +235,7 @@ class AdminImpl : public Admin,
const absl::optional<std::regex> regex = absl::nullopt,
bool pretty_print = false);

static std::string
runtimeAsJson(const std::vector<std::pair<std::string, Runtime::Snapshot::Entry>>& entries);
std::vector<const UrlHandler*> sortedHandlers() const;
static const std::vector<std::pair<std::string, Runtime::Snapshot::Entry>>
sortedRuntime(const std::unordered_map<std::string, const Runtime::Snapshot::Entry>& entries);
envoy::admin::v2alpha::ServerInfo::State serverState();
/**
* URL handlers.
Expand Down