This adds the implementation to the histogram for the storage proxy.
After this patch the following url will be available:
/storage_proxy/metrics/read/latency/histogram
/storage_proxy/metrics/range/latency/histogram
/storage_proxy/metrics/write/latency/histogram
Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
This adds the read, write and range histograms to the storage_proxy
It adds the following commands:
get_read_metrics_latency_histogram
get_range_metrics_latency_histogram
get_write_metrics_latency_histogram
Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
This patch generalizd the sum helper function to accept any field as
long as it support the + operator and that it can be parrsed as json.
It adds a sum function to sum histograms it does so by:
adding the totatl, adding the sum, set the min and max
setting the avrage and variance and combining the samples.
Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
The utils file will hold general modules, that need to be used by
multiple modules.
As a start, it holds the histogram definition.
Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
config.hh changes rapidly, so don't force lots of recompiles by including it.
Need to place seed_provider_type in namespace scope, so we can forward
declare it for that.
It should not be called directly: externall callers should be calling flush()
instead.
To be sure it doesn't happen again, make seal_active_memtable private.
Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
In much of our column_families APIs, we need to pass a pointer to the database.
The only reason we do that, is so we can properly handle the commit log entries
after we seal the current memtables into sstables.
Now that we store a pointer to the commit log in the CF itself at the time it
is created, we no longer have to do it. As a result, the APIs are a lot
cleaner, with no gratuitous parameters.
My motivation for this was the flush method, but as a result, apply() also gets
cleaner.
Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
This adds an implementation to the storage_service counters. The
implementation uses the stats object inside the storage_proxy.
Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
A common scenario in the API is to get a sigle value from a distributed
object that has a get_stats method.
The helper function would get the object and a function that return a
single value from the stat object and would perform the map_reduce.
It would return a future that can be used as a return value from the
API.
Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
The API needs to call the storage_proxy, for that a reference to the
distribute storage_proxy is added to the context and is set in main.
Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
This adds a stub implementation to the metrics of the storage proxy.
After this patch the following URL will be available:
/storage_service/metrics/cas_write/contention
/storage_service/metrics/cas_write/condition_not_met
/storage_service/metrics/cas_read/unfinished_commit
/storage_service/metrics/cas_read/contention
/storage_service/metrics/cas_read/condition_not_met
/storage_service/metrics/read/timeouts
/storage_service/metrics/read/unavailables
/storage_service/metrics/range/timeouts
/storage_service/metrics/range/unavailables
/storage_service/metrics/write/timeouts
/storage_service/metrics/write/unavailables
The implementation returns 0 for all queries.
Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
This adds the storage definition to the storage proxy swagger definition
file.
It adds the definitions for the following command:
get_cas_write_metrics_unfinished_commit
get_cas_write_metrics_contention
get_cas_write_metrics_condition_not_met
get_cas_read_metrics_unfinished_commit
get_cas_read_metrics_contention
get_cas_read_metrics_condition_not_met
get_read_metrics_timeouts
get_read_metrics_unavailables
get_range_metrics_timeouts
get_range_metrics_unavailables
get_write_metrics_timeouts
get_write_metrics_unavailables
Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
This adds a stub implementation to the commit log metrics.
The calls return the currect value type with a stub value.
After this patch the following url will be available:
/commitlog/metrics/completed_tasks
/commitlog/metrics/pending_tasks
/commitlog/metrics/total_commit_log_size
Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
This adds the commit log swagger definition to to the commit log
definition file.
The API is based on the CommitLogMetrics.
The following commands were added:
get_completed_tasks
get_pending_tasks
get_total_commit_log_size
Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
"The column family matrics is a set of data related to the column family.
This series adds an API based on the ColumnFamilyMetrics mbean.
It has a stub implementation, just so the JMX proxy would get a response."
"This series adds the hinted handoff and hinted handoff metrics API with a stub
implementation. The API definition was based on the HintedHandOffMetricsMBean
and the HintedHandoffMetrics."
Conflicts:
api/api.cc
configure.py
"This series adds the cache service metrics API, It is based on the CacheMetrics
definitions.
There are statistics on per key, row and counters that will be expose in the
API. This series contain a stub implementation, that returns the correct types
but with a stub value."
This adds a stub implementation for the hinted handoff metrics.
The stubbed methods return the correct type, but with a stub value.
After this patch the following path will be available:
/hinted_handoff/metrics/create_hint/{addr}
/hinted_handoff/metrics/not_stored_hints/{addr}
Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
This adds the metrics to hinted_handoff, the metrics is based on the
HintedHandoffMetrics definition.
The following commands were added:
get_create_hint_count
get_not_stored_hints_count
Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
This adds a stub implementation for the hinted handoff.
The API returns the currect type but with stubed values.
After applying this patch the api-doc will be available at:
/api-doc/hinted_handoff/
The following url will be available:
/hinted_handoff/hints
/hinted_handoff/schedule
/hinted_handoff/pause
Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
This adds the swagger definition file for the hinted_handoff.
The API is based on the HintedHandOffMBean definition.
It adds the following command:
st_endpoints_pending_hints
truncate_all_hints
schedule_hint_delivery
pause_hints_delivery
Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
This adds the implementation for the API endpoint_snitch
After this patch the API doc can be found at:
/api-doc/endpoint_snitch_info/
The following url are available:
/snitch/datacenter
/snitch/rack
The get name is stubed
/snitch/name
Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
This adds the Swagger definition for the endpoint_snitch_info that is
based on the EndpointSnitchInfoMBean.
The following commands where added:
get_datacenter
get_rack
get_snitch_name
Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
This adds a stub implementation to the compaction_manager.
The API would return the currect type but with stub values.
After this patch the following url will be available:
/compaction_manager/metrics/pending_tasks
/compaction_manager/metrics/completed_tasks
/compaction_manager/metrics/total_compactions_completed
/compaction_manager/metrics/bytes_compacted
Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
This adds the metrics definition to the compaction_manager, it is based
on the CompactionMetrics definition.
The following command were added:
get_pending_tasks
get_completed_tasks
get_total_compactions_completed
get_bytes_compacted
Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
This adds a stub implementation for the compaction_manager API.
The methods return the right types but with a stub value.
After this patch the following url will be available:
/compaction_manager/compactions
/compaction_manager/compaction_summary
/compaction_manager/force_user_defined_compaction
/compaction_manager/stop_compaction
Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
This adds the Swagger definition file for the compaction_manager.
It is based on the CompactionManagerMBean and contains the following
command:
get_compactions
get_compaction_summary
force_user_defined_compaction
stop_compaction
Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
This adds a stub implementation for the cache service metrics for key,
row and counters.
A call to the API would return the correct type but with a stub value.
After this patch the following url will be available:
/cache_service/metrics/key/capacity
/cache_service/metrics/key/hits
/cache_service/metrics/key/requests
/cache_service/metrics/key/hit_rate
/cache_service/metrics/key/size
/cache_service/metrics/key/entries
/cache_service/metrics/row/capacity
/cache_service/metrics/row/hits
/cache_service/metrics/row/requests
/cache_service/metrics/row/hit_rate
/cache_service/metrics/row/size
/cache_service/metrics/row/entries
/cache_service/metrics/counter/capacity
/cache_service/metrics/counter/hits
/cache_service/metrics/counter/requests
/cache_service/metrics/counter/hit_rate
/cache_service/metrics/counter/size
/cache_service/metrics/counter/entries
Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
The cache service holds metrics for key, row and counters, this adds the
Swagger API definitions for the different cache.
The following commands where added:
get_key_capacity
get_key_hits
get_key_requests
get_key_hit_rate
get_key_size
get_key_entries
get_row_capacity
get_row_hits
get_row_requests
get_row_hit_rate
get_row_size
get_row_entries
get_counter_capacity
get_counter_hits
get_counter_requests
get_counter_hit_rate
get_counter_size
get_counter_entries
Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
This patch adds support to the Swagger-UI. It does so by adding
reference to the Swagger-UI target directory, after applying this patch
/ui/ will display the Swagger-UI page with the available APIs.
From the Swagger-UI page it is possible to run the different APIs.
The target directory of the ui can be override from the command line.
Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
This adds the following implementation to the storage_service API:
get_leaving_nodes
get_moving_nodes
get_joining_nodes
get_all_data_file_locations
get_saved_caches_location
get_host_id_map
get_current_generation_number
get_keyspaces
force_keyspace_flush
force_keyspace_compaction
Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
This adds a general map_to_key_value method that can work with any map
like object. This method gets the target vector in a parameter to help
the compiler inference the parameters type.
map_keys is a helper function that gets a map like objects and returns a
vector with its keys (i.e. the call to it's iterator first)
split is a wraper around the boost split and split_cf is a specific
split that is aligned with how column family are passed in the API
parameters.
Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
This adds a stub implementation for the cache_service. It also register
the API doc.
The cache_service doc will be available at:
http://localhost:10000/api-doc/cache_service/
The stub implementation returns the correct value type with stubbed
values.
After this patch the following path will be available:
/cache_service/row_cache_save_period
/cache_service/key_cache_save_period
/cache_service/counter_cache_save_period
/cache_service/row_cache_keys_to_save
/cache_service/key_cache_keys_to_save
/cache_service/counter_cache_keys_to_save
/cache_service/invalidate_key_cache
/cache_service/invalidate_counter_cache
/cache_service/row_cache_capacity
/cache_service/key_cache_capacity
/cache_service/counter_cache_capacity
/cache_service/save_caches
Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
This adds the definition file for the cache service, the API is based on
the CacheServiceMBean definition and contain the following command:
get_row_cache_save_period_in_seconds
set_row_cache_save_period_in_seconds
get_key_cache_save_period_in_seconds
set_key_cache_save_period_in_seconds
get_counter_cache_save_period_in_seconds
set_counter_cache_save_period_in_seconds
get_row_cache_keys_to_save
set_row_cache_keys_to_save
get_key_cache_keys_to_save
set_key_cache_keys_to_save
get_counter_cache_keys_to_save
set_counter_cache_keys_to_save
invalidate_key_cache
invalidate_counter_cache
set_row_cache_capacity_in_mb
set_key_cache_capacity_in_mb
set_counter_cache_capacity_in_mb
save_caches
Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>