Skip to content

Commit

Permalink
treewide: change metric calls from make_derive to make_counter
Browse files Browse the repository at this point in the history
make_derive was recently deprecated in favor of make_counter, so
make the change throughput the codebase.

Closes scylladb#10564
  • Loading branch information
avikivity authored and psarna committed May 14, 2022
1 parent 768b5f3 commit 528ab5a
Show file tree
Hide file tree
Showing 20 changed files with 203 additions and 203 deletions.
4 changes: 2 additions & 2 deletions compaction/compaction_manager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -635,9 +635,9 @@ void compaction_manager::register_metrics() {
sm::description("Holds the number of currently active compactions.")),
sm::make_gauge("pending_compactions", [this] { return _stats.pending_tasks; },
sm::description("Holds the number of compaction tasks waiting for an opportunity to run.")),
sm::make_derive("completed_compactions", [this] { return _stats.completed_tasks; },
sm::make_counter("completed_compactions", [this] { return _stats.completed_tasks; },
sm::description("Holds the number of completed compaction tasks.")),
sm::make_derive("failed_compactions", [this] { return _stats.errors; },
sm::make_counter("failed_compactions", [this] { return _stats.errors; },
sm::description("Holds the number of failed compaction tasks.")),
sm::make_gauge("postponed_compactions", [this] { return _postponed.size(); },
sm::description("Holds the number of tables with postponed compaction.")),
Expand Down
96 changes: 48 additions & 48 deletions cql3/query_processor.cc

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion db/batchlog_manager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ db::batchlog_manager::batchlog_manager(cql3::query_processor& qp, batchlog_manag
namespace sm = seastar::metrics;

_metrics.add_group("batchlog_manager", {
sm::make_derive("total_write_replay_attempts", _stats.write_attempts,
sm::make_counter("total_write_replay_attempts", _stats.write_attempts,
sm::description("Counts write operations issued in a batchlog replay flow. "
"The high value of this metric indicates that we have a long batch replay list.")),
});
Expand Down
14 changes: 7 additions & 7 deletions db/commitlog/commitlog.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1444,21 +1444,21 @@ void db::commitlog::segment_manager::create_counters(const sstring& metrics_cate
sm::description("Holds the current number of unused segments. "
"A non-zero value indicates that the disk write path became temporary slow.")),

sm::make_derive("alloc", totals.allocation_count,
sm::make_counter("alloc", totals.allocation_count,
sm::description("Counts a number of times a new mutation has been added to a segment. "
"Divide bytes_written by this value to get the average number of bytes per mutation written to the disk.")),

sm::make_derive("cycle", totals.cycle_count,
sm::make_counter("cycle", totals.cycle_count,
sm::description("Counts a number of commitlog write cycles - when the data is written from the internal memory buffer to the disk.")),

sm::make_derive("flush", totals.flush_count,
sm::make_counter("flush", totals.flush_count,
sm::description("Counts a number of times the flush() method was called for a file.")),

sm::make_derive("bytes_written", totals.bytes_written,
sm::make_counter("bytes_written", totals.bytes_written,
sm::description("Counts a number of bytes written to the disk. "
"Divide this value by \"alloc\" to get the average number of bytes per mutation written to the disk.")),

sm::make_derive("slack", totals.bytes_slack,
sm::make_counter("slack", totals.bytes_slack,
sm::description("Counts a number of unused bytes written to the disk due to disk segment alignment.")),

sm::make_gauge("pending_flushes", totals.pending_flushes,
Expand All @@ -1468,11 +1468,11 @@ void db::commitlog::segment_manager::create_counters(const sstring& metrics_cate
sm::description("Holds a number of currently pending allocations. "
"A non-zero value indicates that we have a bottleneck in the disk write flow.")),

sm::make_derive("requests_blocked_memory", totals.requests_blocked_memory,
sm::make_counter("requests_blocked_memory", totals.requests_blocked_memory,
sm::description("Counts a number of requests blocked due to memory pressure. "
"A non-zero value indicates that the commitlog memory quota is not enough to serve the required amount of requests.")),

sm::make_derive("flush_limit_exceeded", totals.flush_limit_exceeded,
sm::make_counter("flush_limit_exceeded", totals.flush_limit_exceeded,
sm::description(
seastar::format("Counts a number of times a flush limit was exceeded. "
"A non-zero value indicates that there are too many pending flush operations (see pending_flushes) and some of "
Expand Down
12 changes: 6 additions & 6 deletions db/hints/manager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -65,22 +65,22 @@ void manager::register_metrics(const sstring& group_name) {
sm::make_gauge("size_of_hints_in_progress", _stats.size_of_hints_in_progress,
sm::description("Size of hinted mutations that are scheduled to be written.")),

sm::make_derive("written", _stats.written,
sm::make_counter("written", _stats.written,
sm::description("Number of successfully written hints.")),

sm::make_derive("errors", _stats.errors,
sm::make_counter("errors", _stats.errors,
sm::description("Number of errors during hints writes.")),

sm::make_derive("dropped", _stats.dropped,
sm::make_counter("dropped", _stats.dropped,
sm::description("Number of dropped hints.")),

sm::make_derive("sent", _stats.sent,
sm::make_counter("sent", _stats.sent,
sm::description("Number of sent hints.")),

sm::make_derive("discarded", _stats.discarded,
sm::make_counter("discarded", _stats.discarded,
sm::description("Number of hints that were discarded during sending (too old, schema changed, etc.).")),

sm::make_derive("corrupted_files", _stats.corrupted_files,
sm::make_counter("corrupted_files", _stats.corrupted_files,
sm::description("Number of hints files that were discarded during sending because the file was corrupted.")),

sm::make_gauge("pending_drains",
Expand Down
4 changes: 2 additions & 2 deletions db/view/view.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1342,11 +1342,11 @@ void view_builder::setup_metrics() {
sm::description("Number of tasks waiting to perform bookkeeping operations"),
[this] { return _sem.waiters(); }),

sm::make_derive("steps_performed",
sm::make_counter("steps_performed",
sm::description("Number of performed build steps."),
_stats.steps_performed),

sm::make_derive("steps_failed",
sm::make_counter("steps_failed",
sm::description("Number of failed build steps."),
_stats.steps_failed),

Expand Down
2 changes: 1 addition & 1 deletion gms/gossiper.cc
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ gossiper::gossiper(abort_source& as, feature_service& features, const locator::s
namespace sm = seastar::metrics;
auto ep = get_broadcast_address();
_metrics.add_group("gossip", {
sm::make_derive("heart_beat",
sm::make_counter("heart_beat",
[ep, this] {
auto es = get_endpoint_state_for_endpoint_ptr(ep);
if (es) {
Expand Down
4 changes: 2 additions & 2 deletions redis/stats.cc
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@ stats::stats() : api_operations{} {
OPERATION(_select, "select")
});
_metrics.add_group("redis", {
seastar::metrics::make_derive("redis-connections", _connects,
seastar::metrics::make_counter("redis-connections", _connects,
seastar::metrics::description("Counts a number of client connections.")),
seastar::metrics::make_gauge("current_connections", _connections,
seastar::metrics::description("Holds a current number of client connections.")),
seastar::metrics::make_derive("requests_served", _requests_served,
seastar::metrics::make_counter("requests_served", _requests_served,
seastar::metrics::description("Counts a number of served requests.")),
seastar::metrics::make_gauge("requests_serving", _requests_serving,
seastar::metrics::description("Holds a number of requests that are being processed right now.")),
Expand Down
16 changes: 8 additions & 8 deletions repair/row_level.cc
Original file line number Diff line number Diff line change
Expand Up @@ -175,21 +175,21 @@ struct row_level_repair_metrics {
row_level_repair_metrics() {
namespace sm = seastar::metrics;
_metrics.add_group("repair", {
sm::make_derive("tx_row_nr", tx_row_nr,
sm::make_counter("tx_row_nr", tx_row_nr,
sm::description("Total number of rows sent on this shard.")),
sm::make_derive("rx_row_nr", rx_row_nr,
sm::make_counter("rx_row_nr", rx_row_nr,
sm::description("Total number of rows received on this shard.")),
sm::make_derive("tx_row_bytes", tx_row_bytes,
sm::make_counter("tx_row_bytes", tx_row_bytes,
sm::description("Total bytes of rows sent on this shard.")),
sm::make_derive("rx_row_bytes", rx_row_bytes,
sm::make_counter("rx_row_bytes", rx_row_bytes,
sm::description("Total bytes of rows received on this shard.")),
sm::make_derive("tx_hashes_nr", tx_hashes_nr,
sm::make_counter("tx_hashes_nr", tx_hashes_nr,
sm::description("Total number of row hashes sent on this shard.")),
sm::make_derive("rx_hashes_nr", rx_hashes_nr,
sm::make_counter("rx_hashes_nr", rx_hashes_nr,
sm::description("Total number of row hashes received on this shard.")),
sm::make_derive("row_from_disk_nr", row_from_disk_nr,
sm::make_counter("row_from_disk_nr", row_from_disk_nr,
sm::description("Total number of rows read from disk on this shard.")),
sm::make_derive("row_from_disk_bytes", row_from_disk_bytes,
sm::make_counter("row_from_disk_bytes", row_from_disk_bytes,
sm::description("Total bytes of rows read from disk on this shard.")),
});
}
Expand Down
Loading

0 comments on commit 528ab5a

Please sign in to comment.