当前位置: 首页>>代码示例>>Python>>正文


Python PerformanceTestReporter.testThroughput方法代码示例

本文整理汇总了Python中ufora.test.PerformanceTestReporter.testThroughput方法的典型用法代码示例。如果您正苦于以下问题:Python PerformanceTestReporter.testThroughput方法的具体用法?Python PerformanceTestReporter.testThroughput怎么用?Python PerformanceTestReporter.testThroughput使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ufora.test.PerformanceTestReporter的用法示例。


在下文中一共展示了PerformanceTestReporter.testThroughput方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: test_throughputThrowsIfNonePassed

# 需要导入模块: from ufora.test import PerformanceTestReporter [as 别名]
# 或者: from ufora.test.PerformanceTestReporter import testThroughput [as 别名]
    def test_throughputThrowsIfNonePassed(self):
        tempDir = tempfile.mkdtemp()
        tempFile = os.path.join(tempDir, "data.json")

        with SetEnv(
                PerformanceTestReporter.TEST_DATA_LOCATION_ENVIRONMENT_VARIABLE, 
                tempFile
                ):
            def testFunOfN(n):
                raise PerformanceTestReporter.TimedOutException("timed out!!")

            with self.assertRaises(AssertionError):
                PerformanceTestReporter.testThroughput(
                    "test1", testFunOfN = testFunOfN)
开发者ID:WantonSoup,项目名称:ufora,代码行数:16,代码来源:PerformanceTestReporter_test.py

示例2: test_some_throughput

# 需要导入模块: from ufora.test import PerformanceTestReporter [as 别名]
# 或者: from ufora.test.PerformanceTestReporter import testThroughput [as 别名]
    def test_some_throughput(self):
        def toTest(n):
            FORA.eval("""let v = [0, 0.0]; let res = 0;
                         for ix in sequence(%s * 100000000) { 
                             res = res + v[0] + v[1];
                             }
                         res""" % n)

        PerformanceTestReporter.testThroughput(
            "fora_lang.LangTestPerf.vector.heterogeneousVectorAccessThroughput_100mm", 
            toTest, 
            maxNToSearch=10,
            timeoutInSec=5.0
            )
开发者ID:Sandy4321,项目名称:ufora,代码行数:16,代码来源:testExampleThoughput.py

示例3: array_binary_operation

# 需要导入模块: from ufora.test import PerformanceTestReporter [as 别名]
# 或者: from ufora.test.PerformanceTestReporter import testThroughput [as 别名]
    def array_binary_operation(self, dimension, op, test_name):
        with self.ufora.remotely:
            a = np.arange(dimension)
            b = np.arange(dimension)

        def f(n):
            with self.ufora.remotely:
                for _ in xrange(n):
                    op(a, b)

        PerformanceTestReporter.testThroughput(
            "pyfora.numpy.%s_%d" % (test_name, dimension),
            f,
            maxNToSearch=20,
            timeoutInSec=20.0
            )
开发者ID:Sandy4321,项目名称:ufora,代码行数:18,代码来源:numpyThroughputTest.py

示例4: vector_dot_product

# 需要导入模块: from ufora.test import PerformanceTestReporter [as 别名]
# 或者: from ufora.test.PerformanceTestReporter import testThroughput [as 别名]
    def vector_dot_product(self, dimension):
        with self.ufora.remotely:
            a = np.arange(dimension)
            b = np.arange(dimension)

        def f(n):
            with self.ufora.remotely:
                for _ in xrange(n):
                    np.dot(a, b)

        PerformanceTestReporter.testThroughput(
            "pyfora.numpy.vector_dot_product_%d" % dimension,
            f,
            maxNToSearch=20,
            timeoutInSec=20.0
            )
开发者ID:Sandy4321,项目名称:ufora,代码行数:18,代码来源:numpyThroughputTest.py

示例5: matrix_dot_product

# 需要导入模块: from ufora.test import PerformanceTestReporter [as 别名]
# 或者: from ufora.test.PerformanceTestReporter import testThroughput [as 别名]
    def matrix_dot_product(self, dimension):
        with self.ufora.remotely:
            a = np.arange(dimension**2).reshape(
                (int(dimension), int(dimension)))
            b = np.arange(dimension**2).reshape(
                (int(dimension), int(dimension)))

        def f(n):
            with self.ufora.remotely:
                for _ in xrange(n):
                    np.dot(a, b)

        PerformanceTestReporter.testThroughput(
            "pyfora.numpy.matrix_dot_product_%dx%d" % (dimension, dimension),
            f,
            maxNToSearch=20,
            timeoutInSec=20.0
            )
开发者ID:Sandy4321,项目名称:ufora,代码行数:20,代码来源:numpyThroughputTest.py

示例6: test_throughputDoesNotFailOnTimeoutIfSomePassed

# 需要导入模块: from ufora.test import PerformanceTestReporter [as 别名]
# 或者: from ufora.test.PerformanceTestReporter import testThroughput [as 别名]
    def test_throughputDoesNotFailOnTimeoutIfSomePassed(self):
        tempDir = tempfile.mkdtemp()
        tempFile = os.path.join(tempDir, "data.json")

        with SetEnv(
                PerformanceTestReporter.TEST_DATA_LOCATION_ENVIRONMENT_VARIABLE, 
                tempFile
                ):
            def testFunOfN(n):
                if n < 10:
                    pass
                else:
                    raise PerformanceTestReporter.TimedOutException("timed out!!")
            PerformanceTestReporter.testThroughput(
                "test1", testFunOfN = testFunOfN)
            
        testData = PerformanceTestReporter.loadTestsFromFile(tempFile)

        self.assertEqual(len(testData), 1)
开发者ID:WantonSoup,项目名称:ufora,代码行数:21,代码来源:PerformanceTestReporter_test.py


注:本文中的ufora.test.PerformanceTestReporter.testThroughput方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。