wavefront-cli 8.0.1 → 8.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d831cf75206998d12f64271f13ce2b98c5cdeef18470b7f8e366f38c46a186e7
4
- data.tar.gz: 8a0e75fe5bd16d0893d52a863daf04ed599418d848ee024d0c4177cb3837e30c
3
+ metadata.gz: 53d7cbfa6e04c70f7c9c2af901ec42da4783b5b2f4aaa7552ebb53bf840395da
4
+ data.tar.gz: cef50e1684db66aa4a525c7ba91088a491bb790b8562c720437a12e7692b4390
5
5
  SHA512:
6
- metadata.gz: 10a9becb4fd55031ce4913718b9a6e65f5bc05b92ba961ee8474889733991a816e455deaed6dec4869b1058d2c8fee515c51e4f6bc4091ee3e1560f7de1bc8e1
7
- data.tar.gz: ac4a999ea2d23fc62c04612fdccb51c0bf3f66cf2017ea2980e58f3d684d2e145f53ebae429461498b832521154f674687a6cb3eaef438fb466e050ea7388e70
6
+ metadata.gz: 3ec1eacceffa1fefad6050e42eb5c3891133da9e23bcb5e62de8ee558b9535d27936e95a3a66eb6eac616d4effe371b3f66334e6a652548d3ae0b06d39747853
7
+ data.tar.gz: 241a752fb0fd12225e8fa26a342380a15040d37d694fc90c23604bb96691e4ad54f97617cc1fcf688f495e8ed42f44ef0e60c9122ddaa9b2cbd7b13dbb86ac3e
data/HISTORY.md CHANGED
@@ -1,5 +1,8 @@
1
1
  # Changelog
2
2
 
3
+ ## 8.1.0 (2020-10-04)
4
+ * Display traces in human-readable query output.
5
+
3
6
  ## 8.0.1 (2020-09-28)
4
7
  * If the user specifies a config stanza and it is not found, exit with an
5
8
  error rather than silently falling back to env vars.
@@ -179,7 +179,7 @@ module WavefrontDisplayPrinter
179
179
  data.each.with_index(1) do |element, i|
180
180
  aggr = make_list(element, aggr, depth, last_key)
181
181
 
182
- if opts[:separator] && element.is_a?(Hash) && i < data.size
182
+ if opts[:separator] && element.is_a?(Hash) && i < data.size && depth < 3
183
183
  aggr.<< ['', :separator, depth]
184
184
  end
185
185
  end
@@ -20,6 +20,7 @@ module WavefrontDisplay
20
20
  { name: data.name,
21
21
  query: data.query,
22
22
  timeseries: mk_timeseries(data),
23
+ traces: mk_traces(data),
23
24
  events: mk_events(data) }.tap do |d|
24
25
  d[:warnings] = data[:warnings] if show_warnings?
25
26
  end
@@ -54,6 +55,12 @@ module WavefrontDisplay
54
55
  data[:events].map { |s| humanize_event(s) }
55
56
  end
56
57
 
58
+ def mk_traces(data)
59
+ return [] unless data.key?(:traces)
60
+
61
+ data[:traces].map { |t| humanize_trace(t) }
62
+ end
63
+
57
64
  def do_run
58
65
  do_default
59
66
  end
@@ -99,6 +106,23 @@ module WavefrontDisplay
99
106
  end
100
107
  end
101
108
 
109
+ def humanize_trace(data)
110
+ data.tap do |t|
111
+ t[:start] = human_time(t[:start_ms])
112
+ t[:end] = human_time(t[:end_ms])
113
+ t.delete(:start_ms)
114
+ t.delete(:end_ms)
115
+ t.delete(:startMs)
116
+ t.spans = t.spans.map { |s| humanize_span(s) }
117
+ end
118
+ end
119
+
120
+ def humanize_span(span)
121
+ span.tap do |s|
122
+ s[:startMs] = human_time(s[:startMs])
123
+ end
124
+ end
125
+
102
126
  def row_time_and_val(row)
103
127
  if row.is_a?(Hash)
104
128
  [human_time(row[:timestamp]), row[:value]]
@@ -1,3 +1,3 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- WF_CLI_VERSION = '8.0.1'
3
+ WF_CLI_VERSION = '8.1.0'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wavefront-cli
3
3
  version: !ruby/object:Gem::Version
4
- version: 8.0.1
4
+ version: 8.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Robert Fisher
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-09-28 00:00:00.000000000 Z
11
+ date: 2020-10-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: docopt