Notebooks
S
Snowflake
Warehouse Utilization With Streamlit

Warehouse Utilization With Streamlit

data-sciencenotebookmachine-learningsnowflake-demo-notebooksWarehouse_Utilization_with_Streamlitdata-engineeringPythonsql

Analyze Warehouse Utilization in Snowflake Notebooks with Streamlit

A notebook that generates a heatmap of warehouse usage patterns to identify peak hours that can help with cost optimization.

Here's what we're implementing to investigate the tables:

  1. Retrieve warehouse utilization data
  2. Convert table to a DataFrame
  3. Create an interactive slider widget
  4. Create a Heatmap for visualizing warehouse usage patterns

1. Retrieve warehouse utilization data

Firstly, we'll write a SQL query to retrieve warehouse utilization data.

[ ]

2. Convert table to a DataFrame

Next, we'll convert the table to a Pandas DataFrame.

[ ]

3. Create an Interactive slider widget

Let's create an interactive slider using Streamlit. This would allow users to select the number of days to analyze, which would filter the DataFrame.

Finally, we'll calculate the total warehouse load (TOTAL_LOAD) and format the hour display (HOUR_DISPLAY) for each record.

[ ]

4. Create a Heatmap for visualizing warehouse usage patterns

Finally, we're create a heatmap using Altair. The heatmap shows the warehouse usage pattern across different hours of the day. Color intensity represents the total load and interactive tooltips showing detailed metrics for each cell.

[ ]

Want to learn more?