Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Graphite plugin decodes Unix time to incorrect local time value #2077

Closed
salsa-dev opened this issue Mar 25, 2015 · 2 comments · Fixed by #2080
Closed

Graphite plugin decodes Unix time to incorrect local time value #2077

salsa-dev opened this issue Mar 25, 2015 · 2 comments · Fixed by #2080
Assignees

Comments

@salsa-dev
Copy link

Hi,
Using master branch and Graphite plugin enabled I get the following:

root@grid-monitoring:~# echo "example.foo.bar 3 `date +%s`"|nc localhost 2003

root@grid-monitoring:~# curl -G 'http://localhost:8086/query?pretty=true' --data-urlencode "db=graphite" --data-urlencode "q=SELECT * FROM example.foo.bar"
{
    "results": [
        {
            "series": [
                {
                    "name": "example.foo.bar",
                    "columns": [
                        "time",
                        "example.foo.bar"
                    ],
                    "values": [
                        [
                            "1970-01-17T12:28:44.244Z",
                            3
                        ]
                    ]
                }
            ]
        }
    ]
}

The same incorrect time values I get using collectl with InfluxDB.

I'm quite new to golang and thus I presume there is just some typo in graphite.go#L97 in function parameters to time.Unix where seconds are set to zero.
Is it justified to change the line to:
timestamp := time.Unix(unixTime, 0)
?

@otoolep
Copy link
Contributor

otoolep commented Mar 25, 2015

@corylanou

@sitano
Copy link

sitano commented Mar 26, 2015

heh, i thought it is a feature, not a bug ;)

mark-rushakoff pushed a commit that referenced this issue Jan 11, 2019
…ub-package so it can be reused (#2077)

* refactor(cmd/influxd): move driver code for influxd main package to sub-package so it can be reused.

* chore(query/influxql): moved query_test.go and requisite files to the influxql dir to be closer to the code it tests. (#2013)
mark-rushakoff pushed a commit that referenced this issue Jan 11, 2019
…age to sub-package so it can be reused (#2077)"

This reverts commit c3c12d1.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants