5.1.1.1.1.2. recipe_system.adcc.servers package¶
5.1.1.1.1.2.1. Submodules¶
5.1.1.1.1.2.2. recipe_system.adcc.servers.eventsManager module¶
5.1.1.1.1.2.3. recipe_system.adcc.servers.http_proxy module¶
-
class
recipe_system.adcc.servers.http_proxy.
ADCCHandler
(request, client_address, server)[source]¶ Bases:
http.server.BaseHTTPRequestHandler
ADCC services request handler.
-
do_POST
()[source]¶ Here, HTTP POST requests are farmed out to either metrics events on the event_report/ service, or to spec_events on the spec_report/ service.
-
events
= None¶
-
informers
= None¶
-
log_request
(code='-', size='-')[source]¶ Log an accepted request.
This is called by send_response().
This overrides BaseHTTPRequestHandler.log_request. See that class for what the method does normally.
-
spec_events
= None¶
-
-
class
recipe_system.adcc.servers.http_proxy.
MTHTTPServer
(server_address, RequestHandlerClass, bind_and_activate=True)[source]¶ Bases:
socketserver.ThreadingMixIn
,http.server.HTTPServer
Handles requests using threads
-
recipe_system.adcc.servers.http_proxy.
current_op_timestamp
()[source]¶ Return the epoch time (sec) of the start of current operational day, where turnover occurs @ 14.00h localtime. I.e. if the hour >= 14.00, then the current operational day is tomorrow.
Eg., 2013-08-02 17.00h is 20130803
parameters: <void> return: <float>
-
recipe_system.adcc.servers.http_proxy.
fstore_get
(timestamp)[source]¶ Open a url on fitsstore/qaforgui/ with the passed timestamp. timestamp is in epoch seconds, which is converted here to a YMD string for the URL. Return a list of dicts of qa metrics data.
Any number of exceptions may be thrown on URL access: URLError, HTTPError, TimeoutError, … . We don’t really care which specific failure occurred, only that QA metrics are not acessible. Here, we catch all failures and simply pass, returning a empty list.
N.B. – A timestamp that evaluates to False will request everything from fitsstore. This could be huge. Be careful passing no timestamp!
timestamp : <float>, time in epoch seconds
qa_data : <list>, list of dicts (json) of qametrics
-
recipe_system.adcc.servers.http_proxy.
main
(*args, **informers)¶
-
recipe_system.adcc.servers.http_proxy.
parsepath
(path)[source]¶ parsepath w/ urlparse.
parameters: <string> return: <dict>
-
recipe_system.adcc.servers.http_proxy.
server_time
()[source]¶ Return a dictionary of server timing quantities related to current time. This dict will be returned to a call on the server, /rqsite.json (See do_GET() method of ADCCHandler class.
parameters: <void> return: <dict>, dictionary of time now values.
-
recipe_system.adcc.servers.http_proxy.
stamp_to_opday
(timestamp)[source]¶ Converts a passed time stamp (sec) into the corresponding operational day. I.e. timestamps >= 14.00h are the next operational day.
parameters: <float>, time in epoch seconds return: <string>, YYYYMMDD
-
recipe_system.adcc.servers.http_proxy.
stamp_to_ymd
(timestamp)[source]¶ Caller sends a timestamp in seconds of epoch. Return string for year month day of that time as YYYYMMDD’ as used by url requests, as in http://<fitsstore_server>/qaforgui/20130616
parameters: <float>, seconds of epochs. return: <string>, YYYYMMDD of passed time.