Beginner question: Counting number of files in directory


I’ve just started to learn monitoring and measuring performance and I thought to start with a simple task would give me enough to digest in one go.
The task at hand is to count the current number of files in a directory and display it in Grafana

I’m saving the count of files (every 5-10 s, depending on other operations) and this is written into the db: xxxx (timestamp) item value.
E.g. 1504599143851000000 5 1

First question: why do I get two fields? the item field contains the actual number, the value sometimes 0 sometimes 1
Second question: in Grafana I try to visualise the data, without any luck, my query so far:
FROM NumberOfFiles SELECT field(value) count() GROUP BY time(10s)

Thank you for your help in advance.

Ok, my bad, I’ve passed string instead of int into the value field…