Skip to content

Commit abbbdbe

Browse files
committed
Fix formatting issues
1 parent 8cd118a commit abbbdbe

File tree

2 files changed

+53
-53
lines changed

2 files changed

+53
-53
lines changed

src/atlas/domain/sequence_diagram.clj

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
([k tags] (->> tags (filter (match-tag? k)) first))
2020
([k v tags] (->> tags (filter (match-tag? k v)) first)))
2121

22-
(def has-tag? (comp boolean find-tag))
22+
(def has-tag? (comp boolean find-tag))
2323

2424
(defn- server-span? [{:keys [tags]}] (has-tag? "span.kind" "server" tags))
2525

@@ -79,18 +79,18 @@
7979
(s/defn duration-ms :- cs/PosInt
8080
[trace :- s-jaeger/Trace]
8181
(let [start-time (start-time trace)
82-
end-time (->> trace :spans (map span->end-time) sort last)]
82+
end-time (->> trace :spans (map span->end-time) sort last)]
8383
(.toMillis (time/duration start-time end-time))))
8484

8585
(s/defn lifelines :- [s-sequence-diagram/Lifeline]
86-
[trace :- s-jaeger/Trace]
87-
(let [services (->> trace :processes (map process->lifeline))
88-
topics (->> trace :spans (filter producer-span?) (map span->topic) (map topic->lifeline))]
86+
[{:keys [spans processes]} :- s-jaeger/Trace]
87+
(let [services (->> processes (map process->lifeline))
88+
topics (->> spans (filter producer-span?) (map span->topic) (map topic->lifeline))]
8989
(concat services topics)))
9090

9191
(s/defn execution-boxes :- [s-sequence-diagram/ExecutionBox]
9292
[trace :- s-jaeger/Trace]
93-
(let [server-spans (->> trace :spans (filter server-span?))
93+
(let [server-spans (->> trace :spans (filter server-span?))
9494
consumer-spans (->> trace :spans (filter consumer-span?))]
9595
(map (span->execution-box trace) (concat server-spans consumer-spans))))
9696

test/atlas/domain/sequence_diagram_test.clj

Lines changed: 47 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,15 @@
1212
:start-time 1500000000000000
1313
:duration 1000
1414
:references []
15-
:tags [{:key "span.kind"
16-
:type "string"
17-
:value "server"}
18-
{:key "http.method"
19-
:type "string"
20-
:value "GET"}
21-
{:key "http.url"
22-
:type "string"
23-
:value "/api/orders/1"}]}
15+
:tags [{:key "span.kind"
16+
:type "string"
17+
:value "server"}
18+
{:key "http.method"
19+
:type "string"
20+
:value "GET"}
21+
{:key "http.url"
22+
:type "string"
23+
:value "/api/orders/1"}]}
2424

2525
{:trace-id "1"
2626
:span-id "2"
@@ -31,15 +31,15 @@
3131
:references [{:ref-type :child-of
3232
:trace-id "1"
3333
:span-id "1"}]
34-
:tags [{:key "span.kind"
35-
:type "string"
36-
:value "client"}
37-
{:key "http.method"
38-
:type "string"
39-
:value "GET"}
40-
{:key "http.url"
41-
:type "string"
42-
:value "/api/orders/1"}]}
34+
:tags [{:key "span.kind"
35+
:type "string"
36+
:value "client"}
37+
{:key "http.method"
38+
:type "string"
39+
:value "GET"}
40+
{:key "http.url"
41+
:type "string"
42+
:value "/api/orders/1"}]}
4343

4444
{:trace-id "1"
4545
:span-id "3"
@@ -50,45 +50,45 @@
5050
:references [{:ref-type :child-of
5151
:trace-id "1"
5252
:span-id "2"}]
53-
:tags [{:key "span.kind"
54-
:type "string"
55-
:value "server"}
56-
{:key "http.method"
57-
:type "string"
58-
:value "GET"}
59-
{:key "http.url"
60-
:type "string"
61-
:value "/api/orders/1"}]}
53+
:tags [{:key "span.kind"
54+
:type "string"
55+
:value "server"}
56+
{:key "http.method"
57+
:type "string"
58+
:value "GET"}
59+
{:key "http.url"
60+
:type "string"
61+
:value "/api/orders/1"}]}
6262
{:trace-id "1"
6363
:span-id "4"
6464
:process-id :p2
6565
:operation-name "kafka.out PROCESS_ORDER"
6666
:start-time 1500000000250000
67-
:duration 50
68-
:references [{:ref-type :child-of
69-
:trace-id "1"
70-
:span-id "3"}]
71-
:tags [{:key "span.kind"
72-
:type "string"
73-
:value "producer"}
74-
{:key "message_bus.destination"
75-
:type "string"
76-
:value "PROCESS_ORDER"}]}
67+
:duration 50
68+
:references [{:ref-type :child-of
69+
:trace-id "1"
70+
:span-id "3"}]
71+
:tags [{:key "span.kind"
72+
:type "string"
73+
:value "producer"}
74+
{:key "message_bus.destination"
75+
:type "string"
76+
:value "PROCESS_ORDER"}]}
7777
{:trace-id "1"
7878
:span-id "5"
7979
:process-id :p2
8080
:operation-name "kafka.in PROCESS_ORDER"
8181
:start-time 1500000000350000
82-
:duration 50
83-
:references [{:ref-type :child-of
84-
:trace-id "1"
85-
:span-id "4"}]
86-
:tags [{:key "span.kind"
87-
:type "string"
88-
:value "consumer"}
89-
{:key "message_bus.destination"
90-
:type "string"
91-
:value "PROCESS_ORDER"}]}]
82+
:duration 50
83+
:references [{:ref-type :child-of
84+
:trace-id "1"
85+
:span-id "4"}]
86+
:tags [{:key "span.kind"
87+
:type "string"
88+
:value "consumer"}
89+
{:key "message_bus.destination"
90+
:type "string"
91+
:value "PROCESS_ORDER"}]}]
9292

9393
:processes {:p1 {:service-name "bff"}
9494
:p2 {:service-name "orders"}}})

0 commit comments

Comments
 (0)