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

tail from end of file #54

Merged
merged 1 commit into from
Dec 19, 2018
Merged

Conversation

itshikanov
Copy link
Contributor

No description provided.

@itshikanov
Copy link
Contributor Author

When the exporter is started, he reads the whole file, from the first line. When you restart the exporter, you receive splash on chart with 10000+ values.
The fix reads the file since the end and rate() function work properly.

@paskal
Copy link
Contributor

paskal commented Nov 19, 2018

Looks promising, but (obviously) it breaks tests, could you please fix them as well?

@itshikanov
Copy link
Contributor Author

itshikanov commented Nov 27, 2018

Looks promising, but (obviously) it breaks tests, could you please fix them as well?

I think that tests, read the file since the beginning. Thats why they breaks.

@martin-helmich martin-helmich merged commit dd1a572 into martin-helmich:master Dec 19, 2018
@martin-helmich
Copy link
Owner

👍 Thanks for the contribution (and sorry for the late response).

The failing tests actually uncovered an interesting edge case: In the test cases, the exporter is started first, and then the access log file is written (which means that the tests should pass, even with this change).

The issue was that the access log file was still read from EOF even if it did not exist when the exporter was started. IMO the correct behaviour would be to...

  1. read the file from the end if it already existed when the exporter started
  2. read the entire file from the beginning if it only popped up when the exporter was already running

Fixed this in 25a4901

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

Successfully merging this pull request may close these issues.

3 participants