Updated oracle fixtures

This commit is contained in:
dvanaken 2019-12-10 17:57:33 +01:00 committed by Dana Van Aken
parent 42e1a4add3
commit a3cc34ba8e
6 changed files with 32 additions and 26 deletions

View File

@ -138,6 +138,12 @@ def set_field(fields):
fields['maxval'] = 2000000000 # 2GB
fields['default'] = 500000000 # 500M
fields['resource'] = 1
if fields['name'].lower() == 'db_32k_cache_size':
fields['tunable'] = False
fields['minval'] = 0
fields['maxval'] = 2000000000 # 2GB
fields['default'] = 500000000 # 500M
fields['resource'] = 1
if fields['name'].upper() == 'DB_RECYCLE_CACHE_SIZE':
fields['tunable'] = False
fields['minval'] = 0

View File

@ -1039,11 +1039,12 @@
"unit": 3,
"tunable": false,
"description": "",
"minval": null,
"maxval": null,
"minval": 0,
"maxval": 2000000000,
"vartype": 2,
"default": "0",
"summary": "Size of cache for 32K buffers"
"default": 500000000,
"summary": "Size of cache for 32K buffers",
"resource": 1
}
},
{

View File

@ -1324,11 +1324,12 @@
"unit": 3,
"tunable": false,
"description": "",
"minval": null,
"maxval": null,
"minval": 0,
"maxval": 2000000000,
"vartype": 2,
"default": "0",
"summary": "Size of cache for 32K buffers"
"default": 500000000,
"summary": "Size of cache for 32K buffers",
"resource": 1
}
},
{

View File

@ -1419,11 +1419,12 @@
"unit": 3,
"tunable": false,
"description": "",
"minval": null,
"maxval": null,
"minval": 0,
"maxval": 2000000000,
"vartype": 2,
"default": "0",
"summary": "Size of cache for 32K buffers"
"default": 500000000,
"summary": "Size of cache for 32K buffers",
"resource": 1
}
},
{

View File

@ -74,7 +74,7 @@ urlpatterns = [
url(r'^create/user/', website_views.alt_create_user, name='backdoor_create_user'),
url(r'^delete/user/', website_views.alt_delete_user, name='backdoor_delete_user'),
url(r'^info/(?P<name>[0-9a-zA-Z]+)', website_views.alt_get_info, name="backdoor_info"),
url(r'^set_constant/(?P<name>[0-9a-zA-Z_]+)', website_views.alt_set_constant, name="backdoor_set_constant"),
url(r'^set_constants/', website_views.alt_set_constants, name="backdoor_set_constants"),
# train ddpg with results in the given session
url(r'^train_ddpg/sessions/(?P<session_id>[0-9]+)$', website_views.train_ddpg_loops, name='train_ddpg_loops'),

View File

@ -1141,19 +1141,16 @@ def alt_get_info(request, name):
@csrf_exempt
def alt_set_constant(request, name):
# Sets a constant defined in settings/constants.py
LOG.info('POST: %s', request.POST)
LOG.info('POST.lists(): %s', request.POST.lists())
value = request.POST['value']
LOG.info('name: %s, value: %s, type: %s', name, value, type(value))
#data = {k: v[0] for k, v in request.POST.lists()}
try:
utils.set_constant(name, value)
except AttributeError as e:
LOG.warning(e)
return HttpResponse(e, status=400)
return HttpResponse("Successfully updated {} to '{}'".format(name, value))
def alt_set_constants(request):
constants = JSONUtil.loads(request.POST.get('constants', '{}'))
for name, value in constants.items():
try:
utils.set_constant(name, value)
except AttributeError as e:
LOG.warning(e)
return HttpResponse(e, status=400)
return HttpResponse("Successfully updated constants: {}".format(
', '.join('{}={}'.format(k, v) for k, v in constants.items())))
@csrf_exempt