8000 Indexed sessions by athos · Pull Request #12 · athos/Postmortem · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Indexed sessions #12

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

Merged
merged 4 commits into from
May 16, 2022
Merged

Indexed sessions #12

merged 4 commits into from
May 16, 2022

Conversation

athos
Copy link
Owner
@athos athos commented May 15, 2022

This PR adds indexed sessions.

An indexed session is a session that automatically attaches a sequential number (or index) to each log item.

(require '[postmortem.core :as pm])

(pm/set-current-session! (pm/make-indexed-session))

(pm/spy>> :foo :a)
(pm/spy>> :bar :b)
(pm/spy>> :foo :c)
(pm/logs)
;=> {:foo [{:id 0 :val :a} {:id 2 :val :c}]
;    :bar [{:id 1 :val :b}]}

(pm/set-current-session! (pm/make-indexed-session (fn [id item] (assoc item :i id))))

(pm/spy>> :point {:x 100 :y 100})
(pm/spy>> :point {:x 200 :y 200})
(pm/spy>> :point {:x 300 :y 300})
(pm/log-for :point)
;=> [{:i 0 :x 100 :y 100} {:i 1 :x 200 :y 200} {:i 2 :x 300 :y 300}]

@codecov
Copy link
codecov bot commented May 15, 2022

Codecov Report

Merging #12 (5ff7ce0) into master (1ca9e86) will decrease coverage by 0.16%.
The diff coverage is 89.47%.

@@            Coverage Diff             @@
##           master      #12      +/-   ##
==========================================
- Coverage   92.25%   92.08%   -0.17%     
==========================================
  Files           6        6              
  Lines         297      316      +19     
  Branches       17       17              
==========================================
+ Hits          274      291      +17     
- Misses          6        8       +2     
  Partials       17       17              
Impacted Files Coverage Δ
src/postmortem/session.cljc 95.83% <84.61%> (-1.76%) ⬇️
src/postmortem/core.cljc 86.08% <100.00%> (+0.76%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 1ca9e86...5ff7ce0. Read the comment docs.

@athos athos force-pushed the feature/indexed-session branch from e101b60 to 5ff7ce0 Compare May 15, 2022 09:36
@athos athos merged commit 65aece4 into master May 16, 2022
@athos athos deleted the feature/indexed-session branch May 16, 2022 13:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant
0