Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
weixin_47647075
emmagee
提交
669de8a9
E
emmagee
项目概览
weixin_47647075
/
emmagee
与 Fork 源项目一致
从无法访问的项目Fork
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
E
emmagee
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
669de8a9
编写于
7月 31, 2015
作者:
A
andrewleo
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Added: add ftp to csv
上级
2d2a44f9
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
70 addition
and
4 deletion
+70
-4
res/values-zh-rCN/strings.xml
res/values-zh-rCN/strings.xml
+1
-0
res/values/strings.xml
res/values/strings.xml
+1
-0
src/com/netease/qa/emmagee/service/EmmageeService.java
src/com/netease/qa/emmagee/service/EmmageeService.java
+5
-2
src/com/netease/qa/emmagee/utils/CpuInfo.java
src/com/netease/qa/emmagee/utils/CpuInfo.java
+2
-2
src/com/netease/qa/emmagee/utils/FpsInfo.java
src/com/netease/qa/emmagee/utils/FpsInfo.java
+61
-0
未找到文件。
res/values-zh-rCN/strings.xml
浏览文件 @
669de8a9
...
...
@@ -41,6 +41,7 @@
<string
name=
"current"
>
电流(mA)
</string>
<string
name=
"temperature"
>
温度(C)
</string>
<string
name=
"voltage"
>
电压(V)
</string>
<string
name=
"fps"
>
帧率
</string>
<string
name=
"stat_error"
>
统计出错
</string>
<string
name=
"comment1"
>
注释:已知部分不支持的机型可在此查阅:https://github.com/NetEase/Emmagee/wiki/Some-devices-are-not-supported
</string>
...
...
res/values/strings.xml
浏览文件 @
669de8a9
...
...
@@ -41,6 +41,7 @@
<string
name=
"current"
>
Current(mA)
</string>
<string
name=
"temperature"
>
Temperature(C)
</string>
<string
name=
"voltage"
>
Voltage(V)
</string>
<string
name=
"fps"
>
FPS
</string>
<string
name=
"stat_error"
>
Stat Error
</string>
<string
name=
"comment1"
>
Note: for unsupported devices refer to: https://github.com/NetEase/Emmagee/wiki/Some-devices-are-not-supported
</string>
...
...
src/com/netease/qa/emmagee/service/EmmageeService.java
浏览文件 @
669de8a9
...
...
@@ -65,6 +65,7 @@ import com.netease.qa.emmagee.utils.Constants;
import
com.netease.qa.emmagee.utils.CpuInfo
;
import
com.netease.qa.emmagee.utils.CurrentInfo
;
import
com.netease.qa.emmagee.utils.EncryptData
;
import
com.netease.qa.emmagee.utils.FpsInfo
;
import
com.netease.qa.emmagee.utils.MailSender
;
import
com.netease.qa.emmagee.utils.MemoryInfo
;
import
com.netease.qa.emmagee.utils.MyApplication
;
...
...
@@ -122,6 +123,7 @@ public class EmmageeService extends Service {
private
String
temperature
;
private
String
voltage
;
private
CurrentInfo
currentInfo
;
private
FpsInfo
fpsInfo
;
private
BatteryInfoBroadcastReceiver
batteryBroadcast
=
null
;
// get start time
...
...
@@ -139,6 +141,7 @@ public class EmmageeService extends Service {
super
.
onCreate
();
isServiceStop
=
false
;
isStop
=
false
;
fpsInfo
=
new
FpsInfo
();
memoryInfo
=
new
MemoryInfo
();
procInfo
=
new
ProcessInfo
();
fomart
=
new
DecimalFormat
();
...
...
@@ -300,7 +303,7 @@ public class EmmageeService extends Service {
+
getString
(
R
.
string
.
mobile_free_mem
)
+
Constants
.
COMMA
+
getString
(
R
.
string
.
app_used_cpu_ratio
)
+
Constants
.
COMMA
+
getString
(
R
.
string
.
total_used_cpu_ratio
)
+
multiCpuTitle
+
Constants
.
COMMA
+
getString
(
R
.
string
.
traffic
)
+
Constants
.
COMMA
+
getString
(
R
.
string
.
battery
)
+
Constants
.
COMMA
+
getString
(
R
.
string
.
current
)
+
Constants
.
COMMA
+
getString
(
R
.
string
.
temperature
)
+
Constants
.
COMMA
+
getString
(
R
.
string
.
voltage
)
+
Constants
.
LINE_END
);
+
Constants
.
COMMA
+
getString
(
R
.
string
.
voltage
)
+
Constants
.
COMMA
+
getString
(
R
.
string
.
fps
)
+
Constants
.
LINE_END
);
}
catch
(
IOException
e
)
{
Log
.
e
(
LOG_TAG
,
e
.
getMessage
());
}
...
...
@@ -457,7 +460,7 @@ public class EmmageeService extends Service {
}
catch
(
Exception
e
)
{
currentBatt
=
Constants
.
NA
;
}
ArrayList
<
String
>
processInfo
=
cpuInfo
.
getCpuRatioInfo
(
totalBatt
,
currentBatt
,
temperature
,
voltage
,
isRoot
);
ArrayList
<
String
>
processInfo
=
cpuInfo
.
getCpuRatioInfo
(
totalBatt
,
currentBatt
,
temperature
,
voltage
,
String
.
valueOf
(
fpsInfo
.
fps
()),
isRoot
);
if
(
isFloating
)
{
String
processCpuRatio
=
"0.00"
;
String
totalCpuRatio
=
"0.00"
;
...
...
src/com/netease/qa/emmagee/utils/CpuInfo.java
浏览文件 @
669de8a9
...
...
@@ -225,7 +225,7 @@ public class CpuInfo {
* @return network traffic ,used ratio of process CPU and total CPU in
* certain interval
*/
public
ArrayList
<
String
>
getCpuRatioInfo
(
String
totalBatt
,
String
currentBatt
,
String
temperature
,
String
voltage
,
boolean
isRoot
)
{
public
ArrayList
<
String
>
getCpuRatioInfo
(
String
totalBatt
,
String
currentBatt
,
String
temperature
,
String
voltage
,
String
fps
,
boolean
isRoot
)
{
String
heapData
=
""
;
DecimalFormat
fomart
=
new
DecimalFormat
();
...
...
@@ -315,7 +315,7 @@ public class CpuInfo {
EmmageeService
.
bw
.
write
(
mDateTime2
+
Constants
.
COMMA
+
ProcessInfo
.
getTopActivity
(
context
)
+
Constants
.
COMMA
+
heapData
+
pMemory
+
Constants
.
COMMA
+
percent
+
Constants
.
COMMA
+
fMemory
+
Constants
.
COMMA
+
processCpuRatio
+
Constants
.
COMMA
+
totalCpuBuffer
.
toString
()
+
trafValue
+
Constants
.
COMMA
+
totalBatt
+
Constants
.
COMMA
+
currentBatt
+
Constants
.
COMMA
+
temperature
+
Constants
.
COMMA
+
voltage
+
Constants
.
LINE_END
);
+
temperature
+
Constants
.
COMMA
+
voltage
+
Constants
.
COMMA
+
fps
+
Constants
.
LINE_END
);
totalCpu2
=
(
ArrayList
<
Long
>)
totalCpu
.
clone
();
processCpu2
=
processCpu
;
idleCpu2
=
(
ArrayList
<
Long
>)
idleCpu
.
clone
();
...
...
src/com/netease/qa/emmagee/utils/FpsInfo.java
0 → 100644
浏览文件 @
669de8a9
package
com.netease.qa.emmagee.utils
;
import
java.io.BufferedReader
;
import
java.io.DataOutputStream
;
import
java.io.IOException
;
import
java.io.InputStreamReader
;
public
class
FpsInfo
{
private
static
Process
process
;
private
static
BufferedReader
ir
;
private
static
DataOutputStream
os
=
null
;
private
static
long
startTime
=
0L
;
private
static
int
lastFrameNum
=
0
;
/**
* get frame per second
* @return frame per second
*/
public
static
float
fps
()
{
long
nowTime
=
System
.
nanoTime
();
float
f
=
(
float
)
(
nowTime
-
startTime
)
/
1000000.0
F
;
startTime
=
nowTime
;
int
nowFrameNum
=
getFrameNum
();
final
float
fps
=
Math
.
round
((
nowFrameNum
-
lastFrameNum
)
*
1000
/
f
);
lastFrameNum
=
nowFrameNum
;
return
fps
;
}
/**
* get frame value
*
* @return frame value
*/
public
static
final
int
getFrameNum
()
{
try
{
if
(
process
==
null
)
{
process
=
Runtime
.
getRuntime
().
exec
(
"su"
);
os
=
new
DataOutputStream
(
process
.
getOutputStream
());
ir
=
new
BufferedReader
(
new
InputStreamReader
(
process
.
getInputStream
()));
}
os
.
writeBytes
(
"service call SurfaceFlinger 1013"
+
"\n"
);
os
.
flush
();
String
str1
=
ir
.
readLine
();
if
(
str1
==
null
)
{
return
-
1
;
}
int
start
=
str1
.
indexOf
(
"("
);
int
end
=
str1
.
indexOf
(
" "
);
if
((
start
!=
-
1
)
&
(
end
>
start
))
{
String
str2
=
str1
.
substring
(
start
+
1
,
end
);
return
Integer
.
parseInt
((
String
)
str2
,
16
);
}
return
-
1
;
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
return
-
1
;
}
}
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录