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

Issue 4704002: AU: Reduce full payload generation log output. (Closed)

Created:
10 years, 1 month ago by petkov
Modified:
9 years, 7 months ago
Reviewers:
adlr
CC:
chromium-os-reviews_chromium.org, petkov, adlr
Visibility:
Public.

Description

AU: Reduce full payload generation log output. Now that generation is much faster, we can certainly reduce the logging. BUG=8747 TEST=unit tests, generated a full payload Change-Id: I8eb0a9801986d21206bbce29a8228c7d3ebe654d Committed: http://chrome-svn/viewvc/chromeos?view=rev&revision=3375ff5

Patch Set 1 #

Patch Set 2 : remove some whitespace #

Unified diffs Side-by-side diffs Delta from patch set Stats (+10 lines, -7 lines) Patch
M full_update_generator.cc View 1 2 chunks +10 lines, -7 lines 0 comments Download

Messages

Total messages: 2 (0 generated)
petkov
10 years, 1 month ago (2010-11-09 00:09:33 UTC) #1
adlr
10 years, 1 month ago (2010-11-09 00:17:41 UTC) #2
LGTM

On Mon, Nov 8, 2010 at 4:09 PM, <petkov@chromium.org> wrote:

> Reviewers: adlr,
>
> Description:
> AU: Reduce full payload generation log output.
>
> Now that generation is much faster, we can certainly reduce the logging.
>
> BUG=8747
> TEST=unit tests, generated a full payload
>
> Change-Id: I8eb0a9801986d21206bbce29a8228c7d3ebe654d
>
> Please review this at http://codereview.chromium.org/4704002/show
>
> SVN Base: ssh://git@gitrw.chromium.org:9222/update_engine.git@master
>
> Affected files:
>  M full_update_generator.cc
>
>
> Index: full_update_generator.cc
> diff --git a/full_update_generator.cc b/full_update_generator.cc
> index
>
0140107f8818faa1e22e35c78080ddebb1ee137b..e255acb181f620d574a39e615108708be4272ba4
> 100644
> --- a/full_update_generator.cc
> +++ b/full_update_generator.cc
> @@ -140,6 +140,8 @@ bool FullUpdateGenerator::Run(
>
>     deque<shared_ptr<ChunkProcessor> > threads;
>
> +    int last_progress_update = INT_MIN;
> +
>     off_t bytes_left = part_sizes[partition], counter = 0, offset = 0;
>     while (bytes_left > 0 || !threads.empty()) {
>       // Check and start new chunk processors if possible.
> @@ -184,10 +186,15 @@ bool FullUpdateGenerator::Run(
>       dst_extent->set_start_block(processor->offset() / block_size);
>       dst_extent->set_num_blocks(chunk_size / block_size);
>
> -      LOG(INFO)
> -          << StringPrintf("%.1f",
> -                          processor->offset() * 100.0 /
> part_sizes[partition])
> -          << "% complete (output size: " << *data_file_size << ")";
> +      int progress = static_cast<int>(
> +          (processor->offset() + processor->buffer_in().size()) * 100.0 /
> +          part_sizes[partition]);
> +      if (last_progress_update < progress &&
> +          (last_progress_update + 10 <= progress || progress == 100)) {
> +        LOG(INFO) << progress << "% complete (output size: "
> +                  << *data_file_size << ")";
> +        last_progress_update = progress;
> +      }
>     }
>   }
>
>
>
>

Powered by Google App Engine
This is Rietveld 408576698