diff --git a/AndroidManifest.xml b/AndroidManifest.xml index 3b97244..202bbd5 100644 --- a/AndroidManifest.xml +++ b/AndroidManifest.xml @@ -2,7 +2,7 @@ + android:versionName="2.1" > diff --git a/README.md b/README.md index 422cbe5..be544a5 100644 --- a/README.md +++ b/README.md @@ -42,7 +42,7 @@ And Enjoy! If you want to stop the test, just go back to Emmagee and click Stop button. ## Coming Soon -* Integrating FPS +* We want you to decide! ## How to Contribute? @@ -56,11 +56,12 @@ You are welcome to contribute to Emmagee, meanwhile you'd better follow the rule ## Contributors * NetEase, Inc. * [yrom](https://github.com/yrom) +* [LukeOwncloud](https://github.com/LukeOwncloud) ## License (The Apache License) -Copyright (c) 2012-2014 NetEase, Inc. and other contributors +Copyright (c) 2012-2015 NetEase, Inc. and other contributors Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/src/com/netease/qa/emmagee/service/EmmageeService.java b/src/com/netease/qa/emmagee/service/EmmageeService.java index 745434f..a965ad4 100644 --- a/src/com/netease/qa/emmagee/service/EmmageeService.java +++ b/src/com/netease/qa/emmagee/service/EmmageeService.java @@ -441,7 +441,7 @@ private void dataRefresh() { String processCpuRatio = "0.00"; String totalCpuRatio = "0.00"; String trafficSize = "0"; - int tempTraffic = 0; + long tempTraffic = 0L; double trafficMb = 0; boolean isMb = false; if (!processInfo.isEmpty()) { @@ -449,7 +449,7 @@ private void dataRefresh() { totalCpuRatio = processInfo.get(1); trafficSize = processInfo.get(2); if (!(BLANK_STRING.equals(trafficSize)) && !("-1".equals(trafficSize))) { - tempTraffic = Integer.parseInt(trafficSize); + tempTraffic = Long.parseLong(trafficSize); if (tempTraffic > 1024) { isMb = true; trafficMb = (double) tempTraffic / 1024; diff --git a/src/com/netease/qa/emmagee/utils/CpuInfo.java b/src/com/netease/qa/emmagee/utils/CpuInfo.java index 58c750b..a59e590 100644 --- a/src/com/netease/qa/emmagee/utils/CpuInfo.java +++ b/src/com/netease/qa/emmagee/utils/CpuInfo.java @@ -260,8 +260,11 @@ public ArrayList getCpuRatioInfo(String totalBatt, String currentBatt, S lastestTraffic = trafficInfo.getTrafficInfo(); if (initialTraffic == -1) traffic = -1; - else + else { traffic = (lastestTraffic - initialTraffic + 1023) / 1024; + } + Log.d(LOG_TAG, "lastestTraffic===" + lastestTraffic); + Log.d(LOG_TAG, "initialTraffic===" + initialTraffic); StringBuffer totalCpuBuffer = new StringBuffer(); if (null != totalCpu2 && totalCpu2.size() > 0) { processCpuRatio = fomart.format(100 * ((double) (processCpu - processCpu2) / ((double) (totalCpu.get(0) - totalCpu2.get(0))))); diff --git a/src/com/netease/qa/emmagee/utils/TrafficInfo.java b/src/com/netease/qa/emmagee/utils/TrafficInfo.java index be692a7..69ec248 100644 --- a/src/com/netease/qa/emmagee/utils/TrafficInfo.java +++ b/src/com/netease/qa/emmagee/utils/TrafficInfo.java @@ -29,8 +29,7 @@ */ public class TrafficInfo { - private static final String LOG_TAG = "Emmagee-" - + TrafficInfo.class.getSimpleName(); + private static final String LOG_TAG = "Emmagee-" + TrafficInfo.class.getSimpleName(); private String uid; @@ -46,6 +45,7 @@ public TrafficInfo(String uid) { */ public long getTrafficInfo() { Log.i(LOG_TAG, "get traffic information"); + Log.d(LOG_TAG, "uid===" + uid); RandomAccessFile rafRcv = null, rafSnd = null; String rcvPath = "/proc/uid_stat/" + uid + "/tcp_rcv"; String sndPath = "/proc/uid_stat/" + uid + "/tcp_snd"; @@ -73,10 +73,11 @@ public long getTrafficInfo() { if (rafSnd != null) rafSnd.close(); } catch (IOException e) { - Log.i(LOG_TAG, - "close randomAccessFile exception: " + e.getMessage()); + Log.i(LOG_TAG, "close randomAccessFile exception: " + e.getMessage()); } } + Log.d(LOG_TAG, "rcvTraffic===" + rcvTraffic); + Log.d(LOG_TAG, "sndTraffic===" + sndTraffic); if (rcvTraffic == -1 || sndTraffic == -1) { return -1; } else