concordia-docker/tools/concordiaSearch.py

29 lines
519 B
Python
Raw Normal View History

2019-05-18 00:37:44 +02:00
#!/usr/bin/python3
2019-05-16 18:28:30 +02:00
# -*- coding: utf-8 -*-
import unittest
import json
2019-05-18 00:37:44 +02:00
import requests
2019-05-16 18:28:30 +02:00
import sys
import time
import host
address = 'http://'+host.concordia_host
if len(host.concordia_port) > 0:
address += ':'+host.concordia_port
data = {
'operation': 'concordiaSearch',
'pattern':sys.argv[1],
'tmId':int(sys.argv[2])
}
start = time.time()
2019-05-18 00:37:44 +02:00
response = requests.post(address, json=data).json()
2019-05-16 18:28:30 +02:00
end = time.time()
2019-05-18 00:37:44 +02:00
print("Execution time: %.4f seconds." % (end-start))
print("Result: ")
print(response)