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
cf2b2078
Commit
cf2b2078
authored
Aug 11, 2016
by
John McCutchan
Committed by
GitHub
Aug 11, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Send reload / restart time to frame to analytics (#5335)
parent
6b1597dc
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
0 deletions
+9
-0
hot.dart
packages/flutter_tools/lib/src/hot.dart
+2
-0
usage.dart
packages/flutter_tools/lib/src/usage.dart
+4
-0
context.dart
packages/flutter_tools/test/src/context.dart
+3
-0
No files found.
packages/flutter_tools/lib/src/hot.dart
View file @
cf2b2078
...
@@ -473,6 +473,7 @@ class HotRunner extends ResidentRunner {
...
@@ -473,6 +473,7 @@ class HotRunner extends ResidentRunner {
printStatus
(
'Restart time: '
printStatus
(
'Restart time: '
'
${getElapsedAsMilliseconds(firstFrameTimer.elapsed)}
'
);
'
${getElapsedAsMilliseconds(firstFrameTimer.elapsed)}
'
);
flutterUsage
.
sendEvent
(
'hot'
,
'restart'
);
flutterUsage
.
sendEvent
(
'hot'
,
'restart'
);
flutterUsage
.
sendTiming
(
'hot'
,
'restart'
,
firstFrameTimer
.
elapsed
);
}
}
/// Returns [true] if the reload was successful.
/// Returns [true] if the reload was successful.
...
@@ -537,6 +538,7 @@ class HotRunner extends ResidentRunner {
...
@@ -537,6 +538,7 @@ class HotRunner extends ResidentRunner {
await
firstFrameTimer
.
firstFrame
();
await
firstFrameTimer
.
firstFrame
();
printStatus
(
'Hot reload time: '
printStatus
(
'Hot reload time: '
'
${getElapsedAsMilliseconds(firstFrameTimer.elapsed)}
'
);
'
${getElapsedAsMilliseconds(firstFrameTimer.elapsed)}
'
);
flutterUsage
.
sendTiming
(
'hot'
,
'reload'
,
firstFrameTimer
.
elapsed
);
return
true
;
return
true
;
}
}
...
...
packages/flutter_tools/lib/src/usage.dart
View file @
cf2b2078
...
@@ -70,6 +70,10 @@ class Usage {
...
@@ -70,6 +70,10 @@ class Usage {
_analytics
.
sendEvent
(
category
,
parameter
);
_analytics
.
sendEvent
(
category
,
parameter
);
}
}
void
sendTiming
(
String
category
,
String
variableName
,
Duration
duration
)
{
_analytics
.
sendTiming
(
variableName
,
duration
.
inMilliseconds
,
category:
category
);
}
UsageTimer
startTimer
(
String
event
)
{
UsageTimer
startTimer
(
String
event
)
{
if
(
suppressAnalytics
)
if
(
suppressAnalytics
)
return
new
_MockUsageTimer
();
return
new
_MockUsageTimer
();
...
...
packages/flutter_tools/test/src/context.dart
View file @
cf2b2078
...
@@ -138,6 +138,9 @@ class MockUsage implements Usage {
...
@@ -138,6 +138,9 @@ class MockUsage implements Usage {
@override
@override
void
sendEvent
(
String
category
,
String
parameter
)
{
}
void
sendEvent
(
String
category
,
String
parameter
)
{
}
@override
void
sendTiming
(
String
category
,
String
variableName
,
Duration
duration
)
{
}
@override
@override
UsageTimer
startTimer
(
String
event
)
=>
new
_MockUsageTimer
(
event
);
UsageTimer
startTimer
(
String
event
)
=>
new
_MockUsageTimer
(
event
);
...
...
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