Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 906a35c8 authored by Bookatz's avatar Bookatz
Browse files

Statsd namespace is defined and used

Statsd code now lives in android::os::statsd namespace. Existing files
are largely modified to follow this convention.

Exception: parse_util, since it seems a bit different.

Test: code compiles and existing statsd_tests still pass
Change-Id: Idf92a071b9ed172d01eb3087a4fa3609d67a038c
parent e63e6fc6
Loading
Loading
Loading
Loading
+8 −2
Original line number Diff line number Diff line
@@ -17,11 +17,13 @@
#define LOG_TAG "AnomalyMonitor"
#define DEBUG true

#include <AnomalyMonitor.h>
#include "AnomalyMonitor.h"

#include <cutils/log.h>

using namespace android::os::statsd;
namespace android {
namespace os {
namespace statsd {

AnomalyMonitor::AnomalyMonitor(uint32_t minDiffToUpdateRegisteredAlarmTimeSec)
        : mRegisteredAlarmTimeSec(0),
@@ -100,3 +102,7 @@ void AnomalyMonitor::updateRegisteredAlarmTime_l(uint32_t timestampSec) {
int64_t AnomalyMonitor::secToMs(uint32_t timeSec) {
    return ((int64_t) timeSec) * 1000;
}

} // namespace statsd
} // namespace os
} // namespace android
+2 −1
Original line number Diff line number Diff line
@@ -25,7 +25,8 @@
#include <vector>

using namespace android;
using namespace android::os;

using android::os::IStatsCompanionService;

namespace android {
namespace os {
+8 −1
Original line number Diff line number Diff line
@@ -23,11 +23,14 @@ using android::sp;
using android::String16;
using android::binder::Status;
using android::base::unique_fd;
using android::os::statsd::EventMetricData;
using android::os::DropBoxManager;
using android::ZipUtils;
using std::vector;

namespace android {
namespace os {
namespace statsd {

status_t DropboxReader::readStatsLogs(FILE* out, const string& tag, long msec) {
    sp<DropBoxManager> dropbox = new DropBoxManager();
    StatsLogReport logReport;
@@ -117,3 +120,7 @@ void DropboxReader::printLog(FILE* out, const StatsLogReport& logReport) {
    }
    fprintf(out, "\n");
}

} // namespace statsd
} // namespace os
} // namespace android
+8 −1
Original line number Diff line number Diff line
@@ -23,10 +23,13 @@
#include <stdio.h>

using android::base::unique_fd;
using android::os::statsd::StatsLogReport;
using android::status_t;
using std::string;

namespace android {
namespace os {
namespace statsd {

class DropboxReader {
public:
    // msec is the start timestamp.
@@ -42,4 +45,8 @@ private:
    };
};

} // namespace statsd
} // namespace os
} // namespace android

#endif //DROPBOX_READER_H
+9 −1
Original line number Diff line number Diff line
@@ -18,12 +18,16 @@

#include "DropboxWriter.h"

using android::os::DropBoxManager;
using android::binder::Status;
using android::os::DropBoxManager;
using android::sp;
using android::String16;
using std::vector;

namespace android {
namespace os {
namespace statsd {

DropboxWriter::DropboxWriter(const string& tag)
    : mTag(tag), mLogReport(), mBufferSize(0) {
}
@@ -57,3 +61,7 @@ void DropboxWriter::flush() {
    mLogReport.Clear();
    mBufferSize = 0;
}

} // namespace statsd
} // namespace os
} // namespace android
Loading