Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
Metabase
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
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
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Engineering Digital Service
Metabase
Commits
122e0c6d
Commit
122e0c6d
authored
7 years ago
by
Simon Belak
Browse files
Options
Downloads
Patches
Plain Diff
make linter happy
parent
4a3c08da
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
src/metabase/fingerprinting/fingerprinters.clj
+9
-8
9 additions, 8 deletions
src/metabase/fingerprinting/fingerprinters.clj
with
9 additions
and
8 deletions
src/metabase/fingerprinting/fingerprinters.clj
+
9
−
8
View file @
122e0c6d
...
...
@@ -22,8 +22,8 @@
(
def
^
:private
^
:const
percentiles
(
range
0
1
0.1
))
(
defn
rollup
"
t
ransducer that groups by `groupfn` and reduces each group with `f`.
n
ote the contructor airity of `f` needs to be free of side effects."
"
T
ransducer that groups by `groupfn` and reduces each group with `f`.
N
ote the contructor airity of `f` needs to be free of side effects."
[
f
groupfn
]
(
let
[
init
(
f
)]
(
fn
...
...
@@ -38,14 +38,14 @@
(
assoc!
acc
k
(
f
(
get
acc
k
init
)
x
)))))))
(
defn
safe-divide
"
l
ike `clojure.core//`, but returns nil if denominator is 0."
[
numerator
&
denominators
]
"
L
ike `clojure.core//`, but returns nil if denominator is 0."
[
x
&
denominators
]
(
when
(
or
(
and
(
not-empty
denominators
)
(
not-any?
zero?
denominators
))
(
and
(
not
(
zero?
numerator
))
(
empty?
denominators
)))
(
apply
/
numerator
denominators
)))
(
and
(
not
(
zero?
x
))
(
empty?
denominators
)))
(
apply
/
x
denominators
)))
(
defn
growth
"
r
elative difference between `x1` an `x2`."
"
R
elative difference between `x1` an `x2`."
[
x2
x1
]
(
when
(
every?
some?
[
x2
x1
])
(
safe-divide
(
*
(
if
(
neg?
x1
)
-1
1
)
(
-
x2
x1
))
x1
)))
...
...
@@ -53,7 +53,8 @@
(
def
^
:private
^
:const
^
Double
cardinality-error
0.01
)
(
defn
cardinality
"transducer that sketches cardinality using hyper-loglog."
"Transducer that sketches cardinality using HyperLogLog++.
https://research.google.com/pubs/pub40671.html"
([]
(
HyperLogLogPlus.
14
25
))
([
acc
]
(
.cardinality
acc
))
([
acc
x
]
...
...
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