Closed avkoehl closed 3 years ago
Will be used in https://github.com/datalab-dev/quintessence_analysis/issues/5 to evaluate time difference between using digitalscholars database and using datasic database
I will be using curl to test out each script with appropriate parameters. test php script will contain a bunch of functions with form below:
# init request
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, "http://quintessence.ds.lib.ucdavis.edu/php/get_qid.pid");
curl_setopt($curl, CURLOPT_HEADER, 0);
curl_setopt($curl, CURLOPT_POST, 1);
curl_setopt($curl, CURLTOPT_POSTFIELDS, $postparams);
# time execution
$time_pre = microtime(true);
$output = curl_exec($curl);
$time_post = microtime(true);
$exec_time = $time_post - $time_pre;
#evalaute output
TODO
just pushing some of my old commits to the 'test' branch. I think longterm the framework for testing I did is good, but we want to quickly rewrite a lot of the php, delte scripts that arent used in the app, document things clearer etc. We also definitely want to refactor the javascript.
Yeah, doesn't seem worth doing this anymore. Next step is to stop using the php like this and instead develop a separate API in flask or express or something like that. The api will have its own tests, for time, and data validation.
Task
Write a script that loads in config.php, and then runs a bunch of queries on the database and times how long it takes for each one. Long term this should be fleshed out and unittest all the functions in the php directory. But for now a quick script with like 5-10 functions will do.
Should have a set of functions related to the topic model: get proportions get topic terms
A set of functions for generic queries: Get authors based on qid Get qid from File_ID get kwic
A set of functions related to the embeddings: get time series get nn by author
Deliverable
A pull request with the tests dir added to php and this script in it.