968743f61a
Fix compiler errors related to unused results
2019-02-01 12:31:53 +02:00
b18467e17e
Add direct mode to Worker::execute()
...
Sometimes that's what you want, but primarily for completeness'
sake and it makes AUTO more sensical as it essentially chooses
beteen DIRECT and QUEUED mode.
2019-01-31 10:04:55 +02:00
17fc2ba88a
Store error status into QueryResult object
...
The QueryResult-object remembers if a conversion failed. This makes checking
for errors more convenient, as just one check per row is required. The conversion
functions always return a valid value.
2019-01-22 15:34:19 +02:00
640bf40eed
MXS-2219 Make a non-URL async HTTP request READY
...
An asynchronous HTTP request for 0 URLs is immediately
in READY state.
2019-01-17 11:11:21 +02:00
a9fd9c92e2
MXS-2219 Add iterator adapter
...
Iterator adapter for making it possible to iterate over an
intrusive singly linked list in an STL fashion.
2019-01-17 11:11:21 +02:00
b4d91d4b9a
Move query result helper class to maxsql
...
Added some asserts to ensure the class is used correctly.
2019-01-14 10:43:17 +02:00
9823fe2651
MXS-2247 Add support for random number generation to maxutils
...
Classes for xorshift and std random. Add a random number generator to Worker.
2019-01-10 16:51:32 +02:00
839b9b781d
MXS-2219 Differentiate between READY and ERROR with http::Async
...
An async http operation that has not been initiated is READY,
while an operation that cannot be initated is ERRORed.
2019-01-07 12:59:27 +02:00
1fa0144b0b
Fix broken http test
2018-12-20 09:32:51 +02:00
910777efbc
MXS-2208 Address review comments
...
Also report errors in more detailed manner.
2018-12-18 15:16:45 +02:00
3eca3ff7dc
MXS-2208 Add init/finish functions for mxb::http
...
Init/finish needed, as curl otherwise will leak memory.
2018-12-18 15:16:45 +02:00
0d733bb1bb
MXS-2208 Implement synchronous GET in terms of asynch
2018-12-18 15:16:45 +02:00
847f53b21b
MXS-2208 Introduce asynchronous GET
...
A multi HTTP GET can now be performed so that the caller
drives the polling of results.
This can now be used so that inside a monitor worker, the delays
are handled using delayed calls. Consequently, the monitor worker
event loop can remain responsive even though the Clustrix nodes
are being polled.
2018-12-18 15:16:45 +02:00
38a0d6a2df
MXS-2208 If no sockets, then we use timeout
...
If no sockets, then we use timeout; not the other way around.
2018-12-18 15:16:45 +02:00
1d338f3c4a
MXS-2208 Add synchronous multi GET
...
Now possible to GET multiple URLs in one go. Behind the scenes
the getting is done asynchronously and in parallell.
2018-12-18 15:16:45 +02:00
da3742324a
MXS-2208 Now use trim() from maxbase
2018-12-18 15:16:45 +02:00
1b5b789342
MXS-2208 Move trim-functions from maxscale to maxbase
...
log.h now includes string.hh, which is conceptually wrong, but
log.h will shortly disappear and be superceded by log.hh.
2018-12-10 12:50:07 +02:00
8d77ddec63
MXS-2208 Add simple Http library
...
- Built on top of Curl
- Currently only GET
2018-12-05 12:48:42 +02:00
4dd2dad426
Fix maxsql dependencies
...
The connector-c was not declared as a dependency which caused parallel
builds to fail.
2018-12-04 14:00:34 +02:00
192562d930
MXS-2196: Don't force epoll flags
...
The epoll event flags are now fully controlled by the caller of the
Worker::add_fd function. This makes the mechanism more generic and allows
both edge triggered and level triggered behavior.
2018-12-04 11:50:43 +02:00
760f2ff34c
Move alloc.cc to maxbase
...
Only renames the functions. Macro names are left as is to keep the diff
small.
2018-12-03 10:20:45 +02:00
0c7e737eb7
Move some mysql/mariadb utilities to maxutils
...
Can be used in system tests later on.
2018-11-30 13:03:37 +02:00
a1e1ac0012
Move string_printf to maxbase
...
Can be used in tests.
2018-11-29 12:21:40 +02:00
e371964f8b
MXS-2057 Add log output for system test, and two random code fixes
2018-11-14 16:20:42 +02:00
ae1a062a58
MXS-2160 Use CLOCK_MONOTONIC_COARSE
...
We measure time in milliseconds and as CLOCK_MONOTONIC_COARSE
provides 1ms granularity we should use that since it is cheaper.
2018-11-13 16:44:30 +02:00
1108132cbd
MXS-2057 Do not require systemd libraries
...
Exclude systemd usage if the library is not installed.
Only excluding what is necessary. This keeps the object size the
same and still compiles most of the code.
2018-11-09 16:45:59 +02:00
f29e5b65de
MXS-2057 systemd watchdog
...
Systemd wathdog notification at a little more than 2/3 of the
systemd configured time. In the service config (maxscale.service)
add e.g. WatchdogSec=30s to set and enable the watchdog.
For building: install libsystemd-dev.
The next commit will modify cmake configuration and code to
conditionally compile the new code based on existence of libsystemd-dev.
2018-11-09 16:45:59 +02:00
c692c864e2
MXS-2078 Take new statistics into use
2018-11-08 10:44:32 +02:00
13a0390de6
MXS-2078 Add IntervalTimer
...
IntervalTimer is used for accumulating intervals (i.e. durations) over sections of code.
2018-11-08 10:44:32 +02:00
6dc038aa4e
MXS-2137 Remove meaningsless statistics
...
The removed statistics variables have no meaning anymore and
were not updated.
Decided to simply drop the variable from the JSON output. It
gets far too rigid if fields of objects cannot be changed without
bumping the REST-API version.
2018-11-06 09:49:25 +02:00
c45059f83d
Fix size formatting
...
The sizes were rounded up instead of down. This caused gigabyte sizes to
be shown in the terabyte range.
2018-10-20 14:33:42 +03:00
7d03bee648
Add type formatting helpers
...
Created the <maxbase/format.hh> header that contains various helper
functions for formatting values into human readable forms. Currently only
binary to human readable size conversion is implemented.
2018-10-19 11:20:29 +03:00
75ea1b6ea1
Fix formatting of new(std::nothrow)
...
The code previously formatted everything as `new( std::nothrow)`.
2018-10-04 21:50:44 +03:00
268e689dc5
Fix code for warnings: unused-but-set-variable and warn_unused_result.
2018-10-03 16:33:24 +03:00
75f9921ca2
Merge branch '2.2' into develop
2018-10-02 10:18:09 +03:00
c65edd1298
Enhance StopWatch
...
Clean up, comments and enhancements. StopWatch lap() didn't mean lap-time, but elapsed time. Changed meaning to lap-time and added split() for split-time.
2018-10-01 09:30:24 +03:00
df3d08b959
Remove spammy debug print
...
The code was ran even when nothing was really going on and constantly wrote
to the log.
2018-09-26 14:03:08 +03:00
1063b4a6be
Add missing cancel callback for delayed call.
...
And make the function a little neater.
2018-09-26 11:21:55 +03:00
5132339b7b
Fix race condition.
...
Change a counter (s_next_delayed_call_id) in Worker from class static to
class member to avoid race conditions on the variable.
2018-09-25 17:07:06 +03:00
6d82de811f
Relax Average value access memory ordering
...
As there are no requirements with regards to the visibility of writes to
the Average, the access can be relaxed.
2018-09-24 12:07:50 +03:00
a94081067f
Move Average into average.hh
...
Moved the class to a more appropriate place.
2018-09-24 12:07:49 +03:00
5ed3667f4a
Document average.hh
...
Add documentation for the average classes.
2018-09-24 12:07:49 +03:00
71ffef5708
Partially revert 4ba011266843857bbd3201e5b925a47e88e1808f
...
Add back leading operator enforcement.
2018-09-20 15:57:30 +03:00
2e069fa892
MXS-1632: Take mxb::atomic::add into use
...
The function now mostly replaces the use of atomic_add_ functions declared
in atomic.h.
2018-09-18 15:21:54 +03:00
4d792c3410
MXS-1632: Add C++ wrappers for __atomic builtins
...
Using the __atomic functions makes it easy to increment fundamental types
atomically without converting them to std::atomic<T>.
2018-09-18 15:21:54 +03:00
9b0f016aba
Fix minor formatting oversights
...
Code that was not formatted was merged into develop unformatted.
2018-09-12 08:58:15 +03:00
6938df0d62
Use default member initializers in WORKER_STATISTICS
...
Makes the class simpler and removes the need for an explicit
constructor. Also switched to std::array to enable easy iteration over the
array.
2018-09-10 14:15:10 +03:00
94a567f4ca
Remove redundant Worker method
...
The Worker::get_local_statistics was a duplicate of Worker::statistics.
2018-09-10 14:14:21 +03:00
108638b0cf
Format with Uncrustify 0.67
2018-09-10 13:31:39 +03:00
d11c78ad80
Format all sources with Uncrustify
...
Formatted all sources and manually tuned some files to make the code look
neater.
2018-09-10 13:22:49 +03:00