Skip to content

Commit

Permalink
fixed bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
rafa0128 committed Jun 19, 2023
1 parent 1e8650c commit 963cef5
Show file tree
Hide file tree
Showing 10 changed files with 26 additions and 23 deletions.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
setuptools.setup(
install_requires=['flask>=2.0.1', 'requests', 'logzero', 'Flask-SocketIO==4.3.1', 'fire',
'python-engineio==3.13.2', 'python-socketio==4.6.0', 'Werkzeug==2.0.3',
'Jinja2==3.0.1','tidevice==0.9.7', 'tqdm', 'xlwt'],
'Jinja2==3.0.1','tidevice==0.9.7', 'tqdm', 'xlwt','pyfiglet'],
version=__version__,
long_description=long_description,
long_description_content_type="text/markdown",
Expand Down
2 changes: 1 addition & 1 deletion solox/public/apm.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ def getAndroidCpuRate(self, noLog=False):
processCpuTime_1 = self.getprocessCpuStat()
totalCpuTime_1 = self.getTotalCpuStat()
sysCpuTime_1 = self.getSysCpuStat()
time.sleep(1)
time.sleep(0.5)
processCpuTime_2 = self.getprocessCpuStat()
totalCpuTime_2 = self.getTotalCpuStat()
sysCpuTime_2 = self.getSysCpuStat()
Expand Down
4 changes: 2 additions & 2 deletions solox/public/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -704,8 +704,8 @@ def downloadLink(self,filelink=None, path=None, name=None):
pbar.update(1024)
pbar.close()
return True
except:
traceback.print_exc()
except Exception as e:
logger.exception(e)
return False

def installAPK(self, path):
Expand Down
2 changes: 1 addition & 1 deletion solox/templates/analysis.html
Original file line number Diff line number Diff line change
Expand Up @@ -420,7 +420,7 @@
</div>
<div class="card mem-card mt-3">
<div class="card-header">
<div class='card-title'>MEM(MB)</div>
<div class='card-title'>Memory(MB)</div>
<div class="card-actions btn-actions">
<a class="btn-action cursor-pointer" id="mem_loading">
<svg xmlns="http://www.w3.org/2000/svg" class="icon" width="24" height="24" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M20 11a8.1 8.1 0 0 0 -15.5 -2m-.5 -4v4h4" /><path d="M4 13a8.1 8.1 0 0 0 15.5 2m.5 4v-4h-4" /></svg>
Expand Down
16 changes: 8 additions & 8 deletions solox/templates/analysis_compare.html
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@
</div>
<div class="card mem-card mt-3">
<div class="card-header">
<div class='card-title'>MEM(MB): Total Usage</div>
<div class='card-title'>Memory(MB): Total Usage</div>
<div class="card-actions btn-actions">
<a class="btn-action cursor-pointer" id="mem_loading">
<svg xmlns="http://www.w3.org/2000/svg" class="icon" width="24" height="24" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M20 11a8.1 8.1 0 0 0 -15.5 -2m-.5 -4v4h4" /><path d="M4 13a8.1 8.1 0 0 0 15.5 2m.5 4v-4h-4" /></svg>
Expand Down Expand Up @@ -374,7 +374,7 @@
return options
}

var cpu_chart = new ApexCharts(document.querySelector("#chart-cpu"), options('bar'));
var cpu_chart = new ApexCharts(document.querySelector("#chart-cpu"), options('line'));
cpu_chart.render();
$('#cpu_loading').click(function () {
$.ajax({
Expand Down Expand Up @@ -406,7 +406,7 @@
});
});

var battery_chart = new ApexCharts(document.querySelector("#chart-battery"), options('bar'));
var battery_chart = new ApexCharts(document.querySelector("#chart-battery"), options('line'));
battery_chart.render();
$('#battery_loading').click(function () {
$.ajax({
Expand Down Expand Up @@ -438,7 +438,7 @@
});
});
if(platform == 'iOS'){
var gpu_chart = new ApexCharts(document.querySelector("#chart-gpu"), options('bar'));
var gpu_chart = new ApexCharts(document.querySelector("#chart-gpu"), options('line'));
gpu_chart.render();
$('#gpu_loading').click(function () {
$.ajax({
Expand Down Expand Up @@ -471,7 +471,7 @@
});
}

var fps_chart = new ApexCharts(document.querySelector("#chart-fps"), options('bar'));
var fps_chart = new ApexCharts(document.querySelector("#chart-fps"), options('line'));
fps_chart.render();
$('#fps_loading').click(function () {
$.ajax({
Expand Down Expand Up @@ -503,7 +503,7 @@
});
});

var mem_chart = new ApexCharts(document.querySelector("#chart-mem"), options('bar'));
var mem_chart = new ApexCharts(document.querySelector("#chart-mem"), options('line'));
mem_chart.render();
$('#mem_loading').click(function () {
$.ajax({
Expand Down Expand Up @@ -535,7 +535,7 @@
});
});

var network_recv_chart = new ApexCharts(document.querySelector("#chart-networkdata-recv"), options('bar',false));
var network_recv_chart = new ApexCharts(document.querySelector("#chart-networkdata-recv"), options('line',false));
network_recv_chart.render();
$('#networkdata_recv_loading').click(function () {
$.ajax({
Expand Down Expand Up @@ -567,7 +567,7 @@
});
});

var network_send_chart = new ApexCharts(document.querySelector("#chart-networkdata-send"), options('bar',false));
var network_send_chart = new ApexCharts(document.querySelector("#chart-networkdata-send"), options('line',false));
network_send_chart.render();
$('#networkdata_send_loading').click(function () {
$.ajax({
Expand Down
2 changes: 1 addition & 1 deletion solox/templates/analysis_pk.html
Original file line number Diff line number Diff line change
Expand Up @@ -406,7 +406,7 @@
</div>
<div class="card mem-card mt-3">
<div class="card-header">
<div class='card-title'>MEM(MB)</div>
<div class='card-title'>Memory(MB)</div>
<div class="card-actions btn-actions">
<a class="btn-action cursor-pointer" id="mem_loading">
<svg xmlns="http://www.w3.org/2000/svg" class="icon" width="24" height="24" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M20 11a8.1 8.1 0 0 0 -15.5 -2m-.5 -4v4h4" /><path d="M4 13a8.1 8.1 0 0 0 15.5 2m.5 4v-4h-4" /></svg>
Expand Down
4 changes: 2 additions & 2 deletions solox/templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ <h2 class="page-title">
</li>
<li class="list-inline-item">
<a href="https://github.com/smart-test-ti/SoloX/releases" target="_blank" class="link-secondary" rel="noopener">
{% if lan == 'cn' %} 版本 {% else %} Releases {% endif %} . V2.6.6
{% if lan == 'cn' %} 版本 {% else %} Releases {% endif %} . V2.6.7
</a>
</li>
</ul>
Expand All @@ -151,7 +151,7 @@ <h2 class="offcanvas-title" id="offcanvasEndLabel">
<div class="card-tabs">
<ul class="nav nav-tabs">
<!-- https://adbshell.com/commands/adb-connect -->
<li class="nav-item"><a href="#tab-top-2" class="nav-link" data-bs-toggle="tab">{% if lan == 'cn' %} 告警值 {% else %} Warning Value {% endif %}</a></li>
<li class="nav-item active"><a href="#tab-top-2" class="nav-link active" data-bs-toggle="tab">{% if lan == 'cn' %} 告警值 {% else %} Warning Value {% endif %}</a></li>
<li class="nav-item"><a href="#tab-top-3" class="nav-link" data-bs-toggle="tab">{% if lan == 'cn' %} 定时器 {% else %} Timer {% endif %}</a></li>
<li class="nav-item"><a href="#tab-top-4" class="nav-link" data-bs-toggle="tab">{% if lan == 'cn' %} 远程访问 {% else %} Remote {% endif %} &nbsp;
{% if lan == 'en' %}
Expand Down
10 changes: 5 additions & 5 deletions solox/templates/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -509,7 +509,7 @@ <h2 class="offcanvas-title" id="offcanvasBottomLabel">Start-up Time</h2>
y_sys = data['systemCpuRate'];
app_series.addPoint([x, y_app], true, true);
sys_series.addPoint([x, y_sys], true, true);
timerQ = setTimeout(getCpuRate(pkgname,device), 1500);
timerQ = setTimeout(getCpuRate(pkgname,device), 1000);
}catch (e) {}
}else{
SwalFire('error','something error',data['msg'],2000);
Expand Down Expand Up @@ -600,7 +600,7 @@ <h2 class="offcanvas-title" id="offcanvasBottomLabel">Start-up Time</h2>
seriesVoltage.addPoint([x, y_voltage], true, true);
seriesPower.addPoint([x, y_power], true, true);
}
timerQ = setTimeout(getBattery(device), 10000);
timerQ = setTimeout(getBattery(device), 1000);
}catch (e) {}
}else{
SwalFire('error','something error',data['msg'],2000);
Expand Down Expand Up @@ -656,7 +656,7 @@ <h2 class="offcanvas-title" id="offcanvasBottomLabel">Start-up Time</h2>
y = data['totalPass'];
series.addPoint([x, y], true, true);
}
timerQ = setTimeout(getMemPss(pkgname,device), 1500);
timerQ = setTimeout(getMemPss(pkgname,device), 1000);

}catch (e) {}
}else{
Expand Down Expand Up @@ -734,7 +734,7 @@ <h2 class="offcanvas-title" id="offcanvasBottomLabel">Start-up Time</h2>
y_down = data['downflow'];
seriesUpFlow.addPoint([x_up, y_up], true, true);
seriesDownFlow.addPoint([x_down, y_down], true, true);
timerQ = setTimeout(getNetWork(pkgname,device,net_switch), 1500);
timerQ = setTimeout(getNetWork(pkgname,device,net_switch), 1000);
}catch (e) {
console.log(e)
}
Expand Down Expand Up @@ -781,7 +781,7 @@ <h2 class="offcanvas-title" id="offcanvasBottomLabel">Start-up Time</h2>
y_jank = data['jank'];
seriesJank.addPoint([x_jsnk, y_jank], true, true);
}
timerQ = setTimeout(getFps(pkgname,device,fps_switch), 1500);
timerQ = setTimeout(getFps(pkgname,device,fps_switch), 1000);
}catch (e) {}
}else{
SwalFire('error','something error',data['msg'],2000);
Expand Down
4 changes: 2 additions & 2 deletions solox/templates/pk.html
Original file line number Diff line number Diff line change
Expand Up @@ -550,7 +550,7 @@ <h6 class="dropdown-header">{% if lan == 'cn' %} 性能指标 {% else %} APM Tar

function memInitialize(){
//初始化mem
let mem_chart = chartsInitialize('mem','MEM(MB)');
let mem_chart = chartsInitialize('mem','Memory(MB)');
return mem_chart
}

Expand Down Expand Up @@ -649,7 +649,7 @@ <h6 class="dropdown-header">{% if lan == 'cn' %} 性能指标 {% else %} APM Tar

function collectMem(device,pkgname){
memInitialize();
mem_chart = collectPers(device,pkgname,'mem','MEM(MB)',getMemPss(pkgname,device));
mem_chart = collectPers(device,pkgname,'mem','Memory(MB)',getMemPss(pkgname,device));
}

function collectNetwork(device,pkgname){
Expand Down
3 changes: 3 additions & 0 deletions solox/web.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
from threading import Lock
from flask_socketio import SocketIO, disconnect
from flask import Flask
from pyfiglet import Figlet

app = Flask(__name__, template_folder='templates', static_folder='static')
app.register_blueprint(api)
Expand Down Expand Up @@ -108,6 +109,8 @@ def openUrl(host: str, port: int):
flag = True
while flag:
logger.info('Start solox server ...')
f = Figlet(font="slant", width=300)
print(f.renderText("SOLOX 2. 6. 7"))
flag = getServerStatus(host, port)
webbrowser.open('http://{}:{}/?platform=Android&lan=en'.format(host, port), new=2)
logger.info('Running on http://{}:{}/?platform=Android&lan=en (Press CTRL+C to quit)'.format(host, port))
Expand Down

0 comments on commit 963cef5

Please sign in to comment.