Advertisement
Guest User

Untitled

a guest
Jan 27th, 2020
143
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MySQL 1.08 KB | None | 0 0
  1. with spans as
  2.   (select
  3.      spanid,
  4.      traceid,
  5.      clientzone
  6.    from
  7.      zipkin.zipkin_span_index
  8.    where
  9.      ds = '2020-01-23'
  10.      and clientservice like 'gizmoduck/prod/gizmoduck/%'
  11.   ),
  12. annotations as
  13. (
  14.   select
  15.       spanid,
  16.       traceid,
  17.       Max(stringV) as gizmoduck_method,
  18.       Max(intV) as query_width
  19.    from
  20.       zipkin.zipkin_flat_annotation
  21.    where
  22.       ds = '2020-01-23' and
  23.       endpoint.servicenamejob = 'gizmoduck' and
  24.       (label='query_width' or label='method')
  25.     group by spanid, traceid
  26. )
  27.  
  28. select
  29.   tfeuri as enpdoint,
  30.   clientzone,
  31.   gizmoduck_method,
  32.   avg(query_width) as avg_query_width,
  33.   (count(DISTINCT(t2.spanid))/count(DISTINCT(t1.traceid))) as rpc_per_trace,
  34.   count(DISTINCT(t1.traceid)) as num_traces
  35. from
  36.   zipkin.zipkin_trace_index t1
  37.     join spans t2 on t1.traceid = t2.traceid
  38.     join annotations t3 on t1.traceid = t3.traceid
  39. where
  40.     t1.ds = '2020-01-23'
  41.     and tfehost = 'api.twitter.com'
  42.     and isprodonly = true
  43. group by
  44.   tfeuri,gizmoduck_method,clientzone
  45. order by
  46.   num_traces desc
  47. limit 20
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement