- Mar 19, 2019
-
-
David Douard authored
- ensure we do accept **kwargs so any super().__init__(**kwargs) from an unexpected MRO path in an indecent maze of multi-inheritance will not crash - do not call super().__init__(); it is either useless (most probably, super() is object in this context) or silently ignore passed kwargs that super() (when it's not object) may have been able to understand... Long story short, kwargs handling in multi-inheritance __init__ methods is a mess.
-
David Douard authored
- merge raw_post and row_get in a unique raw_verb method, - merge post_stream() and post() as a unique post(); post_strean is then a call to post with the 'stream' parameter set, - merge get_stream() and get() the same.
-
David Douard authored
so the pytest-postgresql fixture works as expected on non C locale systems.
-
- Mar 18, 2019
-
-
David Douard authored
we almost never return text/plain or text/html, so json is a better default value.
-
David Douard authored
for debugging purpose.
-
David Douard authored
-
- Feb 28, 2019
-
-
vlorentz authored
-
- Feb 19, 2019
-
- Feb 11, 2019
- Feb 07, 2019
-
- Feb 01, 2019
-
-
David Douard authored
this will take precedence over the implicit config file scheme. Related to T1410 and T826
-
vlorentz authored
`entry_to_bytes` and its friends were called many times (eg. entry_to_bytes alone was called 40k times while indexing 500 origins with the metadata indexer), and its use of `isinstance` used a non-negligible amount of CPU time. Instead of using `*_to_bytes` function as post-processing on all bits of data returned by postgresql, this patch tells psycopg2 to use a new `typecast_bytea` function when needed (in `adapt_conn`). This function deffers the decoding work to psycopg2, which returns a `memoryview`, which is turned into `bytes`.
-
David Douard authored
to keep the copy_to API bw compatible.
-
David Douard authored
This needs tests!
-
- Jan 31, 2019
-
-
David Douard authored
so thath it does not fail if no payload at all is provided in the request, eg. for an endpoint which really is (or at least should be) a simple GET...
-
David Douard authored
just to make our life a bit easier...
-
- Jan 30, 2019
-
-
David Douard authored
so one can use this method with default values for some columns. This is used for example in scheduler.
-
- Jan 29, 2019
-
-
David Douard authored
it is not a 'private' method. Add a _cursor alias for bw compat.
-
David Douard authored
There is no need for it to be declared there: it does not use any closure and defining a function in a function is expensive!
-
David Douard authored
so that we do have to manage yet another dependecy; the code is small and has not been modified for years.
-
David Douard authored
-
David Douard authored
that recursively merge 2 (config) dictionaries. This is meant to be used to simplify a bit the config system of several systems of the swh platform (related to T1410 and T826).
-
- Jan 28, 2019
-
-
David Douard authored
-
David Douard authored
and raise logging level when loading a config file to info.
-
- Jan 24, 2019
-
-
David Douard authored
This class is meant to be used not only to wrap storage-like db. Also rewrite the test_logger using pytest-postgresql fixture so we do not need pifpaf anymore.
-
- Jan 23, 2019
-
-
David Douard authored
Using these 2 negotiate formatters, it is possible to write Flask endpoints as: from flask import Flask from negotiate.flask import negotiate from swh.core.api import JSONFormatter, MshpackFormatter app = Flask() @app.route('/somewhere') @negotiate(MsgpackFormatter) @negotiate(JSONFormatter) def somewhere(): return {'some': 'content'} See https://github.com/nickstenning/negotiate
-
- Jan 09, 2019
-
- Dec 21, 2018
-
-
Nicolas Dandrimont authored
prometheus-statsd-exporter uses the datadog format for its tags, so base our client on their Python code, with the following modifications: - Removed python < 3.5 compat code - trimmed the imports down to be a single module - move to time.monotonic() instead of time.time() - adjust some options: - drop unix socket connection option - add environment variable support for setting the statsd host and port (pulled the idea from the main python statsd module) - only send timer metrics in milliseconds (that's what prometheus-statsd-exporter expects) - drop DataDog-specific metric types (that are unsupported in prometheus-statsd-exporter) - made the tags a dict instead of a list (prometheus-statsd-exporter only supports tags with a value, mirroring prometheus) - improve unit test coverage - documentation cleanup
-
- Dec 17, 2018
-
- Dec 14, 2018
-
-
Antoine R. Dumont authored
Related D816?id=2603#inline-4587
-
Antoine R. Dumont authored
-
Antoine R. Dumont authored
-
Antoine R. Dumont authored
-
Antoine R. Dumont authored
The first time, the db will be initialized. The next time this is called, this will do nothing.
-
Antoine R. Dumont authored
-
- Dec 13, 2018
-
-
Antoine R. Dumont authored