1
0
Fork 0
mirror of https://github.com/puma/puma.git synced 2022-11-09 13:48:40 -05:00
Commit graph

22 commits

Author SHA1 Message Date
MSP-Greg
fe31aadd5b Load JSON at runtime
Closes #2206
2020-05-17 11:59:39 -05:00
Will Jordan
613ac8e803 Add fork_worker option and refork command
Trigger refork for improved copy-on-write performance.
2020-05-01 17:21:32 -07:00
Bart
1bec245b63 Change Puma.stats to return a hash instead of a JSON string (#2086)
Having access to the hash allows to produce stats in other ways (such as StatsD) without having to parse JSON of data that is available in memory. An example of this workaround is fa6ba1f507/lib/puma/plugin/statsd.rb (L112-L114)
2019-12-17 12:38:48 +07:00
Daniel Colson
39d16fadaf Add pumactl command to print thread backtraces (#2054)
* Add pumactl command to print thread backtraces

Completes 1 of 2 items from #1964

This commit adds an endpoint to the status app to print thread
backtraces, and control cli command to call that endpoint.

I tried this locally by starting a server with:

```sh
bundle exec bin/puma test/rackup/hello.ru \
  --control-url="unix://test.sock" \
  --control-token="token"
```

and then printing the backtraces with:

```sh
bundle exec bin/pumactl thread-backtraces \
  --control-url="unix://test.sock" \
  --control-token="token"
```

* Log threads as JSON in control app

With this commit the status app sends the thread backtraces as an array
of objects with `name` and `backtrace` keys, rather than as a string
matching the SIGINFO output.

While working on this I noticed that we logged the thread TID twice.
This commit simplifies that so we only log the thread TID once, with
both the label (I don't know when the label would get set) and name if
they are available.
2019-11-11 13:08:41 +08:00
Nate Berkopec
b18250f1b5
Status app: privatize auth, no more explicit returns 2019-09-20 12:45:56 +02:00
Jesús Burgos Maciá
6dd084bd3b Merge files documenting configuration options (#1883) 2019-08-05 17:30:43 -07:00
Nate Berkopec
4c85facff3
Test cleanup and parallelization (#1846)
* Add frozen string literal everywhere it wasnt already

* Enforce stopgap for tests

* Small amount of integration test cleanup

* Parallelize and freeze Test_app_status

* Big cleanup for test_binder

* Whitespace fix
2019-07-16 18:53:28 -04:00
Jesús Burgos Maciá
2db1ef10f7 Fix: Invalid JSON on gc-stats (#1801)
* Fix: Invalid JSON on gc-stats

Credits of this patch should be for @jdsundberg, who reported the issue
but never sent a patch. Link to his bug report is below.

Closes #1687.

* Update tests so JSON response is correctly parsed

JSON without a whitespace between key and values wasn't being correctly
parsed (for example: `key: 'value'` was processed ok, but `key:'value'`
wasn't).
2019-05-21 07:43:18 -05:00
Noah Gibbs
0d7a8bb5f3 Add /gc URL to status server to do a major GC. Add a /gc-status URL to get GC.stats as JSON. (#1384) 2017-08-03 15:46:49 -06:00
Evan Phoenix
f788af0c8f Continue API cleanup, preparing for 3.0 2016-02-06 19:00:29 -08:00
Rubén Caro
48b50a312f Add reload_worker_directory 2014-02-25 14:52:20 +01:00
Michael J. Cohen
678a6c73c9 Fix typo in phased-restart response
Sponsored-by: CentroNet Marketing
2013-08-06 15:47:40 -04:00
Evan Phoenix
c48b804d8f Refactor modes, fix control server to always work 2013-07-05 16:08:13 -07:00
Paco Viromontes
a2a53316c3 allow for alternate locations for status app 2012-10-03 18:16:31 -07:00
Evan Phoenix
27b2f8e60a Formatting fix 2012-07-19 16:38:16 -07:00
Konstantin Haase
3dc2a76211 use #bytesize instead of #length for Content-Length header 2012-05-13 02:27:14 +03:00
jc00ke
29a71026f1 Use correct Content-Type 2012-04-29 12:24:00 -07:00
jc00ke
ede98dadfd Return valid Rack responses from status server
Use Rack::Lint to check the response is valid. Existing code really just
needed Content-Length & Content-Type headers.
2012-04-29 12:18:21 -07:00
Evan Phoenix
892084657f + Add ability to inherit server sockets on restart 2012-04-04 11:38:22 -04:00
Evan Phoenix
a91d64a560 Add auth token support to App::Status 2011-12-06 16:22:02 -08:00
Evan Phoenix
d8026e87f4 Add ability to restart by reexecing and pumactl to use it
This allows all existing requests to finish, but does not keep the same
socket alive across the exec, so this is not a graceful as it could be.
2011-12-05 15:58:23 -08:00
Evan Phoenix
c5aad50eb4 Add App::Status rack app to control a server
Puma::App::Status is a rack app that can be used to control the current
server. It allows a server to be queried remotely programmaticly.
2011-12-05 09:01:19 -08:00