Skip to content

Commit 0377c5f

Browse files
author
Scott Clark
committed
responded to reviews
1 parent 776520f commit 0377c5f

File tree

3 files changed

+31
-9
lines changed

3 files changed

+31
-9
lines changed

moe/views/constant.py

+28-2
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,34 @@
3535
from collections import namedtuple
3636

3737

38-
MoeRestLogLine = namedtuple('MoeLogLine', ['endpoint', 'type', 'content'])
39-
MoeRoute = namedtuple('MoeRoute', ['route_name', 'endpoint'])
38+
_BaseMoeRestLogLine = namedtuple('MoeLogLine', ['endpoint', 'type', 'content'])
39+
40+
41+
class MoeRestLogLine(_BaseMoeRestLogLine):
42+
43+
"""The information logged for all MOE REST requests/responses.
44+
45+
:ivar endpoint: The endpoint that was called
46+
:ivar type: Whether this is a ``'request'`` or ``'response'``
47+
:ivar content: The json of the request/response
48+
49+
"""
50+
51+
__slots__ = ()
52+
53+
_BaseMoeRoute = namedtuple('MoeRoute', ['route_name', 'endpoint'])
54+
55+
56+
class MoeRoute(_BaseMoeRoute):
57+
58+
"""Information for mapping a MOE ``route_name`` to its corresponding endpoint.
59+
60+
:ivar route_name: The name of the route (ie ``'gp_ei'``)
61+
:ivar endpoint: The endpoint for the route (ie ``'/gp/ei'``)
62+
63+
"""
64+
65+
__slots__ = ()
4066

4167
GP_EI_ROUTE_NAME = 'gp_ei'
4268
GP_EI_ENDPOINT = '/gp/ei'

moe/views/optimizable_gp_pretty_view.py

+2-6
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,8 @@ def get_params_from_request(self):
1818
:returns: A deserialized self.request_schema object
1919
2020
"""
21-
self._create_moe_log_line(
22-
type='request',
23-
content=self.request.json_body,
24-
)
25-
# Deserialize the basic request schema
26-
params = self.request_schema.deserialize(self.request.json_body)
21+
# First we get the standard params (not including optimization info)
22+
params = super(OptimizableGpPrettyView, self).get_params_from_request()
2723
optimization_type = params['optimization_info']['optimization_type']
2824
# Find the schma class that corresponds to the ``optimization_type`` of the request
2925
schema_class = OPTIMIZATION_TYPES_TO_SCHEMA_CLASSES[optimization_type]()

production.ini

+1-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ level = WARN
5656
handlers = console, filelog
5757

5858
[logger_moe]
59-
level = DEBUG
59+
level = INFO
6060
handlers =
6161
qualname = moe
6262

0 commit comments

Comments
 (0)