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

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

Bases: object

append_event(ad=None, name=None, mdict=None, metadata=None, msgtype='qametric')[source]
clear_list()[source]
get_list(fromtime=None)[source]
get_metadict(ad)[source]

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: BaseHTTPRequestHandler

ADCC services request handler.

address_string()[source]

Return the client address.

do_GET()[source]

Defined services on HTTP GET requests.

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

5.1.1.1.1.2. 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!

5.1.1.1.1.2. Parameters

timestamp : <float>, time in epoch seconds

5.1.1.1.1.2. Return

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.specview_get(jfile)[source]
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.

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.