Instead of lengthy blurbs, switch to single-line, machine-readable standardized (https://spdx.dev) license identifiers. The Linux kernel switched long ago, so there is strong precedent. Three cases are handled: AGPL-only, Apache-only, and dual licensed. For the latter case, I chose (AGPL-3.0-or-later and Apache-2.0), reasoning that our changes are extensive enough to apply our license. The changes we applied mechanically with a script, except to licenses/README.md. Closes #9937
92 lines
2.9 KiB
C++
92 lines
2.9 KiB
C++
/*
|
|
* Copyright 2019-present ScyllaDB
|
|
*/
|
|
|
|
/*
|
|
* SPDX-License-Identifier: AGPL-3.0-or-later
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <cstdint>
|
|
|
|
#include <seastar/core/metrics_registration.hh>
|
|
#include "seastarx.hh"
|
|
#include "utils/estimated_histogram.hh"
|
|
#include "cql3/stats.hh"
|
|
|
|
namespace alternator {
|
|
|
|
// Object holding per-shard statistics related to Alternator.
|
|
// While this object is alive, these metrics are also registered to be
|
|
// visible by the metrics REST API, with the "alternator" prefix.
|
|
class stats {
|
|
public:
|
|
stats();
|
|
// Count of DynamoDB API operations by types
|
|
struct {
|
|
uint64_t batch_get_item = 0;
|
|
uint64_t batch_write_item = 0;
|
|
uint64_t create_backup = 0;
|
|
uint64_t create_global_table = 0;
|
|
uint64_t create_table = 0;
|
|
uint64_t delete_backup = 0;
|
|
uint64_t delete_item = 0;
|
|
uint64_t delete_table = 0;
|
|
uint64_t describe_backup = 0;
|
|
uint64_t describe_continuous_backups = 0;
|
|
uint64_t describe_endpoints = 0;
|
|
uint64_t describe_global_table = 0;
|
|
uint64_t describe_global_table_settings = 0;
|
|
uint64_t describe_limits = 0;
|
|
uint64_t describe_table = 0;
|
|
uint64_t describe_time_to_live = 0;
|
|
uint64_t get_item = 0;
|
|
uint64_t list_backups = 0;
|
|
uint64_t list_global_tables = 0;
|
|
uint64_t list_tables = 0;
|
|
uint64_t list_tags_of_resource = 0;
|
|
uint64_t put_item = 0;
|
|
uint64_t query = 0;
|
|
uint64_t restore_table_from_backup = 0;
|
|
uint64_t restore_table_to_point_in_time = 0;
|
|
uint64_t scan = 0;
|
|
uint64_t tag_resource = 0;
|
|
uint64_t transact_get_items = 0;
|
|
uint64_t transact_write_items = 0;
|
|
uint64_t untag_resource = 0;
|
|
uint64_t update_continuous_backups = 0;
|
|
uint64_t update_global_table = 0;
|
|
uint64_t update_global_table_settings = 0;
|
|
uint64_t update_item = 0;
|
|
uint64_t update_table = 0;
|
|
uint64_t update_time_to_live = 0;
|
|
uint64_t list_streams = 0;
|
|
uint64_t describe_stream = 0;
|
|
uint64_t get_shard_iterator = 0;
|
|
uint64_t get_records = 0;
|
|
|
|
utils::time_estimated_histogram put_item_latency;
|
|
utils::time_estimated_histogram get_item_latency;
|
|
utils::time_estimated_histogram delete_item_latency;
|
|
utils::time_estimated_histogram update_item_latency;
|
|
utils::time_estimated_histogram get_records_latency;
|
|
} api_operations;
|
|
// Miscellaneous event counters
|
|
uint64_t total_operations = 0;
|
|
uint64_t unsupported_operations = 0;
|
|
uint64_t reads_before_write = 0;
|
|
uint64_t write_using_lwt = 0;
|
|
uint64_t shard_bounce_for_lwt = 0;
|
|
uint64_t requests_blocked_memory = 0;
|
|
uint64_t requests_shed = 0;
|
|
// CQL-derived stats
|
|
cql3::cql_stats cql_stats;
|
|
private:
|
|
// The metric_groups object holds this stat object's metrics registered
|
|
// as long as the stats object is alive.
|
|
seastar::metrics::metric_groups _metrics;
|
|
};
|
|
|
|
}
|