Commit Graph

12 Commits

Author SHA1 Message Date
Andrew Mayorov
4fab3f64af
Split severity off formatted event message (#152)
It's usually needed earlier than the message itself. And may even be used
to skip formatting altogether, with `msg_fun()` facility in Erlang
logger.

Simplify event handler interface which should make this module more
usable down the line.

Also use monotonic timestamps when measuring time intervals.
2021-06-22 11:01:27 +03:00
Andrew Mayorov
d106ef66bd
Use new performant thrift codec infrastructure (#145)
* Implement woody_client_thrift_v2 over new thrift codec facility, make it default
* Move tracing facilities into woody_trace_h
* Implement woody_server_thrift_v2 over thrift codec facility, make it default
* Bump to rbkmoney/genlib@54920e76
* Enforce tuple-based args representation
* Enable cross tests between impls
* Switch to master rbkmoney/thrift_erlang@4eda678c
2020-08-18 13:01:47 +03:00
Andrew Mayorov
e615c85d70
Implement binary-first event formatter (#122)
* Add compex term formatting microbenchmark
* Format FP numbers more neatly
* Provide fast-path verbatim term formatter
* Add memory pressure benchmark runner
* Switch to rebar3_bench 0.2.1 package
* Employ assert macros throughout main ct suite
2019-12-31 12:52:56 +03:00
Sergey Yelin
59ec572466
Add depth and limit to formatter (#110)
* Force print trace_id and Co

* Use integer control char for formtatting numbers

* Sync

* Fix format for "wrong" struct

* Replace string formatting with inplace string representation

* Replace foldl with tail call

* Added opts comntainer

* Add formatting with depth

* Simplify depth increment

* More depth tests

* Format test data

* lint fixes

* Fix dialyzer errors

* Introduce current_length and max_length

* Add first tests for max_length

* Add length options

* Fix state in format_struct

* Fix test

* Move depth to stack from state

* Move length from state to stack

* Added more test on chars limit

* More tests

* Try to log more data nj logs

* Cleanup

* Fix line count in arguments

* Add missing formatted text in list and map

* Add comment to raw_string

* Formating

* Replace format with concatenation

* Fix dialyzer errors

* Fix lint errors

* Ignore false positives

* Added tests for max_length and max_depth

* Let logger decide how to format data in case of error

* Add formatter options to meta

* Fix lint error

* Increase complexity for dont_repeat_yourself

* Increase compliexity - 2

* Decrease complexity to minimal for current codebase

* Do not add '...' if no more argemunts in call

* Unify arguments for maybe_add_delimiter and may_be_add_more_marker

* Fix formating for list/set/map

* Simplify format build

* Log error

* Review fixes

* Move formatter options to environment

* Minor fixes and code cleanup

* Fix Opts

* Review fix

* Rework exception handling

* Move list and set format to separate functions

* Fix possible injection

* Eliminate possible badmatch

* Allow more complex dry

* Add test for sets

* Rework list formatter

* More strict limit for length

* Minor cleanup

* Remove unreachable code

* Switch back to formatter

* Remove unneeded flatten

* Do not format last list element if there is no room for it

* Remove unused Param

* Fix

* Simplify formatting call

* Add missing delimiter length

* Fix woody_event_formatter:format_reply/3

* Cleanup

* Add Opts to formatters

* Make skip message compact

* use ~w instead of ~p

* Typo

* Add formatter_opts to woody:options()

* Rework options

* Added escape for "'"

* Rework tests

* Fix tests

* Rework
2019-12-03 16:12:17 +03:00
Sergey Yelin
6136395b87
AAA-54: Add event formatter (#109)
* AAA-54: Add event formatter

* More tests enabled

* Fix list of unoins

* Fix list of structures test

* Added reply formatter

* Enable another reply test

* Fix format error

* Add reply formatting

* Enable cover

* Add missing Value types

* Fix formattin typo

* Fix lint errors

* More formatting

* Fix dialyzer error

* Fix enum format

* Simplify format rules for enum

* Add unit type to log

* Add more info for union

* Remove unused wxtra formatting

* Use compact formatting rules for unknown data

* Simplify formatting

* Refactor formatting

* Add set formatting

* Move request formatting to woody_event_formatter

* Move reply formatting to woody_event_formatter

* Module cleanup

* Fix lint errors

* Fix dialyzer errors

* Add exception handling

* Fix remove custom msgpack formatting

* Add more non-printable string detection merthods

* Better name for formatting function

* Make BERT comment more valuable

* Skip middle elements in long lists

* Typo in comment

* Stick with latest damsel and mg_proto for tests

* Fix damsel commit

* Replace hand made printable function with standard

* Check full string to avoid false positives

* Allow unicode strings

* Add comment

* Mark "broken" binary data as non-printable

* Fix lint
2019-08-26 12:00:47 +03:00
Sergei Shuvatov
a4921bde49
CDS-64: add options for SSL support (#103)
* Get rid of acceptors_pool_size environment variable
* Fix end_per_testcase/2 in the main test suite
2019-06-06 13:11:48 +03:00
Andrew Mayorov
7a57a10d02
Expose ranch transport opts (#79)
It will allow library users to tune things like number of max allowed concurrent connections.
2018-11-07 12:54:54 +03:00
Petr Kozorezov
996f6d5b2c
Task/mspf 374/woody caching (#73)
* add stale cache and joint workers

* add caching client

* add test, refactor code a little bit

* apply review fixes

* apply review fixes

* apply review fixes

* add caching client events

* apply review comments

* add thrift meta info to cache events

* update tests
2018-07-31 10:51:12 +03:00
Anton Belyaev
74fb666e87
MSPF-313: introduce deadlines (#62)
* introduce woody deadline
* refactor cowboy handler init checks order
  1. start with basic http checks
  2. proceed with woody related stuff
2018-01-30 12:50:18 +03:00
Anton Belyaev
992c279466 MSPF-224: fix error format in case of TApplicationException exception from server in 200 (#55) 2017-04-28 17:26:42 +03:00
Anton Belyaev
ac84da3d5b MSPF-108: transient errors implementation (#38)
* align rpc id handling with new requirements
* add new interface woody.erl, mv woody_t -> woody
* bump up thrift for the latest thrift_membuffer_transport
* remove woody:call_safe/3, woody_client:call_safe/3 from client API
* add cowboy net_opts to Server API
* Introduce event formatter to woody_event_handler
* Refactor events
* Remove outdated exception from the elvis rules
* Update woody_server_thrift_handler internal API
* make Opts optional for handlers
* add default event handler
* bump up hackney
* update README
* fix issues: 12, 18, 20, 21, 25, 26, 31, 37
2016-12-19 14:11:05 +03:00
Anton Belyaev
49f47a8b3d MSPF-61: switch to build utils and refactor (#17)
* start using build_utils
* simplify woody_client:result_ok() type (issue 10)
* use integer snowflake id
* rename woody_client_thrift:format_return/3 (issue 11)
* provide details to event_handler for http errors (issue 15)
* clarify net_opts() for woody_server_thrift_http_handler:options() type
* switch snoflake to rbkmoney fork
* update readme
* introduce lint and fix lint warnings
* add woody_client:make_id_int/0 API function
2016-08-26 19:15:48 +04:00