【问题标题】:Trying to retrieve list of browser widths in New Relic but can't ORDER BY in NRQL尝试在 New Relic 中检索浏览器宽度列表,但无法在 NRQL 中排序
【发布时间】:2022-08-20 05:16:13
【问题描述】:

我试图按大小顺序获取所有使用的浏览器宽度和次数的列表。所以:

1920 - 12,356
1440 - 19,453
1280 - 10,847
1024 - 4,124

或类似的东西。重要的是按宽度而不是使用顺序列出它们。我正在使用这个:

SELECT count(browserWidth) FROM PageAction FACET browserWidth ORDER BY browserWidth LIMIT 1000

但我得到的结果是由最常用的 browserWidth 排序的,而不是 browserWidth 本身。我在这里做错了什么?

    标签: newrelic nrql


    【解决方案1】:

    这有点费力,但您可以使用facet cases 将它们存储起来,例如:

    SELECT count(*)  from PageAction facet cases
      (where browserWidth <= 1366 as '720p',
       where browserWidth > 1366 and browserWidth <= 1440 as '1440p',
       where browserWidth > 1440 and browserWidth <= 1680 as '1050p',
       where browserWidth > 1680 and browserWidth <= 1920 as '1080p',
       where browserWidth > 1920 and browserWidth <= 2560 as '1440p',
       where browserWidth > 2560 as '> 1440p')
    since 30 days ago  
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2021-08-25
      • 2022-09-29
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多