Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
F
Front-End
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
abdullh.alsoleman
Front-End
Commits
20e83e3e
Commit
20e83e3e
authored
Apr 11, 2017
by
Devon Carew
Committed by
GitHub
Apr 11, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
change the reload success message to include both the elapsed time and the library count (#9328)
parent
89a7fdfc
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
27 additions
and
14 deletions
+27
-14
logger.dart
packages/flutter_tools/lib/src/base/logger.dart
+3
-6
utils.dart
packages/flutter_tools/lib/src/base/utils.dart
+12
-1
run_hot.dart
packages/flutter_tools/lib/src/run_hot.dart
+12
-7
No files found.
packages/flutter_tools/lib/src/base/logger.dart
View file @
20e83e3e
...
...
@@ -5,11 +5,11 @@
import
'dart:async'
;
import
'dart:convert'
show
ASCII
,
LineSplitter
;
import
'package:intl/intl.dart'
;
import
'package:meta/meta.dart'
;
import
'io.dart'
;
import
'platform.dart'
;
import
'utils.dart'
;
final
AnsiTerminal
terminal
=
new
AnsiTerminal
();
...
...
@@ -320,8 +320,6 @@ class _AnsiStatus extends Status {
}
static
final
List
<
String
>
_progress
=
<
String
>[
'-'
,
r'\'
,
'|'
,
r'/'
,
'-'
,
r'\'
,
'|'
,
'/'
];
static
final
NumberFormat
secondsFormat
=
new
NumberFormat
(
'0.0'
);
static
final
NumberFormat
millisecondsFormat
=
new
NumberFormat
.
decimalPattern
();
final
String
message
;
final
bool
expectSlowOperation
;
...
...
@@ -345,10 +343,9 @@ class _AnsiStatus extends Status {
live
=
false
;
if
(
expectSlowOperation
)
{
final
double
seconds
=
stopwatch
.
elapsedMilliseconds
/
Duration
.
MILLISECONDS_PER_SECOND
;
print
(
'
\
b
\
b
\
b
\
b
\
b
${secondsFormat.format(seconds).padLeft(4)}
s'
);
print
(
'
\
b
\
b
\
b
\
b
\
b
${getElapsedAsSeconds(stopwatch.elapsed).padLeft(5)}
'
);
}
else
{
print
(
'
\
b
\
b
\
b
\
b
\
b
${
millisecondsFormat.format(stopwatch.elapsedMilliseconds).padLeft(3)}
ms
'
);
print
(
'
\
b
\
b
\
b
\
b
\
b
${
getElapsedAsMilliseconds(stopwatch.elapsed).padLeft(5)}
'
);
}
timer
.
cancel
();
...
...
packages/flutter_tools/lib/src/base/utils.dart
View file @
20e83e3e
...
...
@@ -7,6 +7,7 @@ import 'dart:convert';
import
'dart:math'
show
Random
;
import
'package:crypto/crypto.dart'
;
import
'package:intl/intl.dart'
;
import
'file_system.dart'
;
import
'platform.dart'
;
...
...
@@ -82,7 +83,17 @@ String getSizeAsMB(int bytesLength) {
return
'
${(bytesLength / (1024 * 1024)).toStringAsFixed(1)}
MB'
;
}
String
getElapsedAsMilliseconds
(
Duration
duration
)
=>
'
${duration.inMilliseconds}
ms'
;
final
NumberFormat
kSecondsFormat
=
new
NumberFormat
(
'0.0'
);
final
NumberFormat
kMillisecondsFormat
=
new
NumberFormat
.
decimalPattern
();
String
getElapsedAsSeconds
(
Duration
duration
)
{
final
double
seconds
=
duration
.
inMilliseconds
/
Duration
.
MILLISECONDS_PER_SECOND
;
return
'
${kSecondsFormat.format(seconds)}
s'
;
}
String
getElapsedAsMilliseconds
(
Duration
duration
)
{
return
'
${kMillisecondsFormat.format(duration.inMilliseconds)}
ms'
;
}
/// Return a relative path if [fullPath] is contained by the cwd, else return an
/// absolute path.
...
...
packages/flutter_tools/lib/src/run_hot.dart
View file @
20e83e3e
...
...
@@ -361,24 +361,28 @@ class HotRunner extends ResidentRunner {
if
(
fullRestart
)
{
final
Status
status
=
logger
.
startProgress
(
'Performing full restart...'
,
progressId:
'hot.restart'
);
try
{
final
Stopwatch
timer
=
new
Stopwatch
()..
start
();
await
_restartFromSources
();
status
.
stop
();
printStatus
(
'Restart complete.'
);
timer
.
stop
();
status
.
cancel
();
printStatus
(
'Restarted app in
${getElapsedAsSeconds(timer.elapsed)}
.'
);
return
OperationResult
.
ok
;
}
catch
(
error
)
{
status
.
stop
();
status
.
cancel
();
rethrow
;
}
}
else
{
final
Status
status
=
logger
.
startProgress
(
'Performing hot reload...'
,
progressId:
'hot.reload'
);
try
{
final
Stopwatch
timer
=
new
Stopwatch
()..
start
();
final
OperationResult
result
=
await
_reloadSources
(
pause:
pauseAfterRestart
);
status
.
stop
();
timer
.
stop
();
status
.
cancel
();
if
(
result
.
isOk
)
printStatus
(
"
${result.message
}
."
);
printStatus
(
"
Reloaded
${result.message}
in
${getElapsedAsMilliseconds(timer.elapsed)
}
."
);
return
result
;
}
catch
(
error
)
{
status
.
stop
();
status
.
cancel
();
rethrow
;
}
}
...
...
@@ -434,7 +438,8 @@ class HotRunner extends ResidentRunner {
flutterUsage
.
sendEvent
(
'hot'
,
'reload'
);
final
int
loadedLibraryCount
=
reloadReport
[
'details'
][
'loadedLibraryCount'
];
final
int
finalLibraryCount
=
reloadReport
[
'details'
][
'finalLibraryCount'
];
reloadMessage
=
'Reload done:
$loadedLibraryCount
of
$finalLibraryCount
libraries needed reloading'
;
printTrace
(
'reloaded
$loadedLibraryCount
of
$finalLibraryCount
libraries'
);
reloadMessage
=
'
$loadedLibraryCount
of
$finalLibraryCount
libraries'
;
}
}
catch
(
error
,
st
)
{
final
int
errorCode
=
error
[
'code'
];
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment