Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
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
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
60ded1d5
Commit
60ded1d5
authored
Feb 12, 2019
by
Kenichi Omichi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix golint failures of test/e2e/framework/timer
parent
ee734d05
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
4 deletions
+5
-4
.golint_failures
hack/.golint_failures
+0
-1
timer.go
test/e2e/framework/timer/timer.go
+5
-3
No files found.
hack/.golint_failures
View file @
60ded1d5
...
...
@@ -689,7 +689,6 @@ test/e2e/framework/providers/aws
test/e2e/framework/providers/azure
test/e2e/framework/providers/gce
test/e2e/framework/providers/kubemark
test/e2e/framework/timer
test/e2e/instrumentation
test/e2e/instrumentation/logging
test/e2e/instrumentation/monitoring
...
...
test/e2e/framework/timer/timer.go
View file @
60ded1d5
...
...
@@ -29,7 +29,7 @@ import (
var
now
=
time
.
Now
//
R
epresents a phase of a test. Phases can overlap.
//
Phase r
epresents a phase of a test. Phases can overlap.
type
Phase
struct
{
sequenceNumber
int
name
string
...
...
@@ -63,9 +63,8 @@ func (phase *Phase) duration() time.Duration {
func
(
phase
*
Phase
)
humanReadable
()
string
{
if
phase
.
ended
()
{
return
fmt
.
Sprintf
(
"Phase %s: %v
\n
"
,
phase
.
label
(),
phase
.
duration
())
}
else
{
return
fmt
.
Sprintf
(
"Phase %s: %v so far
\n
"
,
phase
.
label
(),
phase
.
duration
())
}
return
fmt
.
Sprintf
(
"Phase %s: %v so far
\n
"
,
phase
.
label
(),
phase
.
duration
())
}
// A TestPhaseTimer groups phases and provides a way to export their measurements as JSON or human-readable text.
...
...
@@ -93,10 +92,12 @@ func (timer *TestPhaseTimer) StartPhase(sequenceNumber int, phaseName string) *P
return
newPhase
}
// SummaryKind returns the summary of test summary.
func
(
timer
*
TestPhaseTimer
)
SummaryKind
()
string
{
return
"TestPhaseTimer"
}
// PrintHumanReadable returns durations of all phases.
func
(
timer
*
TestPhaseTimer
)
PrintHumanReadable
()
string
{
buf
:=
bytes
.
Buffer
{}
timer
.
lock
.
Lock
()
...
...
@@ -107,6 +108,7 @@ func (timer *TestPhaseTimer) PrintHumanReadable() string {
return
buf
.
String
()
}
// PrintJSON returns durations of all phases with JSON format.
func
(
timer
*
TestPhaseTimer
)
PrintJSON
()
string
{
data
:=
perftype
.
PerfData
{
Version
:
"v1"
,
...
...
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