Skip to content

Commit

Permalink
Remove more dead code
Browse files Browse the repository at this point in the history
  • Loading branch information
thejohnfreeman committed Aug 21, 2024
1 parent 30a9ab7 commit 5808d06
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 60 deletions.
34 changes: 0 additions & 34 deletions src/xrpld/nodestore/Backend.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,29 +39,6 @@ namespace NodeStore {
class Backend
{
public:
template <typename T>
struct Counters
{
Counters() = default;
Counters(Counters const&) = default;

template <typename U>
Counters(Counters<U> const& other)
: writeDurationUs(other.writeDurationUs)
, writeRetries(other.writeRetries)
, writesDelayed(other.writesDelayed)
, readRetries(other.readRetries)
, readErrors(other.readErrors)
{
}

T writeDurationUs = {};
T writeRetries = {};
T writesDelayed = {};
T readRetries = {};
T readErrors = {};
};

/** Destroy the backend.
All open files are closed and flushed. If there are batched writes
Expand Down Expand Up @@ -174,17 +151,6 @@ class Backend
/** Returns the number of file descriptors the backend expects to need. */
virtual int
fdRequired() const = 0;

/** Returns read and write stats.
@note The Counters struct is specific to and only used
by CassandraBackend.
*/
virtual std::optional<Counters<std::uint64_t>>
counters() const
{
return std::nullopt;
}
};

} // namespace NodeStore
Expand Down
11 changes: 0 additions & 11 deletions src/xrpld/nodestore/Database.h
Original file line number Diff line number Diff line change
Expand Up @@ -302,17 +302,6 @@ class Database
virtual void
for_each(std::function<void(std::shared_ptr<NodeObject>)> f) = 0;

/** Retrieve backend read and write stats.
@note The Counters struct is specific to and only used
by CassandraBackend.
*/
virtual std::optional<Backend::Counters<std::uint64_t>>
getCounters() const
{
return std::nullopt;
}

void
threadEntry();
};
Expand Down
9 changes: 0 additions & 9 deletions src/xrpld/nodestore/detail/Database.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -273,15 +273,6 @@ Database::getCountsJson(Json::Value& obj)
obj[jss::node_written_bytes] = std::to_string(storeSz_);
obj[jss::node_read_bytes] = std::to_string(fetchSz_);
obj[jss::node_reads_duration_us] = std::to_string(fetchDurationUs_);

if (auto c = getCounters())
{
obj[jss::node_read_errors] = std::to_string(c->readErrors);
obj[jss::node_read_retries] = std::to_string(c->readRetries);
obj[jss::node_write_retries] = std::to_string(c->writeRetries);
obj[jss::node_writes_delayed] = std::to_string(c->writesDelayed);
obj[jss::node_writes_duration_us] = std::to_string(c->writeDurationUs);
}
}

} // namespace NodeStore
Expand Down
6 changes: 0 additions & 6 deletions src/xrpld/nodestore/detail/DatabaseNodeImp.h
Original file line number Diff line number Diff line change
Expand Up @@ -150,12 +150,6 @@ class DatabaseNodeImp : public Database
{
backend_->for_each(f);
}

std::optional<Backend::Counters<std::uint64_t>>
getCounters() const override
{
return backend_->counters();
}
};

} // namespace NodeStore
Expand Down

0 comments on commit 5808d06

Please sign in to comment.