Skip to content

Commit

Permalink
Added Profiling Report
Browse files Browse the repository at this point in the history
  • Loading branch information
QAInsights committed Dec 24, 2019
1 parent 6096b22 commit c96059c
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 4 deletions.
Binary file modified __pycache__/about.cpython-37.pyc
Binary file not shown.
Binary file added __pycache__/about.cpython-38.pyc
Binary file not shown.
3 changes: 2 additions & 1 deletion about.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,10 @@ def display_about():

st.markdown('![JMeter Streamlit](https://raw.githubusercontent.com/QAInsights/Streamlit-JMeter/master/images/header.jpg)')
st.markdown('### Limitations')
st.markdown('* Supports only CSV results ')
st.markdown('* Supports only CSV results')
st.markdown('* By default, it fetches all the files from the `JMETER_HOME` folder.')
st.markdown('* Limited number of charts has been added, other type of charts can be added by custom coding.')
st.markdown('* Doesn\'t support distributed load testing model.')

st.markdown('### Known Issues')
st.markdown('* Doesn\'t execute if the JMeter file name which has space')
Expand Down
27 changes: 25 additions & 2 deletions app.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
import string
import random
import streamlit as st
import pandas as pd
import numpy as np
import datetime
import numpy as np
import subprocess
import os
import uuid
import about
import pandas_profiling
from pandas import DataFrame

# Get JMETER_HOME environment variable
Expand All @@ -18,6 +20,18 @@ def main_about():
st.markdown('---')
#Display About section

def pd_profile(filename):
df = pd.read_csv(JMETER_PATH + '\\bin\\' + filename)
report = pandas_profiling.ProfileReport(df)
#st.write(pandas_profiling.__version__)
random_filename = ''.join(random.choices(string.ascii_uppercase + string.digits, k = 24))
random_filename = random_filename + ".html"
st.write('Report file name is `%s`' % random_filename + ' . Report is located at ' + JMETER_PATH + '\\bin\\')
#st.write('You selected `%s`' % selected_filename + '. To execute this test plan, click on Run button as shown below.')
report.to_file(output_file=random_filename)
#st.markdown(report)
return

def jmeter_execute_load():
global JMETER_PATH
#Changing Directory to Root
Expand Down Expand Up @@ -99,8 +113,17 @@ def main():
# Show Graphs Checkbox
show_graphs = st.checkbox('Show Graphs')

st.title('Apache JMeter Load Test Results')
# Show Profiling Report
profile_report = st.button('Generate Profiling Report')

# Generate Profiling Report

if profile_report:
st.write('Generating Report for ', filename)
pd_profile(filename)


st.title('Apache JMeter Load Test Results')
data = pd.read_csv(DATA_URL)

#Display Start Time
Expand Down
3 changes: 2 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
pandas
numpy
streamlit
streamlit
pandas-profiling

0 comments on commit c96059c

Please sign in to comment.