Commit Graph

47 Commits

Author SHA1 Message Date
Calle Wilund
473326d49a api/column_family: Make mean row size return integral
As (at least) per C3, these metrics are integral in origin. Adapt.
(Other option would be to translate in jmx).
2016-11-08 12:22:04 +00:00
Tomasz Grabiec
c1a7e2090e Revert "database: change find_column_families signature so it returns a lw_shared_ptr"
This reverts commit f3528ede65.
2016-11-04 10:48:21 +01:00
Glauber Costa
f3528ede65 database: change find_column_families signature so it returns a lw_shared_ptr
There are places in which we need to use the column family object many
times, with deferring points in between. Because the column family may
have been destroyed in the deferring point, we need to go and find it
again.

If we use lw_shared_ptr, however, we'll be able to at least guarantee
that the object will be alive. Some users will still need to check, if
they want to guarantee that the column family wasn't removed. But others
that only need to make sure we don't access an invalid object will be
able to avoid the cost of re-finding it just fine.

Signed-off-by: Glauber Costa <glauber@scylladb.com>
Message-Id: <722bf49e158da77ff509372c2034e5707706e5bf.1478111467.git.glauber@scylladb.com>
2016-11-03 13:27:31 +01:00
Raphael S. Carvalho
67343798cf api: implement api to return sstable count per level
'nodetool cfstats' wasn't showing per-level sstable count because
the API wasn't implemented.

Fixes #1119.

Signed-off-by: Raphael S. Carvalho <raphaelsc@scylladb.com>
Message-Id: <0dcdf9196eaec1692003fcc8ef18c77d0834b2c6.1474410770.git.raphaelsc@scylladb.com>
2016-09-21 09:13:40 +03:00
Glauber Costa
4310635bae move estimated histogram to utils
Nothing sstable-specific in it, really.

Signed-off-by: Glauber Costa <glauber@scylladb.com>
2016-08-31 15:13:23 -04:00
Glauber Costa
ffc2131c51 decouple estimated_histogram from sstables
There is nothing really that fundamentally ties the estimated histogram to
sstables. This patch gets rid of the few incidental ties. They are:

 - the namespace name, which is now moved to utils. Users inside sstables/
   now need to add a namespace prefix, while the ones outside have to change
   it to the right one
 - sstables::merge, which has a very non-descriptive name to begin with, is
   changed to a more descriptive name that can live inside utils/
 - the disk_types.hh include has to be removed - but it had no reason to be
   here in the first place.

Todo, is to actually move the file outside sstables/. That is done in a separate
step for clarity.

Signed-off-by: Glauber Costa <glauber@scylladb.com>
2016-08-31 15:13:23 -04:00
Gleb Natapov
3531dd8d71 api: fix use after free in sum_sstable
get_sstables_including_compacted_undeleted() may return temporary shared
ptr which will be destroyed before the loop if not stored locally.

Fixes #1514

Message-Id: <20160728100504.GD2502@scylladb.com>
2016-07-28 14:25:40 +03:00
Raphael S. Carvalho
e688fc9550 api: provide estimation of pending compaction
Use compaction_strategy::estimated_pending_compaction() to provide
user with an estimation of number of compaction for strategy to be
fully satisfied.

Signed-off-by: Raphael S. Carvalho <raphaelsc@scylladb.com>
Message-Id: <39b7d91f2525ca38fb2ce9d8885d0c2e727de7ed.1467667054.git.raphaelsc@scylladb.com>
2016-07-05 19:03:12 +03:00
Avi Kivity
2a46410f4a Change sstable_list from a map to a set
sstable_list is now a map<generation, sstable>; change it to a set
in preparation for replacing it with sstable_set.  The change simplifies
a lot of code; the only casualty is the code that computes the highest
generation number.
2016-07-03 10:26:57 +03:00
Amnon Heiman
d4123ba613 API: column_family count sstable space used correctly
The space calculation counters in column family had two problem:
1. The total bytes is an ever growing counter, which is meaningless for
the API.

2. Trying to simply sum the size on all shards, ignores the fact that the
same sstable file can be referenced by multiple shards, this is
especially noticeable during migration time.

To solve this, the implementation was modified so instead of
collecting the sizes, the API would collect a map of file name to size
and then would do the summing.

This removes the duplications and fixes the total bytes calculation

Calling cfstats before the change with load after a compaction happend:

$ nodetool cfstats keyspace1
Keyspace: keyspace1
Verify write latency 1068253.0 76435
	Read Count: 75915
	Read Latency: 0.5953986037015082 ms.
	Write Count: 76435
	Write Latency: 0.013975966507490025 ms.
	Pending Flushes: 0
		Table: standard1
		SSTable count: 5
		Space used (live): 44261215
		Space used (total): 219724478

After the fix:

$ nodetool cfstats keyspace1
Keyspace: keyspace1
Verify write latency 1863206.0 124219
	Read Count: 125401
	Read Latency: 0.9381053978835895 ms.
	Write Count: 124219
	Write Latency: 0.01499936402643718 ms.
	Pending Flushes: 0
		Table: standard1
		SSTable count: 6
		Space used (live): 50402904
		Space used (total): 50402904
		Space used by snapshots (total): 0

Fixes: #1042

Signed-off-by: Amnon Heiman <amnon@scylladb.com>
Message-Id: <1464518757-14666-2-git-send-email-amnon@scylladb.com>
2016-05-29 14:11:03 +03:00
Amnon Heiman
ad34f80e6f API: change cache_service, column_family and storage_proxy to rate
object

The API would expose now the rate_moving_average and
rate_moving_average_and_histogram.

The old end points remains for the transition period, but marked as
depricated.

Signed-off-by: Amnon Heiman <amnon@scylladb.com>
2016-05-17 11:56:52 +03:00
Tomasz Grabiec
88bb5fcb53 api: Fix error message
Keyspace and table names are separated by a single colon.
Message-Id: <1461600269-4070-1-git-send-email-tgrabiec@scylladb.com>
2016-04-26 08:40:28 +03:00
Pekka Enberg
38a54df863 Fix pre-ScyllaDB copyright statements
People keep tripping over the old copyrights and copy-pasting them to
new files. Search and replace "Cloudius Systems" with "ScyllaDB".

Message-Id: <1460013664-25966-1-git-send-email-penberg@scylladb.com>
2016-04-08 08:12:47 +03:00
Raphael S. Carvalho
e15ce5eb4d api: Add support to get column family compression ratio
After this change, user can query compression ratio on a per column
family basis with 'nodetool cfstats'.

look at 'nodetool cfstats' output:
./bin/nodetool cfstats ks.test5
Keyspace: ks
	Read Count: 0
	Read Latency: NaN ms.
	Write Count: 0
	Write Latency: NaN ms.
	Pending Flushes: 0
		Table: test5
		SSTable count: 1
		Space used (live): 4774
		Space used (total): 4774
		Space used by snapshots (total): 0
		Off heap memory used (total): 131384
		SSTable Compression Ratio: 0.833333
	...

Fixes #636.

Signed-off-by: Raphael S. Carvalho <raphaelsc@scylladb.com>
Message-Id: <a1bee5a23fe63787df3e387a88f2d216ba4a4134.1459802771.git.raphaelsc@scylladb.com>
2016-04-05 12:46:40 +03:00
Amnon Heiman
b0856f7acf API: Init value for cf_map reduce should be of type int64_t
The helper function for summing statistic over the column family are
template function that infer the return type acording to the type of the
Init param.

In the API the return value should be int64_t, passing an integer would
cause a number wrap around.

A partial output from the nodetool cfstats after the fix

nodetool cfstats keyspace1
Keyspace: keyspace1
	Read Count: 0
	Read Latency: NaN ms.
	Write Count: 4050000
	Write Latency: 0.009178098765432099 ms.
	Pending Flushes: 0
		Table: standard1
		SSTable count: 12
		Space used (live): 1118617445
		Space used (total): 23336562465

Fixes #682

Signed-off-by: Amnon Heiman <amnon@scylladb.com>
2015-12-22 17:33:13 +02:00
Amnon Heiman
3ce7fa181c API: Add the implementation for index_summary_off_heap_memory
This adds the implementation for the index_summary_off_heap_memory for a
single column family and for all of them.

Signed-off-by: Amnon Heiman <amnon@scylladb.com>
2015-12-07 15:15:39 +02:00
Tomasz Grabiec
934d3f06d1 api: Make histogram reduction work on domain value instead of json objects
Objects extending json_base are not movable, so we won't be able to
pass them via future<>, which will assert that types are nothrow move
constructible.

This problem only affects httpd::utils_json::histogram, which is used
in map-reduce. This patch changes the aggregation to work on domain
value (utils::ihistrogram) instead of json objects.
2015-12-07 09:50:28 +01:00
Amnon Heiman
3674ee2fc1 API: get snapshot size
This patch adds the column family API that return the snapshot size.
The changes in the swagger definition file follo origin so the same API will be used for the metric and the
column_family.

The implementation is based on the get_snapshot_details in the
column_family.

This fix:
425

Signed-off-by: Amnon Heiman <amnon@scylladb.com>
2015-12-01 11:41:52 +02:00
Amnon Heiman
c130381284 Adding live_scanned and tombstone scaned histogram to column family
This series adds a histogrm to the column family for live scanned and
tombstone scaned.

It expose those histogram via the API instead of the stub implmentation,
currently exist.

The implementation update of the histogram will be added in a different
series.

Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
2015-10-22 11:13:28 +03:00
Amnon Heiman
378a97b66b API: Add row cahe hits and miss per column family
Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
2015-10-22 11:12:14 +03:00
Amnon Heiman
0ec0a5703b API: column family estimated histograms
This patch fix an issue with the read latency estimated historam
implementation and add a call to the estimated number of sstable
histogram.

The later is not yet implemented on the datbase side.

Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
2015-10-08 14:59:17 +03:00
Amnon Heiman
a04401d5a4 API: Column family to return sum of the total read and write
This adds the implementation that return the estimated total latency of
the read and of the write.

First the method that sum the count was renamed to get_cf_stats_count
and a method was added named get_cf_stats_sum to sum the estimated
latencies.

Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
2015-10-04 11:52:19 +03:00
Amnon Heiman
8e9729371f API: Add functionality to column family to support nodetool cfstats
This adds the API definition with stub implementation that would make
the nodetool cfstats to run.

After this patch the nodetool cfstats command would work, but with stub
imlementation.

Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
2015-10-04 11:52:19 +03:00
Glauber Costa
5dd0953bb9 api: implement filter off heap memory calculation
For us, everything is "off heap", so this will just be the total amount of
memory used by the filters.

Fixes #339

Signed-off-by: Glauber Costa <glommer@scylladb.com>
2015-09-28 16:44:26 +02:00
Avi Kivity
d5cf0fb2b1 Add license notices 2015-09-20 10:43:39 +03:00
Amnon Heiman
c06eb6b8c8 API: Adding stub and functionality to column family
The following function where added to column family:

is_auto_compaction_disabled
get_built_indexes
get_compression_metadata_off_heap_memory_used
get_compression_parameters
get_compression_ratio
get_read_latency_estimated_histogram
get_write_latency_estimated_histogram

And the get and set compaction strategy methods and a stub
implementation for the compression parameter, crc chec and sstable
count.

Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
2015-09-13 13:28:14 +03:00
Amnon Heiman
9d099b3a8d API: Workaround for bloom filter memory calculation
The bloom filter memory calculation is missing, as a workaround until
it will be completed, the memory calculation will return 0.

It is needed by the nodetool info command.

Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
2015-09-10 18:22:22 +03:00
Amnon Heiman
4c5f77bfa7 API: Add memeory related methods to column_family
This patch clear the ambiguity in the swagger definition file and adds
the implementation for the memtable memory related methods.

For each column family there is an active memtable and a list of non
active.

when refering the all the memtable in the column family, the nick name
will contain cf_all_memtables.

Each URL has two versions, one, with a column family name, that is
relevant to a specific column family and one without, which is the
result of running the method on all column families.

This patch adds the following implementation to column_family:
get_memtable_on_heap_size
get_all_memtable_on_heap_size
get_memtable_off_heap_size
get_all_memtable_off_heap_size
get_memtable_live_data_size
get_all_memtable_live_data_size
get_all_memtables_on_heap_size
get_all_all_memtables_on_heap_size
get_all_memtables_off_heap_size
get_all_all_memtables_off_heap_size
get_all_memtables_live_data_size
get_all_all_memtables_live_data_size

Memory consumption is map this way: All memory assume to be off heap, so
on heap will return 0, and off heap will return the memory consumption

After this patch the following URL will be available:
/column_family/metrics/memtable_on_heap_size/{name}
/column_family/metrics/memtable_on_heap_size
/column_family/metrics/memtable_off_heap_size/{name}
/column_family/metrics/memtable_off_heap_size
/column_family/metrics/memtable_live_data_size/{name}
/column_family/metrics/memtable_live_data_size
/column_family/metrics/all_memtables_on_heap_size/{name}
/column_family/metrics/all_memtables_on_heap_size
/column_family/metrics/all_memtables_off_heap_size/{name}
/column_family/metrics/all_memtables_off_heap_size
/column_family/metrics/all_memtables_live_data_size/{name}
/column_family/metrics/all_memtables_live_data_size

Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
2015-09-10 00:23:16 +03:00
Avi Kivity
e5c46420bd Merge "Unimplemented API method to return error." from Amnon
"This series modify the stub implementation of unimplemented API method to
return a 500 Http error.

It does so by adding a new API exception unimplemented_exception and a helper
function unimplemented that throw that exception.

A call to unimplemented was added to each of the stub API methods.

After this series a call to an unimplemented to API would return a 500."
2015-09-09 12:53:21 +03:00
Amnon Heiman
6c2454e8f9 API: Expose the get_cf_stats in column_family
Some APIs other then the column_family need to use the get_cf_stats,
this adds the helper method decleration to the column_family.hh and
change the implementation decleration to be non-static

Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
2015-09-09 03:57:40 +03:00
Amnon Heiman
fe9f7b4d04 API: Call unimplemented for stub API methods that are stubed
The API contains stub API methods, this adds a call to unimplemented
method in each of the stubed method that is not implemented.

The return remains the same to help the compiler deduce the return type
of the lambda function.

After this patch a call to an unimplemented API function will return
500.

Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
2015-09-08 19:14:30 +03:00
Avi Kivity
0fff367230 Merge "test for compaction metadata's ancestors" from Raphael 2015-08-27 11:07:53 +03:00
Amnon Heiman
f55c168ae7 API: Add column family mean row size
This adds the column family mean row size in the per column family and
the total version. I uses the ratio_helper class to calculate the mean
over all the shrades.
2015-08-25 15:48:25 +03:00
Glauber Costa
ca2d058520 api/column family: bloom filter file size
Export information about on-disk space used by bloom filters.

Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
2015-08-24 20:14:31 -05:00
Glauber Costa
3dc135c380 api/column family: bloom filter ratios
Just like the simple statistics, but composed derived from them.

Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
2015-08-24 20:14:28 -05:00
Glauber Costa
c094ba22c8 api/column family: bloom filter statistics
This patch uses the now existing infrastructure to expose statistics about the bloom
filters hit/miss rates.

Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
2015-08-24 19:18:54 -05:00
Raphael S. Carvalho
c65af6e188 api: add get_unleveled_sstables to column family api
Adding to API function to return count of sstables in L0 if leveled
compaction strategy is enabled, 0 otherwise. Currently, we don't
support leveled compaction strategy, so function to return count of
sstables in L0 always return zero.

Signed-off-by: Raphael S. Carvalho <raphaelsc@cloudius-systems.com>
2015-08-24 11:56:31 -03:00
Amnon Heiman
be0f0e0f04 API: Expose the map_reduce_cf from column_family
Other API need to use the map_reduce_cf, so it is expose in the
column_family.hh.

Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
2015-08-17 19:42:23 +03:00
Avi Kivity
7a14bcd66e Merge "API: add get estimated row size histogram to column family" from Amnon
"This series cleans the streaming_histogram and the estimated histogram that
were importad from origin, it then uses it to get the estimated min and max row
estimation in the API."
2015-08-16 17:31:23 +03:00
Amnon Heiman
773106b90e API: add get estimated row size histogram to column family
This adds the implementation to in the API to the row size histogram.

It adds a map_cf method that perform a map operation over all column
family on the different shards.

Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
2015-08-12 13:10:18 +03:00
Amnon Heiman
ae34ba32fa API: Adding min row and max row support to column_family
This adds the implementation for min and max row size in column family.

It uses the column family map redudce helper function with the addtional
function to get the min and max row size.

Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
2015-08-12 13:10:18 +03:00
Amnon Heiman
dab068dde9 API: modify column family API to use the histogram
With the change in column_family stats, the API needs to get the counter
from the read and write histogram.

It also adds the implementation for the read and write latency histogram.

Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
2015-08-11 10:21:22 +03:00
Raphael S. Carvalho
1e335006e7 api: add missing stats to column family api
addresses issue #84

Signed-off-by: Raphael S. Carvalho <raphaelsc@cloudius-systems.com>
2015-08-10 12:31:38 +03:00
Tomasz Grabiec
1046ee6e80 memtable: Remove all_partitions()
Preferred way to access the memtable is via reader.
2015-08-06 14:05:16 +02:00
Amnon Heiman
cea73277ca API: Add read, write, and flush statistic to column_family
This adds the API implementation for the read, write, number of
panding flushes and memtable switch count.

The implementation uses a helper function to perform map and map_reduce
on column_family.

The get_uuid helper method now supports both colon notations (i.e.
either as a ":" or as %3A)

Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
2015-08-03 11:36:40 +03:00
Amnon Heiman
338c1c20b7 Adding a stub implementation for the column_familiy matrics API
This adds a stub implemtation for the column_familiy matrics API.
It return the correct type with a stub value.

Column family specific API are mark with a comment
After this patch the following API will be available:

/column_family/metrics/memtable_columns_count/{name}
/column_family/metrics/memtable_columns_count/
/column_family/metrics/memtable_on_heap_size/{name}
/column_family/metrics/memtable_on_heap_size
/column_family/metrics/memtable_off_heap_size/{name}
/column_family/metrics/memtable_off_heap_size
/column_family/metrics/memtable_live_data_size/{name}
/column_family/metrics/memtable_live_data_size
/column_family/metrics/all_memtables_on_heap_size/{name}
/column_family/metrics/all_memtables_on_heap_size
/column_family/metrics/all_memtables_off_heap_size/{name}
/column_family/metrics/all_memtables_off_heap_size
/column_family/metrics/all_memtables_live_data_size/{name}
/column_family/metrics/all_memtables_live_data_size
/column_family/metrics/memtable_switch_count/{name}
/column_family/metrics/memtable_switch_count
/column_family/metrics/estimated_row_size_histogram/{name}
/column_family/metrics/estimated_column_count_histogram/{name}
/column_family/metrics/compression_ratio/{name}
/column_family/metrics/compression_ratio
/column_family/metrics/read_latency/{name}
/column_family/metrics/read_latency
/column_family/metrics/range_latency/{name}
/column_family/metrics/range_latency
/column_family/metrics/write_latency/{name}
/column_family/metrics/write_latency
/column_family/metrics/pending_flushes/{name}
/column_family/metrics/pending_flushes
/column_family/metrics/pending_compactions/{name}
/column_family/metrics/pending_compactions
/column_family/metrics/live_ss_table_count/{name}
/column_family/metrics/live_ss_table_count
/column_family/metrics/live_disk_space_used/{name}
/column_family/metrics/live_disk_space_used
/column_family/metrics/total_disk_space_used/{name}
/column_family/metrics/total_disk_space_used
/column_family/metrics/min_row_size/{name}
/column_family/metrics/min_row_size
/column_family/metrics/max_row_size/{name}
/column_family/metrics/max_row_size
/column_family/metrics/mean_row_size/{name}
/column_family/metrics/mean_row_size
/column_family/metrics/bloom_filter_false_positives/{name}
/column_family/metrics/bloom_filter_false_positives
/column_family/metrics/recent_bloom_filter_false_positives/{name}
/column_family/metrics/recent_bloom_filter_false_positives
/column_family/metrics/bloom_filter_false_ratio/{name}
/column_family/metrics/bloom_filter_false_ratio
/column_family/metrics/recent_bloom_filter_false_ratio/{name}
/column_family/metrics/recent_bloom_filter_false_ratio
/column_family/metrics/bloom_filter_disk_space_used/{name}
/column_family/metrics/bloom_filter_disk_space_used
/column_family/metrics/bloom_filter_off_heap_memory_used/{name}
/column_family/metrics/bloom_filter_off_heap_memory_used
/column_family/metrics/index_summary_off_heap_memory_used/{name}
/column_family/metrics/index_summary_off_heap_memory_used
/column_family/metrics/compression_metadata_off_heap_memory_used/{name}
/column_family/metrics/compression_metadata_off_heap_memory_used
/column_family/metrics/speculative_retries/{name}
/column_family/metrics/speculative_retries
/column_family/metrics/key_cache_hit_rate/{name}
/column_family/metrics/true_snapshots_size/{name}
/column_family/metrics/true_snapshots_size
/column_family/metrics/row_cache_hit_out_of_range/{name}
/column_family/metrics/row_cache_hit_out_of_range
/column_family/metrics/row_cache_hit/{name}
/column_family/metrics/row_cache_hit
/column_family/metrics/row_cache_miss/{name}
/column_family/metrics/row_cache_miss
/column_family/metrics/cas_prepare/{name}
/column_family/metrics/cas_propose/{name}
/column_family/metrics/cas_commit/{name}
/column_family/metrics/sstables_per_read_histogram/{name}
/column_family/metrics/tombstone_scanned_histogram/{name}
/column_family/metrics/live_scanned_histogram/{name}
/column_family/metrics/col_update_time_delta_histogram/{name}

Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
2015-06-30 15:51:08 +03:00
Amnon Heiman
2be20ff295 API: Add the column familiy implementation
This adds the API implementation to the column family API.

After this patch the following API will be supported:
/column_family/name
/column_family
/column_family/name/keyspace
2015-06-11 10:12:38 +03:00