Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make timestamp param position consistent. Add some tests #1

Merged
merged 4 commits into from Nov 17, 2014
Merged
Changes from 1 commit
Commits
File filter...
Filter file types
Jump to…
Jump to file or symbol
Failed to load files and symbols.

Always

Just for now

Next

Make timestamp param position to be consistent

In some places it was before id, in others it was after the id.

Makes it always to be placed before the id param
  • Loading branch information...
nberger committed Nov 17, 2014
commit 203e6c629247179c5ef18e2e16ba5d6f4cc38208
@@ -20,7 +20,7 @@
information for the fact on all the specified categories")

(inc! [service id categories]
[service id timestamp categories]
[service timestamp id categories]

This comment has been minimized.

Copy link
@nberger

nberger Nov 17, 2014

Author Contributor

@guilespi I'm changing the params order here, to make it consistent with new-fact params order. What do you think?

"Notifies of new counter event occurred and increments
its value in all the specified categories")

@@ -35,30 +35,26 @@
(schema/all-dimensions config))

(new-fact! [service id value categories]
(u/new-fact config
id
(t/now)
value
categories))
(api/new-fact! config
(t/now)
id
value
categories))

(new-fact! [service timestamp id value categories]
(u/new-fact config
id
(tcoerce/from-date timestamp)
id
value
categories))

(inc! [service id categories]
(u/new-fact config
id
(t/now)
1
categories))
(api/inc! service (t/now) id categories))

(inc! [service id timestamp categories]
(inc! [service timestamp id categories]
(u/new-fact config
id
(tcoerce/from-date timestamp)
id
1
categories))

@@ -78,7 +78,7 @@
"When a new fact occurs update all the corresponding dimensions specified in the fact
categories. If some category is not updatable the complete fact fails (this is in
order to avoid counter mismatches)"
[db id timestamp value categories]
[db timestamp id value categories]
(if (some nil? (vals categories))
(throw (Exception. "Some categories have nil values"))
(if-let [fact (schema/get-fact db id)]
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.