MCPcopy Create free account
hub / github.com/ceph/ceph / test_perf_counters

Method test_perf_counters

qa/tasks/cephfs/test_openfiletable.py:47–82  ·  view source on GitHub ↗

Opening a file should increment omap_total_updates by 1.

(self)

Source from the content-addressed store, hash-verified

45 self.fs.radosm(["stat", "mds0_openfiles.1"])
46
47 def test_perf_counters(self):
48 """
49 Opening a file should increment omap_total_updates by 1.
50 """
51
52 self.set_conf("mds", "osd_deep_scrub_large_omap_object_key_threshold", "1")
53 self.fs.mds_restart()
54 self.fs.wait_for_daemons()
55
56 perf_dump = self.fs.mds_asok(['perf', 'dump'])
57 omap_total_updates_0 = perf_dump['oft']['omap_total_updates']
58 log.info("omap_total_updates_0:{}".format(omap_total_updates_0))
59
60 # Open the file
61 p = self.mount_a.open_background("omap_counter_test_file")
62 self.wait_until_true(lambda: self._check_oft_counter('omap_total_updates', 2), timeout=120)
63
64 perf_dump = self.fs.mds_asok(['perf', 'dump'])
65 omap_total_updates_1 = perf_dump['oft']['omap_total_updates']
66 log.info("omap_total_updates_1:{}".format(omap_total_updates_1))
67
68 self.assertTrue((omap_total_updates_1 - omap_total_updates_0) == 2)
69
70 # Now close the file
71 self.mount_a.kill_background(p)
72 # Ensure that the file does not exist any more
73 self.wait_until_true(lambda: self._check_oft_counter('omap_total_removes', 1), timeout=120)
74 self.wait_until_true(lambda: self._check_oft_counter('omap_total_kv_pairs', 1), timeout=120)
75
76 perf_dump = self.fs.mds_asok(['perf', 'dump'])
77 omap_total_removes = perf_dump['oft']['omap_total_removes']
78 omap_total_kv_pairs = perf_dump['oft']['omap_total_kv_pairs']
79 log.info("omap_total_removes:{}".format(omap_total_removes))
80 log.info("omap_total_kv_pairs:{}".format(omap_total_kv_pairs))
81 self.assertTrue(omap_total_removes == 1)
82 self.assertTrue(omap_total_kv_pairs == 1)

Callers

nothing calls this directly

Calls 10

_check_oft_counterMethod · 0.95
set_confMethod · 0.80
mds_restartMethod · 0.80
wait_for_daemonsMethod · 0.80
mds_asokMethod · 0.80
open_backgroundMethod · 0.80
kill_backgroundMethod · 0.80
infoMethod · 0.45
formatMethod · 0.45
wait_until_trueMethod · 0.45

Tested by

no test coverage detected