Dear community,
I have set up a web API which accepts the submissions of the benchmark logs
and would like to ask you guys to help me test the framework. The web API
is setup as a mediawiki custom API action and goes by the name
'benchmark' as of now. The parameters required to make the call are as
follows:
'action' : 'benchmark',
'filename' : <just-the-filename>
'content' : <content-of-benchmark.log-file>,
'format' : <xml/json/yaml/dump/txt/..>
The parameter format is optional. I am attaching a python script which
could be used to submit the file.
I have also setup a script which gets the attachments through the IMAP
libraries from the test account which has been setup for this purpose. I
would like to request you folks to please mail your benchmark logs to
benchmark.performance.datab...@gmail.com
Setup and work so far:
1. Web API : This is an extension to the mediawiki APIs which implements a
small custom API. I initially wanted to take most of the good things out of
ApiUpload of mediawiki but couldn't really get it to work because of the
authentication issues which even after discussions on mediawiki-api lists
could not be solved. I scraped the previous idea and implemented a simple
POST upload API which takes in the complete data.
2. Fetch from IMAP server : This uses python's IMAP libs to scan the unread
messages and gets the attachments and adds them to the queue folder. Each
and every extraction is logged into the db so that data integrity could be
checked. This is scheduled via cron. The verifier script goes through mails
from the ones last seen and then checks if the attachment has been taken
out and added to the db and the folder.
3. Parser : Parses the benchmark log file and adds the data to the db and
puts the file in the archive.
4. Queue folder to DB and archive : Scripts to move the files to the db
and archive from the queue folder. The logs submitted via the email, web
API and file transfer all reside in the queue folder.
Current work :
1. Now testing these things, adding in-code documentation and documenting
the project so far.
2. Started working with the frontend forms which are being implemented as a
special page of mediawiki and is accessed via
host/wiki/Special:BenchmarkPerformanceExtension
--
Regards,
Suryajith Chillara.
'''
Created on Jul 4, 2012
@author: suryajith
'''
import sys
import urllib
import urllib2
def main() :
if len(sys.argv) == 2 :
filename = sys.argv[1]
url = "http://88.198.223.105/wiki/api.php"
content = open(filename, 'r').read()
filename_clean = filename.split('/')[-1]
values = {'action' : 'benchmark',
'filename' : filename_clean,
'content' : content,
'format' : 'xml',
}
data = urllib.urlencode(values)
req = urllib2.Request(url, data)
response = urllib2.urlopen(req)
print response.read()
else :
print "Usage: python benchmark_upload.py <relative-path-to-file>"
sys.exit(1)
if __name__ == '__main__':
main()
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
BRL-CAD Developer mailing list
brlcad-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/brlcad-devel