You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

constants.py 2.1 kB

5 years ago
5 years ago
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. # Copyright 2019 Huawei Technologies Co., Ltd
  2. #
  3. # Licensed under the Apache License, Version 2.0 (the "License");
  4. # you may not use this file except in compliance with the License.
  5. # You may obtain a copy of the License at
  6. #
  7. # http://www.apache.org/licenses/LICENSE-2.0
  8. #
  9. # Unless required by applicable law or agreed to in writing, software
  10. # distributed under the License is distributed on an "AS IS" BASIS,
  11. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. # See the License for the specific language governing permissions and
  13. # limitations under the License.
  14. # ============================================================================
  15. """Constants module for mindinsight settings."""
  16. import logging
  17. ####################################
  18. # Global default settings.
  19. ####################################
  20. LOG_FORMAT = '[%(levelname)s] MI(%(process)d:%(thread)d,%(processName)s):%(asctime)s ' \
  21. '[%(filepath)s:%(lineno)d][%(sub_module)s] %(message)s'
  22. GUNICORN_ACCESS_FORMAT = "'%(h)s <%(r)s> %(s)s %(b)s <%(f)s> <%(a)s> %(D)s'"
  23. LOG_LEVEL = logging.INFO
  24. # rotating max bytes, default is 50M
  25. LOG_ROTATING_MAXBYTES = 52428800
  26. # rotating backup count, default is 30
  27. LOG_ROTATING_BACKUPCOUNT = 30
  28. ####################################
  29. # Web default settings.
  30. ####################################
  31. HOST = '127.0.0.1'
  32. # Allow to support cross origin resource sharing(CORS) enable. Default is disable.
  33. # If enable CORS, `SUPPORT_REQUEST_METHODS` should enable 'OPTIONS' method.
  34. ENABLE_CORS = False
  35. SUPPORT_REQUEST_METHODS = {'POST', 'GET', 'PUT', 'DELETE'}
  36. # api prefix should not end with slash, correct format is /v1/url
  37. API_PREFIX = '/v1/mindinsight'
  38. ####################################
  39. # Datavisual default settings.
  40. ####################################
  41. MAX_THREADS_COUNT = 15
  42. MAX_TAG_SIZE_PER_EVENTS_DATA = 300
  43. DEFAULT_STEP_SIZES_PER_TAG = 500
  44. MAX_GRAPH_TAG_SIZE = 10
  45. MAX_IMAGE_STEP_SIZE_PER_TAG = 10
  46. MAX_SCALAR_STEP_SIZE_PER_TAG = 1000
  47. MAX_GRAPH_STEP_SIZE_PER_TAG = 1
  48. MAX_HISTOGRAM_STEP_SIZE_PER_TAG = 50