1

so I wanted to start playing with it and test it, so i put this config:

storage-schemas.conf:

[short2]
pattern = ^short2\.
retentions = 10s:1m

storage-aggregation.conf

[sum]
pattern = \.count$
xFilesFactor = 0
aggregationMethod = sum

what I think that my config say: get data every 10 seconds and save it to 1 minutes so total of 10 points will be saved

now if i go to http://localhost/render/?target=short2.sum&format=json&from=-1h

I see many data with null values a lot more than 10,

ok so I give up on that, than I said let's try to feed it data once every 10 seconds, if i do

 echo "short2.sum 22  `date +%s`" | nc -q0 127.0.0.1 2003
 wait 11 seconds
 echo "short2.sum 23  `date +%s`" | nc -q0 127.0.0.1 2003

now looking at the api I can see only the last point get registerd like:

[
null,
1464781920
],
[
null,
1464781980
],
[
null,
1464782040
],
[
null,
1464782100
],
[
23,
1464782160
],

now if I send it another point (a lot after 10 seconds)

echo "short2.sum 24  `date +%s`" | nc -q0 127.0.0.1 2003

this is what I get:

 [
    null,
    1464781920
    ],
    [
    null,
    1464781980
    ],
    [
    null,
    1464782040
    ],
    [
    null,
    1464782100
    ],
    [
    24,
    1464782160
    ],

only once in a couple of tries I will see them count as new but they just overwriting each other instead of acting like new data

Amir Bar
  • 3,007
  • 2
  • 29
  • 47

1 Answers1

0

Actually:

[short2]
pattern = ^short2\.
retentions = 10s:1m

means: all metrics starts with short2. keep for 1 minute with 10 second resolution (each datapoint represents 10s). It also means if there are not defined other storage schemas for short2., it will have value only for 1 (last) minute.

http://graphite.readthedocs.io/en/latest/config-carbon.html#storage-schemas-conf

kwarunek
  • 12,141
  • 4
  • 43
  • 48
  • so total of 10 datapoint like I said, but I have many more than 10 – Amir Bar Jun 02 '16 at 16:56
  • Again your `retentions` value means that you have datapoint only from last minute (there are no data from 2m ago), so at most you should be able to fetch 10 datapoints from last minute. The reason you don't get these 10 datapoints is probably misconfiguration - take a look http://stackoverflow.com/a/34520400/681044. To have elder datapoints, you have to define border range, or another retention... – kwarunek Jun 02 '16 at 19:29