github.com/apache/beam/sdks/v2@v2.48.2/python/apache_beam/testing/analyzers/constants.py (about) 1 # 2 # Licensed to the Apache Software Foundation (ASF) under one or more 3 # contributor license agreements. See the NOTICE file distributed with 4 # this work for additional information regarding copyright ownership. 5 # The ASF licenses this file to You under the Apache License, Version 2.0 6 # (the "License"); you may not use this file except in compliance with 7 # the License. You may obtain a copy of the License at 8 # 9 # http://www.apache.org/licenses/LICENSE-2.0 10 # 11 # Unless required by applicable law or agreed to in writing, software 12 # distributed under the License is distributed on an "AS IS" BASIS, 13 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 # See the License for the specific language governing permissions and 15 # limitations under the License. 16 # 17 18 """The file defines global variables for performance analysis.""" 19 20 _BQ_PROJECT_NAME = 'apache-beam-testing' 21 _BQ_DATASET = 'beam_perf_storage' 22 23 _UNIQUE_ID = 'test_id' 24 _ISSUE_CREATION_TIMESTAMP_LABEL = 'issue_timestamp' 25 _CHANGE_POINT_TIMESTAMP_LABEL = 'change_point_timestamp' 26 _CHANGE_POINT_LABEL = 'change_point' 27 _TEST_NAME = 'test_name' 28 _METRIC_NAME = 'metric_name' 29 _ISSUE_NUMBER = 'issue_number' 30 _ISSUE_URL = 'issue_url' 31 # number of results to display on the issue description 32 # from change point index in both directions. 33 _NUM_RESULTS_TO_DISPLAY_ON_ISSUE_DESCRIPTION = 10 34 _NUM_DATA_POINTS_TO_RUN_CHANGE_POINT_ANALYSIS = 100 35 # Variables used for finding duplicate change points. 36 _DEFAULT_MIN_RUNS_BETWEEN_CHANGE_POINTS = 3 37 _DEFAULT_NUM_RUMS_IN_CHANGE_POINT_WINDOW = 14 38 39 _PERF_TEST_KEYS = { 40 'test_name', 'metrics_dataset', 'metrics_table', 'project', 'metric_name' 41 } 42 43 _SCHEMA = [{ 44 'name': _UNIQUE_ID, 'field_type': 'STRING', 'mode': 'REQUIRED' 45 }, 46 { 47 'name': _ISSUE_CREATION_TIMESTAMP_LABEL, 48 'field_type': 'TIMESTAMP', 49 'mode': 'REQUIRED' 50 }, 51 { 52 'name': _CHANGE_POINT_TIMESTAMP_LABEL, 53 'field_type': 'TIMESTAMP', 54 'mode': 'REQUIRED' 55 }, 56 { 57 'name': _CHANGE_POINT_LABEL, 58 'field_type': 'FLOAT64', 59 'mode': 'REQUIRED' 60 }, { 61 'name': _METRIC_NAME, 'field_type': 'STRING', 'mode': 'REQUIRED' 62 }, { 63 'name': _TEST_NAME, 'field_type': 'STRING', 'mode': 'REQUIRED' 64 }, { 65 'name': _ISSUE_NUMBER, 'field_type': 'INT64', 'mode': 'REQUIRED' 66 }, { 67 'name': _ISSUE_URL, 'field_type': 'STRING', 'mode': 'REQUIRED' 68 }]