queries.js 907 B

1234567891011121314151617181920212223242526272829303132
  1. export const ENDPOINT_LIST_QUERY = `SELECT description, count() AS count
  2. FROM spans_experimental_starfish
  3. WHERE module = 'http'
  4. GROuP BY description
  5. ORDER BY count DESC
  6. LIMIT 10
  7. `;
  8. export const ENDPOINT_GRAPH_QUERY = `SELECT
  9. toStartOfInterval(start_timestamp, INTERVAL 5 MINUTE) as interval,
  10. quantile(0.5)(exclusive_time) as p50,
  11. quantile(0.75)(exclusive_time) as p75,
  12. quantile(0.95)(exclusive_time) as p95,
  13. quantile(0.99)(exclusive_time) as p99
  14. FROM spans_experimental_starfish
  15. WHERE module = 'http'
  16. GROUP BY interval
  17. ORDER BY interval asc
  18. `;
  19. export const getEndpointDetailQuery = description => {
  20. return `SELECT
  21. toStartOfInterval(start_timestamp, INTERVAL 5 MINUTE) as interval,
  22. quantile(0.5)(exclusive_time) as p50,
  23. count() as count
  24. FROM spans_experimental_starfish
  25. WHERE module = 'http'
  26. AND description = '${description}'
  27. GROUP BY interval
  28. ORDER BY interval asc
  29. `;
  30. };