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

Tcp listen backlog #14

Closed
wants to merge 13 commits into from
Closed

Tcp listen backlog #14

wants to merge 13 commits into from

Conversation

apg
Copy link

@apg apg commented Sep 14, 2017

Get the listen backlog size from /proc/:pid?/net/tcp

In most cases the metrics being collected are not actually timings,
but instead are counters. There are, however, some things that *are*
actually "timers" which we need to address in a future commit.

For now, we still submit the counters, as timers, to statsd to
maintain the statsd aggregation facilities that are useful for per
request stat tracking.

(Tests are probably failing after this commit)
RackReporter reports only counters (as timers), which are useful in a
per request context (e.g. how many minor collections are happening per
request), using sampling strategies.

However, data for the entire process, which previously was reported as
Rack::Server should not be sampled. Instead, the PeriodicReporter
reports to statsd as counts and gauges, providing a more accurate look
at the server's characteristics over time.

The intention of PeriodicReporter is to be used by a clock that
measures, and then reports on an interval corresponding to the statsd
flushInterval (by default something like 10 seconds). A clock is
not included in this commit. Stay tuned.
Periodic collects metrics and reports them to reporter on an interval,
rather than on a per request basis (such as the Rack class). To avoid
large rearchitecting, it mimics that of the Rack Middleware by
conforming to the environment passing model of the reporter and
metrics storage, using *it's* thread local storage for that of
persisted last values of counters to track changes.

In addition, we add a RailTie, specifically for the enabling and
starting the periodic reporter.
- ReporterTest ensures that report implementations do nothing
- Move ReporterTest -> RackReporterTest
- Add PeriodicReporterTest which tests sample rates implementation.
Provide a test helper for Statsd which yields after a call to
`:block`. This provides a basis for mocking out the `:count` and
`gauge` methods.
@apg
Copy link
Author

apg commented Sep 14, 2017

Bah. This wasn't meant to be opened here. Sorry for the noise.

@apg apg closed this Sep 14, 2017
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 this pull request may close these issues.

None yet

2 participants