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.3 kB

5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  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. import multiprocessing
  18. ####################################
  19. # Global default settings.
  20. ####################################
  21. LOG_FORMAT = '[%(levelname)s] MI(%(process)d:%(thread)d,%(processName)s):%(asctime)s ' \
  22. '[%(filepath)s:%(lineno)d][%(sub_module)s] %(message)s'
  23. GUNICORN_ACCESS_FORMAT = "'%(t)s %(h)s <%(r)s> %(s)s %(b)s <%(f)s> <%(a)s> %(L)s '"
  24. LOG_LEVEL = logging.INFO
  25. # rotating max bytes, default is 50M
  26. LOG_ROTATING_MAXBYTES = 52428800
  27. # rotating backup count, default is 30
  28. LOG_ROTATING_BACKUPCOUNT = 30
  29. ####################################
  30. # Web default settings.
  31. ####################################
  32. HOST = '127.0.0.1'
  33. # Allow to support cross origin resource sharing(CORS) enable. Default is disable.
  34. # If enable CORS, `SUPPORT_REQUEST_METHODS` should enable 'OPTIONS' method.
  35. ENABLE_CORS = False
  36. SUPPORT_REQUEST_METHODS = {'POST', 'GET', 'PUT', 'DELETE'}
  37. # api prefix should not end with slash, correct format is /v1/url
  38. API_PREFIX = '/v1/mindinsight'
  39. ####################################
  40. # Datavisual default settings.
  41. ####################################
  42. MAX_PROCESSES_COUNT = max(min(int(multiprocessing.cpu_count() * 0.75), 45), 1)
  43. MAX_TAG_SIZE_PER_EVENTS_DATA = 300
  44. DEFAULT_STEP_SIZES_PER_TAG = 500
  45. MAX_GRAPH_TAG_SIZE = 10
  46. MAX_TENSOR_TAG_SIZE = 6
  47. MAX_IMAGE_STEP_SIZE_PER_TAG = 10
  48. MAX_RELOAD_INTERVAL = 300
  49. MAX_SCALAR_STEP_SIZE_PER_TAG = 1000
  50. MAX_GRAPH_STEP_SIZE_PER_TAG = 1
  51. MAX_HISTOGRAM_STEP_SIZE_PER_TAG = 50
  52. MAX_TENSOR_STEP_SIZE_PER_TAG = 20
  53. MAX_TENSOR_RESPONSE_DATA_SIZE = 100000
  54. ENABLE_RECOMMENDED_WATCHPOINTS = True