Skip to content

Instantly share code, notes, and snippets.

View hispanic's full-sized avatar

Michael Harry Scepaniak hispanic

View GitHub Profile
@hispanic
hispanic / vertically-aligned-log-formatter.js
Last active November 29, 2015 20:35
Log formatter for winston that enforces vertically-aligned log entry components
/**
* The fixed (both minimum and maximum) length of the "level" property in each log entry.
* Longer values will be truncated, while shorter values will be right-padded with spaces.
*/
var levelLength = 5;
/**
* Custom log formatter that enforces vertically-aligned log entry components.
*
* @param options - See winston/common.log() for available properties.
@hispanic
hispanic / httpclient-logging-connection-leak
Created November 26, 2015 12:47
HttpClient Logging - Connection leak
Connection request: [route: {}->http://myhost:8080][total kept alive: 2; route allocated: 50 of 50; total allocated: 52 of 100]
@hispanic
hispanic / httpclient-logging-no-leaks
Created November 26, 2015 12:45
HttpClient Logging - No leaks
Connection leased: [id: 66][route: {}->http://myhost:8080][total kept alive: 2; route allocated: 3 of 50; total allocated: 5 of 100]
Connection leased: [id: 64][route: {}->http://myhost:8080][total kept alive: 4; route allocated: 3 of 50; total allocated: 5 of 100]
Connection leased: [id: 64][route: {}->http://myhost:8080][total kept alive: 4; route allocated: 3 of 50; total allocated: 5 of 100]
Connection leased: [id: 64][route: {}->http://myhost:8080][total kept alive: 4; route allocated: 3 of 50; total allocated: 5 of 100]
Connection leased: [id: 64][route: {}->http://myhost:8080][total kept alive: 4; route allocated: 3 of 50; total allocated: 5 of 100]
Connection leased: [id: 67][route: {}->http://myhost:8080][total kept alive: 3; route allocated: 3 of 50; total allocated: 5 of 100]
http-outgoing-64: Shutdown connection
Connection leased: [id: 67][route: {}->http://myhost:8080][total kept alive: 3; route allocated: 2 of 50; total allocated: 4 of 100]
Connection leased: [id: 66][route: {}->http://myhost:80
@hispanic
hispanic / httpclient-logging-connection-discarded
Created November 26, 2015 12:43
HttpClient Logging - Connection discarded
http-outgoing-58: Shutdown connection
Connection discarded
http-outgoing-58: Close connection
Connection released: [id: 58][route: {}->http://myhost:8080[total kept alive: 6; route allocated: 4 of 50; total allocated: 6 of 100]
@hispanic
hispanic / httpclient-logging-connection-stale
Created November 26, 2015 12:41
HttpClient Logging - Connection stale
Connection request: [route: {}->http://myhost:8080][total kept alive: 5; route allocated: 3 of 50; total allocated: 5 of 100]
Connection leased: [id: 56][route: {}->http://myhost:8080[total kept alive: 4; route allocated: 3 of 50; total allocated: 5 of 100]
Stale connection check
http-outgoing-56 << "end of stream"
Stale connection detected
http-outgoing-56: Close connection
Opening connection {}->http://myhost
Connecting to myhost:8080
@hispanic
hispanic / httpclient-logging-connection-created
Created November 26, 2015 12:40
HttpClient Logging - Connection created
Connection request: [route: {}->http://myhost:8080][total kept alive: 1; route allocated: 1 of 50; total allocated: 2 of 100]
Connection leased: [id: 2][route: {}->http://myhost:8080][total kept alive: 1; route allocated: 2 of 50; total allocated: 3 of 100]
Opening connection {}->http://myhost:8080
@hispanic
hispanic / httpclient-logging-connection-re-used
Created November 26, 2015 12:38
HttpClient Logging - Connection re-used
Connection request: [route: {}->http://myhost:8080][total kept alive: 1; route allocated: 1 of 50; total allocated: 1 of 100]
Connection leased: [id: 1][route: {}->http://myhost:8080][total kept alive: 0; route allocated: 1 of 50; total allocated: 1 of 100]
@hispanic
hispanic / httpclient-logging-connection-released
Created November 26, 2015 12:36
HttpClient Logging - Connection released
Connection [id: 0][route: {}->http://myhost:8080] can be kept alive indefinitely
Connection released: [id: 0][route: {}->http://myhost:8080][total kept alive: 1; route allocated: 1 of 50; total allocated: 1 of 100]
@hispanic
hispanic / httpclient-logging-connection-leased
Last active November 29, 2015 20:38
HttpClient Logging - Connection leased
Connection leased: [id: 0][route: {}->http://myhost:8080][total kept alive: 0; route allocated: 1 of 50; total allocated: 1 of 100]
@hispanic
hispanic / httpclient-logging-connection-request
Last active November 29, 2015 20:38
HttpClient Logging - Connection request
Connection request: [route: {}->http://myhost:8080][total kept alive: 0; route allocated: 0 of 50; total allocated: 0 of 100]