recipe_system.adcc.servers package Submodules recipe_system.adcc.servers.eventsManager module

class recipe_system.adcc.servers.eventsManager.EventsManager[source]

Bases: object

append_event(ad=None, name=None, mdict=None, metadata=None, msgtype='qametric')[source]
get_metadict(ad)[source] recipe_system.adcc.servers.http_proxy module

class recipe_system.adcc.servers.http_proxy.ADCCHandler(request, client_address, server)[source]

Bases: BaseHTTPRequestHandler

ADCC services request handler.


Return the client address.


Defined services on HTTP GET requests.


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: ThreadingMixIn, HTTPServer

Handles requests using threads


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>


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. Exceptions on urlopen()

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! Parameters

timestamp : <float>, time in epoch seconds Return

qa_data : <list>, list of dicts (json) of qametrics

recipe_system.adcc.servers.http_proxy.main(*args, **informers)

parsepath w/ urlparse.

parameters: <string> return: <dict>


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.


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


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.

recipe_system.adcc.servers.http_proxy.startInterfaceServer(*args, **informers)[source]
recipe_system.adcc.servers.http_proxy.ymd_to_stamp(yy, mm, dd, hh=0)[source]

Caller passes integers for year, month, and day. Return is the epoch time (sec). Year is 4 digit, eg., 2013

parameters: <int>, <int>, <int> [, <int>] Year, Month, Day [,Hour] return: <float>, epoch time in seconds.