Handle timing data not being available on initial load
This commit is contained in:
parent
c243cfc0d5
commit
8b0056c2be
|
@ -251,3 +251,9 @@
|
|||
(let [start-of-render (first (filter metam/request-animation-frame? traces))
|
||||
end-of-epoch (utils/last-in-vec traces)]
|
||||
(metam/elapsed-time start-of-render end-of-epoch))))
|
||||
|
||||
(rf/reg-sub
|
||||
:timing/data-available?
|
||||
:<- [:traces/current-event-traces]
|
||||
(fn [traces]
|
||||
(not (empty? traces))))
|
||||
|
|
|
@ -7,7 +7,8 @@
|
|||
(:require-macros [day8.re-frame.trace.utils.macros :as macros]))
|
||||
|
||||
(defn render []
|
||||
|
||||
(let [timing-data-available? @(rf/subscribe [:timing/data-available?])]
|
||||
(if timing-data-available?
|
||||
[rc/v-box
|
||||
:padding "12px 0px"
|
||||
:children [[rc/label :label "Total Epoch Time"]
|
||||
|
@ -17,4 +18,7 @@
|
|||
[rc/label :label "Event time"]
|
||||
[rc/label :label (str @(rf/subscribe [:timing/event-processing-time]) "ms")]
|
||||
[rc/label :label "Render/Subscription time"]
|
||||
[rc/label :label (str @(rf/subscribe [:timing/render-time]) "ms")]]])
|
||||
[rc/label :label (str @(rf/subscribe [:timing/render-time]) "ms")]]]
|
||||
[rc/v-box
|
||||
:padding "12px 0px"
|
||||
:children [[:h1 "No timing data available currently."]]])))
|
||||
|
|
Loading…
Reference in New Issue