1 Star 1 Fork 0

kongkong / android-performance

加入 Gitee
与超过 800 万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
time.sh 1.25 KB
一键复制 编辑 Web IDE 原始数据 按行查看 历史
kongkong 提交于 2016-04-08 17:15 . add shell
#!/usr/bin/env bash
deviceId=$1
host='http://agile.meiliworks.com/data_mgr/save/dashboard'
if [ $# != 1 ]; then
echo "sh time.sh deviceId"
exit 1;
fi
currentDir=$(cd "$(dirname "$0")"; pwd)
sh ${currentDir}/src/main/resources/apk-install-time.sh $deviceId
sh ${currentDir}/src/main/resources/apk-launcher-time.sh $deviceId
installTimeFile=${currentDir}/src/main/resources/install-time.txt
launcherTimeFile=${currentDir}/src/main/resources/launcher-time.txt
installTime=`cat ${installTimeFile}`
welcomeTime=`sed -n 1p ${launcherTimeFile}`
mainTime=`sed -n 2p ${launcherTimeFile}`
welcomeTime=`echo "scale=3; ${welcomeTime}/1000" | bc`
mainTime=`echo "scale=3; ${mainTime}/1000" | bc`
#如果小于1秒钟
startChar=`echo ${welcomeTime:0:1}`
echo $startChar
if [ "${startChar}" == "." ]; then
welcomeTime="0"${welcomeTime}
fi
startChar=`echo ${mainTime:0:1}`
if [ "${startChar}" == "." ]; then
mainTime="0"${mainTime}
fi
echo "install Time "${installTime}
echo "welcome "${welcomeTime}
echo "mainTime "${mainTime}
timestamp=`date "+%s"`
curl -X POST $host -d '{"env":"MOB", "type": "TIME", "runStartTime":"'${timestamp}'", "runEndTime":"'${timestamp}'", "data":{"install_time":'${installTime}',"welcome_time":'${welcomeTime}',"main_time":'${mainTime}'}}'
1
https://gitee.com/yeetrack/android-performance.git
git@gitee.com:yeetrack/android-performance.git
yeetrack
android-performance
android-performance
master

搜索帮助