|
import pandas as pd |
|
import plotly.express as px |
|
import streamlit as st |
|
|
|
from process_kpi.process_wcel_capacity import ( |
|
WcelCapacity, |
|
load_and_process_wcel_capacity_data, |
|
) |
|
from utils.convert_to_excel import convert_dfs |
|
|
|
|
|
|
|
st.title(" π WCEL Capacity Analysis") |
|
doc_col, image_col = st.columns(2) |
|
|
|
with doc_col: |
|
st.write( |
|
"""This app allows you to analyze the capacity of WCELS in a network. |
|
It provides insights into the utilization of BB and CE resources, |
|
helping you identify potential capacity issues and plan for upgrades. |
|
|
|
The report should be run with a minimum of 3 days of data. |
|
- Daily Aggregated |
|
- WCEL level |
|
- Exported in CSV format. |
|
""" |
|
) |
|
|
|
with image_col: |
|
st.image("./assets/wbts_capacity.png", width=400) |
|
|
|
uploaded_file = st.file_uploader( |
|
"Upload WCEL capacity report in CSV format", type="csv" |
|
) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
param_col1, param_col2, param_col3 = st.columns(3) |
|
param_col4, param_col5, param_col6 = st.columns(3) |
|
|
|
|
|
if uploaded_file is not None: |
|
WcelCapacity.final_results = None |
|
with param_col1: |
|
num_last_days = st.number_input( |
|
"Number of days for analysis", |
|
min_value=3, |
|
max_value=30, |
|
value=7, |
|
) |
|
with param_col2: |
|
num_threshold_days = st.number_input( |
|
"Number of days for threshold", |
|
min_value=1, |
|
max_value=30, |
|
value=2, |
|
) |
|
with param_col3: |
|
availability_threshold = st.number_input( |
|
"Availability threshold (%)", value=99, min_value=0, max_value=100 |
|
) |
|
with param_col4: |
|
iub_frameloss_threshold = st.number_input( |
|
"IUB frameloss threshold (%)", |
|
value=100, |
|
min_value=0, |
|
max_value=10000000, |
|
) |
|
with param_col5: |
|
hsdpa_congestion_rate_iub_threshold = st.number_input( |
|
"HSDPA Congestion Rate IUB threshold (%)", |
|
value=10, |
|
min_value=0, |
|
max_value=100, |
|
) |
|
with param_col6: |
|
fails_treshold = st.number_input( |
|
"Fails threshold (%)", value=10, min_value=0, max_value=10000000 |
|
) |
|
|
|
if st.button("Analyze Data", type="primary"): |
|
with st.spinner("Processing data..."): |
|
results = load_and_process_wcel_capacity_data( |
|
uploaded_file, |
|
num_last_days, |
|
num_threshold_days, |
|
availability_threshold, |
|
iub_frameloss_threshold, |
|
hsdpa_congestion_rate_iub_threshold, |
|
fails_treshold, |
|
) |
|
|
|
if results is not None: |
|
|
|
kpi_df = results[0] |
|
|
|
WcelCapacity.final_results = convert_dfs([kpi_df], ["kpi_df"]) |
|
st.download_button( |
|
on_click="ignore", |
|
type="primary", |
|
label="Download the Analysis Report", |
|
data=WcelCapacity.final_results, |
|
file_name="WCEL_Capacity_Report.xlsx", |
|
mime="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", |
|
) |
|
st.write(kpi_df) |
|
|