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

Side by Side Diff: dm/DMReporter.cpp

Issue 185233004: DM: tweak output. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: ws Created 6 years, 9 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 unified diff | Download patch
« no previous file with comments | « dm/DMReporter.h ('k') | dm/DMTask.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #include "DMReporter.h" 1 #include "DMReporter.h"
2 2
3 #include "SkCommandLineFlags.h" 3 #include "SkCommandLineFlags.h"
4 #include "OverwriteLine.h" 4 #include "OverwriteLine.h"
5 5
6 DEFINE_bool2(quiet, q, false, "If true, don't print status updates."); 6 DEFINE_bool2(quiet, q, false, "If true, don't print status updates.");
7 DEFINE_bool2(verbose, v, false, "If true, print status updates one-per-line."); 7 DEFINE_bool2(verbose, v, false, "If true, print status updates one-per-line.");
8 8
9 namespace DM { 9 namespace DM {
10 10
11 void Reporter::finish(SkString name) { 11 void Reporter::finish(SkString name, SkMSec timeMs) {
12 sk_atomic_inc(&fFinished); 12 sk_atomic_inc(&fFinished);
13 13
14 if (FLAGS_quiet) { 14 if (FLAGS_quiet) {
15 return; 15 return;
16 } 16 }
17 17
18 SkString status; 18 SkString status;
19 status.printf("%s%d tasks left", 19 status.printf("%s%d tasks left",
20 FLAGS_verbose ? "\n" : kSkOverwriteLine, 20 FLAGS_verbose ? "\n" : kSkOverwriteLine,
21 this->started() - this->finished()); 21 this->started() - this->finished());
22 const int failed = this->failed(); 22 const int failed = this->failed();
23 if (failed > 0) { 23 if (failed > 0) {
24 status.appendf(", %d failed", failed); 24 status.appendf(", %d failed", failed);
25 } 25 }
26 status.appendf("\t[%s done]", name.c_str()); 26 if (FLAGS_verbose) {
27 status.appendf("\t%5dms %s", timeMs, name.c_str());
28 }
27 SkDebugf("%s", status.c_str()); 29 SkDebugf("%s", status.c_str());
28 } 30 }
29 31
30 int32_t Reporter::failed() const { 32 int32_t Reporter::failed() const {
31 SkAutoMutexAcquire reader(&fMutex); 33 SkAutoMutexAcquire reader(&fMutex);
32 return fFailures.count(); 34 return fFailures.count();
33 } 35 }
34 36
35 void Reporter::fail(SkString msg) { 37 void Reporter::fail(SkString msg) {
36 SkAutoMutexAcquire writer(&fMutex); 38 SkAutoMutexAcquire writer(&fMutex);
37 fFailures.push_back(msg); 39 fFailures.push_back(msg);
38 } 40 }
39 41
40 void Reporter::getFailures(SkTArray<SkString>* failures) const { 42 void Reporter::getFailures(SkTArray<SkString>* failures) const {
41 SkAutoMutexAcquire reader(&fMutex); 43 SkAutoMutexAcquire reader(&fMutex);
42 *failures = fFailures; 44 *failures = fFailures;
43 } 45 }
44 46
45 } // namespace DM 47 } // namespace DM
OLDNEW
« no previous file with comments | « dm/DMReporter.h ('k') | dm/DMTask.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698