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

Commit 3f9278b7 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Use ProtoOutputStream's bytesWritten to properly estimate the size of...

Merge "Use ProtoOutputStream's bytesWritten to properly estimate the size of EventMetricsData on memory"
parents f16340fc 75f0a4d3
Loading
Loading
Loading
Loading
+1 −6
Original line number Diff line number Diff line
@@ -96,7 +96,6 @@ std::unique_ptr<std::vector<uint8_t>> EventMetricProducer::onDumpReport() {
    std::unique_ptr<std::vector<uint8_t>> buffer = serializeProto();

    startNewProtoOutputStream(endTime);
    mByteSize = 0;

    return buffer;
}
@@ -121,14 +120,10 @@ void EventMetricProducer::onMatchedLogEventInternal(
    event.ToProto(*mProto);
    mProto->end(eventToken);
    mProto->end(wrapperToken);

    // TODO: Increment mByteSize with a real value. Until this feature is working, we assume 50
    // bytes.
    mByteSize += 50;
}

size_t EventMetricProducer::byteSize() {
    return mByteSize;
    return mProto->bytesWritten();
}

}  // namespace statsd
+0 −2
Original line number Diff line number Diff line
@@ -65,8 +65,6 @@ protected:

private:
    const EventMetric mMetric;

    size_t mByteSize;
};

}  // namespace statsd