rgw: replace 'should_log' with 'enable_ops_log'

code cleanup, make it more clear about log intention.

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
Cleaned some lingering references to "verbose"

Signed-off-by: caleb miles <caleb.miles@inktank.com>
CrushTester: mark_down_ratio and mark_down_bucket_ratio

Move functionality to allow user to control bucket vs device mark-down
probabilities independently.

Signed-off-by: caleb miles <caleb.miles@inktank.com>
CrushTester: some cleanup

Signed-off-by: caleb miles <caleb.miles@inktank.com>
CrushTester: remove dead code

Signed-off-by: caleb miles <caleb.miles@inktank.com>
CrushTester: randomize mark_down behavior

When marking a batch of devices down, select which buckets to visit sort
of randomly.

Signed-off-by: caleb miles <caleb.miles@inktank.com>
CrushTester: some whitespace

Signed-off-by: Sage Weil <sage@inktank.com>
CrushTester: simplify, clean up mark down

- put it in a separate function
- operate on temporary weight vector, not user-modified input
- guard the whole thing with an #ifdef
- permute candidates and use first N, to ensure we end up picking the right
  number of buckets/items.

Signed-off-by: Sage Weil <sage@inktank.com>
crushtool: drop useless clitest

This is an ancient test for an old 'bug' in functionality we're removing.
Also, it is sensitive to tester output, which will be changing a lot in
the coming weeks/months.

Signed-off-by: Sage Weil <sage@inktank.com>
CrushTester: drop range marking

This is subsumed by mark-down-ratio 1 with mark-down-bucket-ratio N.

Signed-off-by: Sage Weil <sage@inktank.com>
mon: fix pg state logging

PGMap->num_pg_by_state is a PG state to number of PG in the state
mapping. PGMonitor::update_logger wrongly interprets the mapping.

Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
Signed-off-by: Sage Weil <sage@inktank.com>
cls_rbd: add get_all_features method

This is useful for reporting which features an osd supports, and for
testing rados_exec. Update the rados api tests to use this method
instead of test_exec, which was removed.

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
Reviewed-by: Sage Weil <sage@inktank.com>
Merge remote-tracking branch 'gh/wip-crush-tunables'
rgw: don't fail initialization if socket path returns ENXIO

ENXIO is expected when trying to read the unix domain socket

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
rgw: new class methods for handling usage information

The new methods are:
 - user_usage_log_add: add new usage information
 - user_usage_log_read: get usage information
 - user_usage_log_trim: remove usage information

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
rgw: new config options

New config options for usage logging:
 - rgw_enable_usage_log: enable usage logging
 - rgw_usage_log_flush_threshold - limit on number of pending updates
                                   before synchronously flushing update
 - rgw_usage_log_tick_interval - asynchronous flush interval
 - rgw_usage_max_shards - split info across that many objects
 - rgw_usage_max_user_shards - split single user info across that many
                               objects

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
rgw: access methods for new usage ops

Wrappers for new rados class methods, and new RGWRados
methods to handle usage functionality.

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
rgw: usage logger

Accumulate usage info and flush it periodically.

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
rgw_admin: usage admin commands

 - radosgw-admin usage show
 - radosgw-admin usage trim

Both commands can get --start-date, --end-date, --uid

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
rgw/rgw_cls_api.h cleanup

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>