Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
Snowflake
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
shelikhoo
Snowflake
Commits
908cf3fc
Commit
908cf3fc
authored
5 years ago
by
Cecylia Bocovich
Browse files
Options
Downloads
Patches
Plain Diff
Updated tests to check new stats
Updated the tests to pass with our new snowflake-ips-total stat
parent
8f2dc356
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
broker/snowflake-broker_test.go
+7
-7
7 additions, 7 deletions
broker/snowflake-broker_test.go
with
7 additions
and
7 deletions
broker/snowflake-broker_test.go
+
7
−
7
View file @
908cf3fc
...
...
@@ -419,7 +419,7 @@ func TestMetrics(t *testing.T) {
<-
done
ctx
.
metrics
.
printMetrics
()
So
(
buf
.
String
(),
ShouldResemble
,
"snowflake-stats-end "
+
time
.
Now
()
.
UTC
()
.
Format
(
"2006-01-02 15:04:05"
)
+
" (86400 s)
\n
snowflake-ips CA=1
\n
snowflake-idle-count 8
\n
client-denied-count 0
\n
client-snowflake-match-count 0
\n
"
)
So
(
buf
.
String
(),
ShouldResemble
,
"snowflake-stats-end "
+
time
.
Now
()
.
UTC
()
.
Format
(
"2006-01-02 15:04:05"
)
+
" (86400 s)
\n
snowflake-ips CA=
1
\n
snowflake-ips-total
1
\n
snowflake-idle-count 8
\n
client-denied-count 0
\n
client-snowflake-match-count 0
\n
"
)
})
//Test addition of client failures
...
...
@@ -432,13 +432,13 @@ func TestMetrics(t *testing.T) {
clientOffers
(
ctx
,
w
,
r
)
ctx
.
metrics
.
printMetrics
()
So
(
buf
.
String
(),
ShouldResemble
,
"snowflake-stats-end "
+
time
.
Now
()
.
UTC
()
.
Format
(
"2006-01-02 15:04:05"
)
+
" (86400 s)
\n
snowflake-ips
\n
snowflake-idle-count 0
\n
client-denied-count 8
\n
client-snowflake-match-count 0
\n
"
)
So
(
buf
.
String
(),
ShouldResemble
,
"snowflake-stats-end "
+
time
.
Now
()
.
UTC
()
.
Format
(
"2006-01-02 15:04:05"
)
+
" (86400 s)
\n
snowflake-ips
\n
snowflake-ips-total 0
\n
snowflake-idle-count 0
\n
client-denied-count 8
\n
client-snowflake-match-count 0
\n
"
)
// Test reset
buf
.
Reset
()
ctx
.
metrics
.
zeroMetrics
()
ctx
.
metrics
.
printMetrics
()
So
(
buf
.
String
(),
ShouldResemble
,
"snowflake-stats-end "
+
time
.
Now
()
.
UTC
()
.
Format
(
"2006-01-02 15:04:05"
)
+
" (86400 s)
\n
snowflake-ips
\n
snowflake-idle-count 0
\n
client-denied-count 0
\n
client-snowflake-match-count 0
\n
"
)
So
(
buf
.
String
(),
ShouldResemble
,
"snowflake-stats-end "
+
time
.
Now
()
.
UTC
()
.
Format
(
"2006-01-02 15:04:05"
)
+
" (86400 s)
\n
snowflake-ips
\n
snowflake-ips-total 0
\n
snowflake-idle-count 0
\n
client-denied-count 0
\n
client-snowflake-match-count 0
\n
"
)
})
//Test addition of client matches
Convey
(
"for client-proxy match"
,
func
()
{
...
...
@@ -459,7 +459,7 @@ func TestMetrics(t *testing.T) {
<-
done
ctx
.
metrics
.
printMetrics
()
So
(
buf
.
String
(),
ShouldResemble
,
"snowflake-stats-end "
+
time
.
Now
()
.
UTC
()
.
Format
(
"2006-01-02 15:04:05"
)
+
" (86400 s)
\n
snowflake-ips
\n
snowflake-idle-count 0
\n
client-denied-count 0
\n
client-snowflake-match-count 8
\n
"
)
So
(
buf
.
String
(),
ShouldResemble
,
"snowflake-stats-end "
+
time
.
Now
()
.
UTC
()
.
Format
(
"2006-01-02 15:04:05"
)
+
" (86400 s)
\n
snowflake-ips
\n
snowflake-ips-total 0
\n
snowflake-idle-count 0
\n
client-denied-count 0
\n
client-snowflake-match-count 8
\n
"
)
})
//Test rounding boundary
Convey
(
"binning boundary"
,
func
()
{
...
...
@@ -478,12 +478,12 @@ func TestMetrics(t *testing.T) {
clientOffers
(
ctx
,
w
,
r
)
ctx
.
metrics
.
printMetrics
()
So
(
buf
.
String
(),
ShouldResemble
,
"snowflake-stats-end "
+
time
.
Now
()
.
UTC
()
.
Format
(
"2006-01-02 15:04:05"
)
+
" (86400 s)
\n
snowflake-ips
\n
snowflake-idle-count 0
\n
client-denied-count 8
\n
client-snowflake-match-count 0
\n
"
)
So
(
buf
.
String
(),
ShouldResemble
,
"snowflake-stats-end "
+
time
.
Now
()
.
UTC
()
.
Format
(
"2006-01-02 15:04:05"
)
+
" (86400 s)
\n
snowflake-ips
\n
snowflake-ips-total 0
\n
snowflake-idle-count 0
\n
client-denied-count 8
\n
client-snowflake-match-count 0
\n
"
)
clientOffers
(
ctx
,
w
,
r
)
buf
.
Reset
()
ctx
.
metrics
.
printMetrics
()
So
(
buf
.
String
(),
ShouldResemble
,
"snowflake-stats-end "
+
time
.
Now
()
.
UTC
()
.
Format
(
"2006-01-02 15:04:05"
)
+
" (86400 s)
\n
snowflake-ips
\n
snowflake-idle-count 0
\n
client-denied-count 16
\n
client-snowflake-match-count 0
\n
"
)
So
(
buf
.
String
(),
ShouldResemble
,
"snowflake-stats-end "
+
time
.
Now
()
.
UTC
()
.
Format
(
"2006-01-02 15:04:05"
)
+
" (86400 s)
\n
snowflake-ips
\n
snowflake-ips-total 0
\n
snowflake-idle-count 0
\n
client-denied-count 16
\n
client-snowflake-match-count 0
\n
"
)
})
//Test unique ip
...
...
@@ -515,7 +515,7 @@ func TestMetrics(t *testing.T) {
<-
done
ctx
.
metrics
.
printMetrics
()
So
(
buf
.
String
(),
ShouldResemble
,
"snowflake-stats-end "
+
time
.
Now
()
.
UTC
()
.
Format
(
"2006-01-02 15:04:05"
)
+
" (86400 s)
\n
snowflake-ips CA=1
\n
snowflake-idle-count 8
\n
client-denied-count 0
\n
client-snowflake-match-count 0
\n
"
)
So
(
buf
.
String
(),
ShouldResemble
,
"snowflake-stats-end "
+
time
.
Now
()
.
UTC
()
.
Format
(
"2006-01-02 15:04:05"
)
+
" (86400 s)
\n
snowflake-ips CA=
1
\n
snowflake-ips-total
1
\n
snowflake-idle-count 8
\n
client-denied-count 0
\n
client-snowflake-match-count 0
\n
"
)
})
})
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment