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
a0369806
Commit
a0369806
authored
Apr 15, 2017
by
Zachary Anderson
Committed by
GitHub
Apr 15, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[fuchsia_reload] Give more information in the module list (#9400)
parent
cedc9fb2
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
81 additions
and
5 deletions
+81
-5
fuchsia_reload.dart
packages/flutter_tools/lib/src/commands/fuchsia_reload.dart
+23
-1
vmservice.dart
packages/flutter_tools/lib/src/vmservice.dart
+58
-4
No files found.
packages/flutter_tools/lib/src/commands/fuchsia_reload.dart
View file @
a0369806
...
...
@@ -9,6 +9,7 @@ import '../base/common.dart';
import
'../base/file_system.dart'
;
import
'../base/io.dart'
;
import
'../base/platform.dart'
;
import
'../base/utils.dart'
;
import
'../cache.dart'
;
import
'../device.dart'
;
import
'../flx.dart'
as
flx
;
...
...
@@ -150,9 +151,30 @@ class FuchsiaReloadCommand extends FlutterCommand {
}
Future
<
Null
>
_listViews
(
List
<
int
>
ports
)
async
{
const
String
bold
=
'
\
u001B[0;1m'
;
const
String
reset
=
'
\
u001B[0m'
;
for
(
FlutterView
v
in
await
_getViews
(
ports
))
{
final
Uri
addr
=
v
.
owner
.
vmService
.
httpAddress
;
printStatus
(
'At
$addr
, found view:
${v.uiIsolate.name}
'
);
final
Isolate
i
=
v
.
uiIsolate
;
final
String
name
=
i
.
name
;
final
String
shortName
=
name
.
substring
(
0
,
name
.
indexOf
(
'
\$
'
));
final
String
main
=
'
\
$main
-'
;
final
String
number
=
name
.
substring
(
name
.
indexOf
(
main
)
+
main
.
length
);
final
String
newUsed
=
getSizeAsMB
(
i
.
newSpace
.
used
);
final
String
newCap
=
getSizeAsMB
(
i
.
newSpace
.
capacity
);
final
String
newFreq
=
'
${i.newSpace.avgCollectionTime.inMilliseconds}
ms'
;
final
String
newPer
=
'
${i.newSpace.avgCollectionPeriod.inSeconds}
s'
;
final
String
oldUsed
=
getSizeAsMB
(
i
.
oldSpace
.
used
);
final
String
oldCap
=
getSizeAsMB
(
i
.
oldSpace
.
capacity
);
final
String
oldFreq
=
'
${i.oldSpace.avgCollectionTime.inMilliseconds}
ms'
;
final
String
oldPer
=
'
${i.oldSpace.avgCollectionPeriod.inSeconds}
s'
;
printStatus
(
'
$bold$shortName$reset
\n
'
'
\t
Isolate number:
$number
\n
'
'
\t
Observatory:
$addr
\n
'
'
\t
New gen:
$newUsed
used of
$newCap
, GC:
$newFreq
every
$newPer
\n
'
'
\t
Old gen:
$oldUsed
used of
$oldCap
, GC:
$oldFreq
every
$oldPer
\n
'
);
}
}
...
...
packages/flutter_tools/lib/src/vmservice.dart
View file @
a0369806
...
...
@@ -4,6 +4,7 @@
import
'dart:async'
;
import
'dart:convert'
show
BASE64
;
import
'dart:math'
as
math
;
import
'package:file/file.dart'
;
import
'package:json_rpc_2/error_code.dart'
as
rpc_error_code
;
...
...
@@ -773,6 +774,44 @@ class VM extends ServiceObjectOwner {
}
}
class
HeapSpace
extends
ServiceObject
{
HeapSpace
.
_empty
(
ServiceObjectOwner
owner
)
:
super
.
_empty
(
owner
);
int
_used
=
0
;
int
_capacity
=
0
;
int
_external
=
0
;
int
_collections
=
0
;
double
_totalCollectionTimeInSeconds
=
0.0
;
double
_averageCollectionPeriodInMillis
=
0.0
;
int
get
used
=>
_used
;
int
get
capacity
=>
_capacity
;
int
get
external
=>
_external
;
Duration
get
avgCollectionTime
{
final
double
mcs
=
_totalCollectionTimeInSeconds
*
Duration
.
MICROSECONDS_PER_SECOND
/
math
.
max
(
_collections
,
1
);
return
new
Duration
(
microseconds:
mcs
.
ceil
());
}
Duration
get
avgCollectionPeriod
{
final
double
mcs
=
_averageCollectionPeriodInMillis
*
Duration
.
MICROSECONDS_PER_MILLISECOND
;
return
new
Duration
(
microseconds:
mcs
.
ceil
());
}
@override
void
_update
(
Map
<
String
,
dynamic
>
map
,
bool
mapIsRef
)
{
_used
=
map
[
'used'
];
_capacity
=
map
[
'capacity'
];
_external
=
map
[
'external'
];
_collections
=
map
[
'collections'
];
_totalCollectionTimeInSeconds
=
map
[
'time'
];
_averageCollectionPeriodInMillis
=
map
[
'avgCollectionPeriodMillis'
];
}
}
/// An isolate running inside the VM. Instances of the Isolate class are always
/// canonicalized.
class
Isolate
extends
ServiceObjectOwner
{
...
...
@@ -792,11 +831,16 @@ class Isolate extends ServiceObjectOwner {
final
Map
<
String
,
ServiceObject
>
_cache
=
<
String
,
ServiceObject
>{};
HeapSpace
_newSpace
;
HeapSpace
_oldSpace
;
HeapSpace
get
newSpace
=>
_newSpace
;
HeapSpace
get
oldSpace
=>
_oldSpace
;
@override
ServiceObject
getFromMap
(
Map
<
String
,
dynamic
>
map
)
{
if
(
map
==
null
)
{
if
(
map
==
null
)
return
null
;
}
final
String
mapType
=
_stripRef
(
map
[
'type'
]);
if
(
mapType
==
'Isolate'
)
{
// There are sometimes isolate refs in ServiceEvents.
...
...
@@ -811,9 +855,8 @@ class Isolate extends ServiceObjectOwner {
}
// Build the object from the map directly.
serviceObject
=
new
ServiceObject
.
_fromMap
(
this
,
map
);
if
((
serviceObject
!=
null
)
&&
serviceObject
.
canCache
)
{
if
((
serviceObject
!=
null
)
&&
serviceObject
.
canCache
)
_cache
[
mapId
]
=
serviceObject
;
}
return
serviceObject
;
}
...
...
@@ -844,6 +887,15 @@ class Isolate extends ServiceObjectOwner {
return
getFromMap
(
await
invokeRpcRaw
(
method
,
params:
params
));
}
void
_updateHeaps
(
Map
<
String
,
dynamic
>
map
,
bool
mapIsRef
)
{
if
(
_newSpace
==
null
)
_newSpace
=
new
HeapSpace
.
_empty
(
this
);
_newSpace
.
_update
(
map
[
'new'
],
mapIsRef
);
if
(
_oldSpace
==
null
)
_oldSpace
=
new
HeapSpace
.
_empty
(
this
);
_oldSpace
.
_update
(
map
[
'old'
],
mapIsRef
);
}
@override
void
_update
(
Map
<
String
,
dynamic
>
map
,
bool
mapIsRef
)
{
if
(
mapIsRef
)
...
...
@@ -856,6 +908,8 @@ class Isolate extends ServiceObjectOwner {
_upgradeCollection
(
map
,
this
);
pauseEvent
=
map
[
'pauseEvent'
];
_updateHeaps
(
map
[
'_heaps'
],
mapIsRef
);
}
static
final
int
kIsolateReloadBarred
=
1005
;
...
...
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