Esempio n. 1
0
async def _status():
    _info = get_full_version()
    return {
        'jina': _info[0],
        'envs': _info[1],
        'peas': pea_store.status,
        'pods': pod_store.status,
        'flows': flow_store.status,
        'workspaces': workspace_store.status,
        'used_memory': used_memory_readable()
    }
Esempio n. 2
0
async def _status():
    _jina, _envs = get_full_version()
    return {
        'jina': _jina,
        'envs': _envs,
        'workspaces': workspace_store.status,
        'pods': pod_store.status,
        'deployments': deployment_store.status,
        'flows': flow_store.status,
        'used_memory': used_memory_readable(),
    }
Esempio n. 3
0
def test_standard_query(tmpdir, test_standard):
    mem1 = used_memory(1)
    print(used_memory_readable())
    with NumpyIndexer.load(os.path.join(tmpdir, 'a.bin')) as ni:
        ni.batch_size = 256
        print(used_memory_readable())
        print(ni.raw_ndarray.shape)
        print(used_memory_readable())
        with TimeContext('query topk') as ti:
            result = ni.query(queries, top_k=10)
            mem2 = used_memory(1)
            print(used_memory_readable())
            print(result[0].shape)
        with open(summary_file, 'a') as fp:
            json.dump(
                {
                    'name': 'naive',
                    'memory': mem2 - mem1,
                    'readable': get_readable_size(mem2 - mem1),
                    'time': ti.duration
                }, fp)
            fp.write('\n')
Esempio n. 4
0
        async def _status():
            """
            Get the status of this Jina service.

            This is equivalent to running `jina -vf` from command line.

            .. # noqa: DAR201
            """
            _info = get_full_version()
            return {
                'jina': _info[0],
                'envs': _info[1],
                'used_memory': used_memory_readable(),
            }