From: Yin Congmin Date: Fri, 31 Jul 2020 06:15:24 +0000 (-0400) Subject: tools: add throttle mechanism to immutable object cache X-Git-Tag: v16.1.0~320^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=29690a338ba4482d187e6036903e138437ae3bb4;p=ceph.git tools: add throttle mechanism to immutable object cache Signed-off-by: Yin Congmin --- diff --git a/qa/tasks/mgr/dashboard/test_cluster_configuration.py b/qa/tasks/mgr/dashboard/test_cluster_configuration.py index dc96bced02ae..9c8245d238d1 100644 --- a/qa/tasks/mgr/dashboard/test_cluster_configuration.py +++ b/qa/tasks/mgr/dashboard/test_cluster_configuration.py @@ -369,7 +369,7 @@ class ClusterConfigurationTest(DashboardTestCase): self.assertIn('type', data) self.assertIn('desc', data) self.assertIn(data['type'], ['str', 'bool', 'float', 'int', 'size', 'uint', 'addr', - 'addrvec', 'uuid', 'secs']) + 'addrvec', 'uuid', 'secs', 'millisecs']) if 'value' in data: self.assertIn('source', data) diff --git a/src/common/options.cc b/src/common/options.cc index 806da4e1215a..9127a061958f 100644 --- a/src/common/options.cc +++ b/src/common/options.cc @@ -49,6 +49,9 @@ public: void operator()(const std::chrono::seconds v) const { out << v.count(); } + void operator()(const std::chrono::milliseconds v) const { + out << v.count(); + } }; } @@ -203,6 +206,13 @@ int Option::parse_value( *error_message = e.what(); return -EINVAL; } + } else if (type == Option::TYPE_MILLISECS) { + try { + *out = boost::lexical_cast(val); + } catch (const boost::bad_lexical_cast& e) { + *error_message = e.what(); + return -EINVAL; + } } else { ceph_abort(); } @@ -7878,6 +7888,37 @@ static std::vector