summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author TreeHugger Robot <treehugger-gerrit@google.com> 2017-12-17 17:01:36 +0000
committer Android (Google) Code Review <android-gerrit@google.com> 2017-12-17 17:01:36 +0000
commite6abcbed993c81562cddb4122235fc2bcffff8e8 (patch)
tree4f3a70c7cba0f60d65587e536d5710ae6599a51e
parentdc4e426a17044f799ad1d7bd8a363022e8044619 (diff)
parent3c0b95ceb520c6b23871da90c23f89c55b76b560 (diff)
Merge "Turn off verbose logging, remove the fake config."
-rw-r--r--cmds/statsd/src/Log.h3
-rw-r--r--cmds/statsd/src/condition/CombinationConditionTracker.cpp2
-rw-r--r--cmds/statsd/src/config/ConfigManager.cpp5
-rw-r--r--cmds/statsd/src/metrics/CountMetricProducer.cpp2
-rw-r--r--cmds/statsd/src/metrics/DurationMetricProducer.cpp2
-rw-r--r--cmds/statsd/src/metrics/EventMetricProducer.cpp2
-rw-r--r--cmds/statsd/src/metrics/GaugeMetricProducer.cpp2
-rw-r--r--cmds/statsd/src/metrics/ValueMetricProducer.cpp2
-rw-r--r--cmds/statsd/src/metrics/duration_helper/MaxDurationTracker.cpp2
-rw-r--r--cmds/statsd/src/metrics/duration_helper/OringDurationTracker.cpp2
-rw-r--r--cmds/statsd/tests/ConfigManager_test.cpp8
-rw-r--r--cmds/statsd/tools/loadtest/src/com/android/statsd/loadtest/LoadtestActivity.java5
12 files changed, 15 insertions, 22 deletions
diff --git a/cmds/statsd/src/Log.h b/cmds/statsd/src/Log.h
index 785270973fd0..87f4cbaf02f6 100644
--- a/cmds/statsd/src/Log.h
+++ b/cmds/statsd/src/Log.h
@@ -26,5 +26,8 @@
#include <log/log.h>
+// Use the local value to turn on/off debug logs instead of using log.tag. properties.
+// The advantage is that in production compiler can remove the logging code if the local
+// DEBUG/VERBOSE is false.
#define VLOG(...) \
if (DEBUG) ALOGD(__VA_ARGS__);
diff --git a/cmds/statsd/src/condition/CombinationConditionTracker.cpp b/cmds/statsd/src/condition/CombinationConditionTracker.cpp
index 02aca1aa58a2..bb4b817a820d 100644
--- a/cmds/statsd/src/condition/CombinationConditionTracker.cpp
+++ b/cmds/statsd/src/condition/CombinationConditionTracker.cpp
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-#define DEBUG true // STOPSHIP if true
+#define DEBUG false // STOPSHIP if true
#include "Log.h"
#include "CombinationConditionTracker.h"
diff --git a/cmds/statsd/src/config/ConfigManager.cpp b/cmds/statsd/src/config/ConfigManager.cpp
index a28da5dc433f..a6d271952199 100644
--- a/cmds/statsd/src/config/ConfigManager.cpp
+++ b/cmds/statsd/src/config/ConfigManager.cpp
@@ -55,8 +55,9 @@ void ConfigManager::Startup() {
// for (const auto& pair : configsFromDisk) {
// UpdateConfig(pair.first, pair.second);
//}
- // this should be called from StatsService when it receives a statsd_config
- UpdateConfig(ConfigKey(1000, "fake"), build_fake_config());
+
+ // Uncomment the following line and use the hard coded config for development.
+ // UpdateConfig(ConfigKey(1000, "fake"), build_fake_config());
}
void ConfigManager::AddListener(const sp<ConfigListener>& listener) {
diff --git a/cmds/statsd/src/metrics/CountMetricProducer.cpp b/cmds/statsd/src/metrics/CountMetricProducer.cpp
index 7b865c2752d5..bc12a788a2b6 100644
--- a/cmds/statsd/src/metrics/CountMetricProducer.cpp
+++ b/cmds/statsd/src/metrics/CountMetricProducer.cpp
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-#define DEBUG true // STOPSHIP if true
+#define DEBUG false // STOPSHIP if true
#include "Log.h"
#include "CountMetricProducer.h"
diff --git a/cmds/statsd/src/metrics/DurationMetricProducer.cpp b/cmds/statsd/src/metrics/DurationMetricProducer.cpp
index 6afbe458305c..220861d6f979 100644
--- a/cmds/statsd/src/metrics/DurationMetricProducer.cpp
+++ b/cmds/statsd/src/metrics/DurationMetricProducer.cpp
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-#define DEBUG true
+#define DEBUG false
#include "Log.h"
#include "DurationMetricProducer.h"
diff --git a/cmds/statsd/src/metrics/EventMetricProducer.cpp b/cmds/statsd/src/metrics/EventMetricProducer.cpp
index 4752997d6d15..6a072b076bef 100644
--- a/cmds/statsd/src/metrics/EventMetricProducer.cpp
+++ b/cmds/statsd/src/metrics/EventMetricProducer.cpp
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-#define DEBUG true // STOPSHIP if true
+#define DEBUG false // STOPSHIP if true
#include "Log.h"
#include "EventMetricProducer.h"
diff --git a/cmds/statsd/src/metrics/GaugeMetricProducer.cpp b/cmds/statsd/src/metrics/GaugeMetricProducer.cpp
index 7ec57dcaee88..640263300f77 100644
--- a/cmds/statsd/src/metrics/GaugeMetricProducer.cpp
+++ b/cmds/statsd/src/metrics/GaugeMetricProducer.cpp
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-#define DEBUG true // STOPSHIP if true
+#define DEBUG false // STOPSHIP if true
#include "Log.h"
#include "GaugeMetricProducer.h"
diff --git a/cmds/statsd/src/metrics/ValueMetricProducer.cpp b/cmds/statsd/src/metrics/ValueMetricProducer.cpp
index 1eabf11526df..7efa6cd179e6 100644
--- a/cmds/statsd/src/metrics/ValueMetricProducer.cpp
+++ b/cmds/statsd/src/metrics/ValueMetricProducer.cpp
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-#define DEBUG true // STOPSHIP if true
+#define DEBUG false // STOPSHIP if true
#include "Log.h"
#include "ValueMetricProducer.h"
diff --git a/cmds/statsd/src/metrics/duration_helper/MaxDurationTracker.cpp b/cmds/statsd/src/metrics/duration_helper/MaxDurationTracker.cpp
index 08c91351c49e..95c8a59bf8c5 100644
--- a/cmds/statsd/src/metrics/duration_helper/MaxDurationTracker.cpp
+++ b/cmds/statsd/src/metrics/duration_helper/MaxDurationTracker.cpp
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-#define DEBUG true
+#define DEBUG false
#include "Log.h"
#include "MaxDurationTracker.h"
diff --git a/cmds/statsd/src/metrics/duration_helper/OringDurationTracker.cpp b/cmds/statsd/src/metrics/duration_helper/OringDurationTracker.cpp
index 8122744b32b5..36e25edfccd2 100644
--- a/cmds/statsd/src/metrics/duration_helper/OringDurationTracker.cpp
+++ b/cmds/statsd/src/metrics/duration_helper/OringDurationTracker.cpp
@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-#define DEBUG true
+#define DEBUG false
#include "Log.h"
#include "OringDurationTracker.h"
#include "guardrail/StatsdStats.h"
diff --git a/cmds/statsd/tests/ConfigManager_test.cpp b/cmds/statsd/tests/ConfigManager_test.cpp
index 8c47b6b46ec9..b1924eabbf08 100644
--- a/cmds/statsd/tests/ConfigManager_test.cpp
+++ b/cmds/statsd/tests/ConfigManager_test.cpp
@@ -88,12 +88,6 @@ TEST(ConfigManagerTest, TestAddUpdateRemove) {
{
InSequence s;
- // The built-in fake one.
- // TODO: Remove this when we get rid of the fake one, and make this
- // test loading one from disk somewhere.
- EXPECT_CALL(*(listener.get()),
- OnConfigUpdated(ConfigKeyEq(1000, "fake"), StatsdConfigEq("CONFIG_12345")))
- .RetiresOnSaturation();
manager->Startup();
// Add another one
@@ -147,7 +141,7 @@ TEST(ConfigManagerTest, TestRemoveUid) {
StatsdConfig config;
- EXPECT_CALL(*(listener.get()), OnConfigUpdated(_, _)).Times(6);
+ EXPECT_CALL(*(listener.get()), OnConfigUpdated(_, _)).Times(5);
EXPECT_CALL(*(listener.get()), OnConfigRemoved(ConfigKeyEq(2, "xxx")));
EXPECT_CALL(*(listener.get()), OnConfigRemoved(ConfigKeyEq(2, "yyy")));
EXPECT_CALL(*(listener.get()), OnConfigRemoved(ConfigKeyEq(2, "zzz")));
diff --git a/cmds/statsd/tools/loadtest/src/com/android/statsd/loadtest/LoadtestActivity.java b/cmds/statsd/tools/loadtest/src/com/android/statsd/loadtest/LoadtestActivity.java
index a72f72e60faf..0a30ff8cf311 100644
--- a/cmds/statsd/tools/loadtest/src/com/android/statsd/loadtest/LoadtestActivity.java
+++ b/cmds/statsd/tools/loadtest/src/com/android/statsd/loadtest/LoadtestActivity.java
@@ -419,11 +419,6 @@ public class LoadtestActivity extends Activity {
private void clearConfigs() {
// TODO: Clear all configs instead of specific ones.
if (mStatsManager != null) {
- if (!mStatsManager.removeConfiguration("fake")) {
- Log.d(TAG, "Removed \"fake\" statsd configs.");
- } else {
- Log.d(TAG, "Failed to remove \"fake\" config. Loadtest results cannot be trusted.");
- }
if (mStarted) {
if (!mStatsManager.removeConfiguration(ConfigFactory.CONFIG_NAME)) {
Log.d(TAG, "Removed loadtest statsd configs.");