简体   繁体   English

Graphite summarise() 函数结果对于不同的“from”值不一致

[英]Graphite summarize() function results are inconsistent for different 'from' values

I am using Graphite to record user login information.我正在使用 Graphite 记录用户登录信息。

When I run the following :当我运行以下命令时:

render?target=summarize(stats_counts.login.success,"1day")&format=json&from=-1days

I am getting the result :我得到的结果:

[
  {
    "target": "summarize(stats_counts.login.success, \"1day\", \"sum\")",
    "datapoints": [
      [
        5,
        1435708800
      ],
      [
        21,
        1435795200
      ]
    ]
  }
]

But for the following query :但是对于以下查询:

render?target=summarize(stats_counts.login.success,"1day")&format=json&from=-7days

I am getting the result :我得到的结果:

[
  {
    "target": "summarize(stats_counts.login.success, \"1day\", \"sum\")",
    "datapoints": [
      [
        0,
        1435190400
      ],
      [
        1,
        1435276800
      ],
      [
        0,
        1435363200
      ],
      [
        0,
        1435449600
      ],
      [
        5,
        1435536000
      ],
      [
        16,
        1435622400
      ],
      [
        6,
        1435708800
      ],
      [
        21,
        1435795200
      ]
    ]
  }
]

Notice the value for the bucket : 1435708800 in both the results.请注意两个结果中存储桶的值: 1435708800 In one result it is : 5 and in the second result it is : 6第一个结果是: 5 ,第二个结果是: 6

In the first query I am trying to get the number of user logins per day over the last week and in the second one I am trying to get the number of user logins per day yesterday and today.在第一个查询中,我试图获取上周每天的用户登录数,在第二个查询中,我试图获取昨天和今天每天的用户登录数。

What is the reason for this difference ?这种差异的原因是什么?

UPDATE更新

Graphite Version : 0.9.10 Retention Settings :石墨版本:0.9.10 保留设置:

[carbon]
pattern = ^carbon\.
retentions = 60:90d

[real_time]
priority = 200
pattern = ^stats.*
retentions = 1:34560000

[stats]
priority = 110
pattern = .*
retentions = 1s:24h,1m:7d,10m:1y

Try adding allign to true, since based on time it varies the number of data points it get on the bucket interval.尝试将 allign 添加为 true,因为它会根据时间改变它在存储桶间隔上获得的数据点数量。

By default, buckets are calculated by rounding to the nearest interval.默认情况下,桶是通过四舍五入到最接近的间隔来计算的。 This works well for intervals smaller than a day.这适用于小于一天的间隔。 For example, 22:32 will end up in the bucket 22:00-23:00 when the interval=1hour.例如,当间隔=1 小时时,22:32 将在 22:00-23:00 桶中结束。

Passing alignToFrom=true will instead create buckets starting at the from time.传递 alignToFrom=true 将改为从 from 时间开始创建桶。 In this case, the bucket for 22:32 depends on the from time.在这种情况下,22:32 的存储桶取决于起始时间。 If from=6:30 then the 1hour bucket for 22:32 is 22:30-23:30.如果 from=6:30,那么 22:32 的 1 小时时段是 22:30-23:30。

"summarize(ex.cpe.ex.xxx,'30s','avg', true)" “总结(ex.cpe.ex.xxx,'30s','avg',真)”

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM