PerfTest.py 文件源码

python
阅读 32 收藏 0 点赞 0 评论 0

项目:sdos-core 作者: sdos 项目源码 文件源码
def runPutTest(testDataPath, testDataRangeStart, testDataRangeEnd, f):
    log.debug('running put tests...')
    timeStart = time.perf_counter()
    times = [time.perf_counter()]
    for i in range(testDataRangeStart, testDataRangeEnd):
        print(i)
        thisPath = '%s/%i' % (testDataPath, i)
        o = loadTestData(thisPath)

        f.putObject(o, str(i))

        times.append(time.perf_counter())

    timeEnd = time.perf_counter()
    log.warning('RESULT (PUT): total test runtime: %s seconds, mean per object: %s' % (
        timeEnd - timeStart, ((timeEnd - timeStart) / testDataRangeEnd)))
    log.critical('RESULT (PUT): median result: %s ' % statistics.median(calculateTimeDeltas(times)))
    log.critical('RESULT (PUT): standard deviation result: %s ' % statistics.stdev(calculateTimeDeltas(times)))
    log.critical('RESULT (PUT): mean result: %s ' % statistics.mean(calculateTimeDeltas(times)))


# log.critical('RESULT (PUT): individual times: %s ' % (calculateTimeDeltas(times)))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号