nuclearpinguin commented on a change in pull request #7370: [AIRFLOW-6590] Use batch db operations in jobs URL: https://github.com/apache/airflow/pull/7370#discussion_r377109262
########## File path: scripts/perf/sql_queries.py ########## @@ -0,0 +1,178 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +import os +from time import sleep, time +from typing import List, NamedTuple, Optional, Tuple + +import pandas as pd + +# Setup environment before any Airflow import +DAG_FOLDER = "/opt/airflow/scripts/perf/dags" +os.environ["AIRFLOW__CORE__DAGS_FOLDER"] = DAG_FOLDER +os.environ["AIRFLOW__DEBUG__SQLALCHEMY_STATS"] = "True" +os.environ["AIRFLOW__CORE__LOAD_EXAMPLES"] = "False" + +# Here we setup simpler logger to avoid any code changes in +# Airflow core code base +LOG_LEVEL = "INFO" +LOG_FILE = "/files/sql_stats.log" # Default to run in Breeze Review comment: Hm, hardcoding this for breeze has an advantage that it works out of the box in a single environment. Not hardcoding has no advantages to me. Especially that if someone what to play with it and use other places they will have to adjust it anyway 🤷🏼♂️ ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services