コード例 #1
0
ファイル: test_calvin.py プロジェクト: LlsDimple/calvin-base
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

import unittest
from calvin.Tools import cscompiler as compiler
from calvin.Tools import deployer
import time
import multiprocessing
from calvin.utilities import calconfig
from calvin.utilities import utils
from calvin.utilities.nodecontrol import dispatch_node
import pytest

_conf = calconfig.get()


def actual_tokens(rt, actor_id):
    return utils.report(rt, actor_id)

def expected_counter(n):
    return [i for i in range(1, n + 1)]

def cumsum(l):
    s = 0
    for n in l:
        s = s + n
        yield s

def expected_sum(n):
コード例 #2
0
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

import unittest
from calvin.Tools import cscompiler as compiler
from calvin.Tools import deployer
import time
import multiprocessing
from calvin.utilities import calconfig
from calvin.utilities import utils
from calvin.utilities.nodecontrol import dispatch_node
import pytest

_conf = calconfig.get()


def actual_tokens(rt, actor_id):
    return utils.report(rt, actor_id)


def expected_counter(n):
    return [i for i in range(1, n + 1)]


def cumsum(l):
    s = 0
    for n in l:
        s = s + n
        yield s
コード例 #3
0
ファイル: __init__.py プロジェクト: zhangsj0608/calvin-base
            'defer': [],
            'threads': [],
            'server_connection': ['ServerProtocolFactory', 'LineProtocol', 'RawDataProtocol'],
            'client_connection': ['ClientProtocolFactory']}

_FW_MODULES = []
__all__ = []

if not _FW_MODULES:
    DIRNAME = os.path.dirname(__file__)
    DIRS = os.listdir(DIRNAME)
    for i, fw_module in enumerate(DIRS):
        if "impl" in fw_module:
            _FW_MODULES.append(fw_module)

_CONF = calconfig.get()
_FW_PATH = _CONF.get(None, 'framework')


def get_framework():
    """
        Get the framework used on the runtime
    """
    return _FW_PATH


def get_frameworks():
    """
        Get all frameworks in the system
    """
    return _FW_MODULES