Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(241)

Unified Diff: delta_diff_generator.cc

Issue 3707006: AU: Include the manifest size in the delta payload usage report. (Closed) Base URL: ssh://git@gitrw.chromium.org:9222/update_engine.git
Patch Set: address comments Created 10 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: delta_diff_generator.cc
diff --git a/delta_diff_generator.cc b/delta_diff_generator.cc
index 4b3ad958c66277e1033d748eecac88873ba7ffe0..c330f6cdaabbe74b9dcff8459cee34edd7f827d9 100644
--- a/delta_diff_generator.cc
+++ b/delta_diff_generator.cc
@@ -464,7 +464,8 @@ static const char* kInstallOperationTypes[] = {
};
void ReportPayloadUsage(const Graph& graph,
- const DeltaArchiveManifest& manifest) {
+ const DeltaArchiveManifest& manifest,
+ const int64_t manifest_metadata_size) {
vector<DeltaObject> objects;
off_t total_size = 0;
@@ -490,6 +491,11 @@ void ReportPayloadUsage(const Graph& graph,
total_size += op.data_length();
}
+ objects.push_back(DeltaObject("<manifest-metadata>",
+ -1,
+ manifest_metadata_size));
+ total_size += manifest_metadata_size;
+
std::sort(objects.begin(), objects.end());
static const char kFormatString[] = "%6.2f%% %10llu %-10s %s\n";
@@ -499,7 +505,7 @@ void ReportPayloadUsage(const Graph& graph,
fprintf(stderr, kFormatString,
object.size * 100.0 / total_size,
object.size,
- kInstallOperationTypes[object.type],
+ object.type >= 0 ? kInstallOperationTypes[object.type] : "-",
object.name.c_str());
}
fprintf(stderr, kFormatString, 100.0, total_size, "", "<total>");
@@ -1482,7 +1488,9 @@ bool DeltaDiffGenerator::GenerateDeltaUpdateFile(
static_cast<ssize_t>(signature_blob.size()));
}
- ReportPayloadUsage(graph, manifest);
+ int64_t manifest_metadata_size =
+ strlen(kDeltaMagic) + 2 * sizeof(uint64_t) + serialized_manifest.size();
+ ReportPayloadUsage(graph, manifest, manifest_metadata_size);
LOG(INFO) << "All done. Successfully created delta file.";
return true;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698