def test_disk_read_and_write_perf(self):
        if os.getenv("CUMULUS_DATA_DIR") is None:
            dataDir = tempfile.mkdtemp()
        else:
            dataDir = os.getenv("CUMULUS_DATA_DIR")
        dataDir = os.path.join(dataDir, str(uuid.uuid4()))

        diskCache = CumulusNative.DiskOfflineCache(
            callbackScheduler,
            dataDir,
            100 * 1024 * 1024 * 1024,
            100000
            )

        try:
            fiftyMegabytes = ForaNative.encodeStringInSerializedObject(" " * 1024 * 1024 * 50)

            logging.info("Writing to %s", dataDir)

            storedPageID = ForaNative.PageId(HashNative.Hash.sha1("pageId"), 50 * 1024 * 1024, 50 * 1024 * 1024)

            diskCache.store(storedPageID, fiftyMegabytes)

            t0 = time.time()

            TOTAL_SECONDS = 20.0

            totalReadBytes = [0]
            totalWriteBytes = [0]

            def readerThread():
                while time.time() - t0 < TOTAL_SECONDS:
                    diskCache.loadIfExists(storedPageID)
                    totalReadBytes[0] += 50

            def writerThread():
                ix = 0
                while time.time() - t0 < TOTAL_SECONDS:
                    ix += 1
                    diskCache.store(
                        ForaNative.PageId(HashNative.Hash.sha1(str(ix)), 50 * 1024 * 1024, 50 * 1024 * 1024),
                        fiftyMegabytes
                        )
                    totalWriteBytes[0] += 50

            threads = [
                threading.Thread(target = readerThread),
                threading.Thread(target = writerThread)
                ]

            for t in threads:
                t.start()
            for t in threads:
                t.join()

            PerformanceTestReporter.recordTest(
                "python.BigBox.Disk.ReadAndWrite.Write1GB",
                1024 / (totalWriteBytes[0] / (time.time() - t0)),
                None
                )

            PerformanceTestReporter.recordTest(
                "python.BigBox.Disk.ReadAndWrite.Read1GB",
                1024 / (totalReadBytes[0] / (time.time() - t0)),
                None
                )

        finally:
            shutil.rmtree(dataDir)
dataset/ETHPy150Open ufora/ufora/test_scripts/bigbox_perf/disk/testBigboxDiskPerf.py/BigboxDiskPerformanceTest.test_disk_read_and_write_perf/original