Coder Social home page Coder Social logo

badoo / pinba2 Goto Github PK

View Code? Open in Web Editor NEW
130.0 11.0 18.0 1.45 MB

Pinba2: new implementation of https://github.com/tony2001/pinba_engine

License: BSD 3-Clause "New" or "Revised" License

Makefile 0.51% Shell 4.84% M4 2.07% C++ 72.01% C 17.92% PHP 2.35% Dockerfile 0.31%
pinba mysql mariadb stats timeseries

pinba2's Introduction

Pinba2

An attempt to rethink internal implementation and some features of excellent https://github.com/tony2001/pinba_engine by @tony2001.

Pinba (PHP Is Not A Bottleneck Anymore) is a statistics server using MySQL as an interface.

It accumulates and processes data sent over UDP and displays statistics in human-readable form of simple "reports" (like what are my slowest scripts or sql queries). This is not limited to PHP, there are clients for multiple languages and nginx module.

Key differences from original implementation

  • no raw data tables (i.e. requests, timers) support, yet (can be implemented)
    • raw data tables have VERY high memory usage requirements and uses are limited
  • simpler, more flexible report configuration
    • all use cases from original pinba are covered by only 3 kinds of reports (of which you mostly need one: timer)
    • simple aggregation keys specification, can mix different types, i.e. ~script,~server,+request_tag,@timer_tag
      • supports 15 keys max at the moment (never seen anyone using more than 5 anyway)
      • performance does not degrade when adding more keys to reports
    • more options can be configured per report now
      • stats gathering history: i.e. some reports can aggregate over 60sec, while others - over 300sec, as needed
      • histograms+percentiles: some reports might need very detailed histograms, while others - coarse
  • simpler to maintain
    • no 'pools' to configure, aka no re-configuration is required when traffic grows
    • no limits on tag name/value sizes (but keep it reasonable)
  • aggregation performance improved, reduced cpu/memory usage
    • currently handles ~72k simple packets/sec (~200mbps) with 5 medium-complexity reports (4 keys aggregation) @ ~40% overall cpu usage
    • handles up to 1.4 million packets/sec (~3 gbps) on internal setups on commodity hardware from 2015
    • uses significantly less memory (orders of magnitude) for common cases, since we don't store raw requests by default
    • current goal is to be able to handle 10gpbs of incoming traffic with hundreds of reports
  • select performance - might be slower
    • selects from complex reports never slow down new data aggregation
    • selects in general will be slower for complex reports with thousands of rows and high percision percentiles
      • select * from 30k rows report without percentiles takes at least ~200 milliseconds or so
      • with percentiles (say histogram with 10k entries) - will add ~300ms to that
  • misc
    • traffic and memory_footprint are measured in bytes (original pinba truncates to kilobytes)
    • raw histogram data is available as an extra field in existing report (not as a separate table)

Client libraries

Same client libraries can be used with this pinba implementation

list from http://pinba.org/

Migrating from original Pinba

We've got some scripts to help in scripts directory. Convert mysqldump of your old tables to new format with this script.

More Info

Docker

Fedora 25

Dockerfile

Basics

Requests

We get these over UDP, each request contains metrics data gathered by your application (like serving pages to users, or performing db queries).

Data comes in three forms

  • request fields (these are predefined and hardcoded since the dawn of original pinba)
    • host_name: name of the physical host (like "subdomain.mycoolserver.localnetwork")
    • script_name: name of the script
    • server_name: name of the logical host (like "example.com")
    • schema: usually "http" or "https"
    • status: usually http status (this one is 32-bit integer)
    • request_time: wall-clock time it took to execute the whole request
    • rusage_user: rusage in user space for this request
    • rusage_system: rusage in kernel space for this request
    • document_size: size of result doc
    • memory_footprint: amount of memory used
  • request tags - this is just a bunch of key -> value pairs attached to request as a whole
    • ex. in pseudocode [ 'application' -> 'my_cool_app', 'environment' -> 'production' ]
  • timers - a bunch is sub-action measurements, for example: time it took to execute some db query, or process some user input.
    • number of timers is not limited, track all db/memcached queries
    • each timer can also have tags!
      • ex. [ 'group' -> 'db', 'server' -> 'db1.lan', 'op_type' -> 'update' ]
      • ex. [ 'group' -> 'memcache', 'server' -> 'mmc1.lan', 'op_type' -> 'get' ]

Reports

Report is a read-only view of incoming data, aggregated within specified time window. One can think of it as a table of key/value pairs: Aggregation_key value -> Aggregated_data + Percentiles.

  • Aggregation_key - configured when report is created.
    • key names are set by the user, values for those keys are taken from requests for aggregation
    • key name is a combination of
      • request fields: ~host, ~script, ~server, ~schema, ~status
      • request tags: +whatever_name_you_want
      • timer tags: @some_timer_tag_name
  • Aggregation_key value - is the set of values, corresponding to key names set in Aggregation_key
    • ex. if Aggregation_key is ~host, there'll be a key/value pair per unique host we see in request stream
    • ex. if Aggregation_key is ~host,+req_tag, there'll be a key/value pair per unique [host, req_tag_value] pair
  • Aggregated_data is report-specific (i.e. a structure with fields like: req_count, hit_count, total_time, etc.).
  • Percentiles is a bunch of fields with specific percentiles, calculated over data from request_time or timer_value
  • Histogram is a field where engine exports raw histogram data (that we calculate percentiles from) in text form

There are 3 kinds of reports: packet, request, timer. The difference between those boils down to

  • How Aggregation_key values-s are extracted and matched
  • How Aggregated_data is populated (i.e. if you aggregate on request tags, there is no need/way to aggregate timer data)
  • What value we use for Histogram and Percentiles

SQL tables

Reports are exposed to the user as SQL tables.

All report tables have same simple structure

  • Aggregation_key, one table field per key part (i.e. ~script,~host,@timer_tag needs 3 fields with appropriate types)
  • Aggregated_data, 3 fields per data field (field_value, field_value_per_sec, field_value_percent) (i.e. request report needs 7*3 fields = 21 data fields)
  • Percentiles, one field per configured percentile (optional)
  • Histogram, one text field for raw histogram data that percentiles are calculated from (optional)

ASCII art!

                          ----------------           -------------------------------------------------------------
                          | key -> value |           | key_part_1 | ... | data_part_1 | ... | percentile_1 | ... |
------------              ----------------           -------------------------------------------------------------
| Requests |  aggregate>  |  .........   |  select>  |    ...................................................    |
------------              ----------------           -------------------------------------------------------------
                          | key -> value |           | key_part_1 | ... | data_part_1 | ... | percentile_1 | ... |
                          ----------------           -------------------------------------------------------------

SQL table comments

All pinba tables are created with sql comment to tell the engine about table purpose and structure, general syntax for comment is as follows (not all reports use all the fields).

> COMMENT='v2/<report_type>/<aggregation_window>/<keys>/<histogram+percentiles>/<filters>';

Take a look at examples first

  • <aggregation_window>: time window we aggregate data in. values are
    • 'default_history_time' to use global setting (= 60 seconds)
    • (number of seconds) - whatever you want >0
  • <keys>: keys we aggregate incoming data on
    • 'no_keys': key based aggregation not needed / not supported (packet report only)
    • <key_spec>[,<key_spec>[,...]]
      • ~field_name: any of 'host', 'script', 'server', 'schema'
      • +request_tag_name: use this request tag's value as key
      • @timer_tag_name: use this timer tag's value as key (timer reports only)
    • example: '~host,~script,+application,@group,@server'
      • will aggregate on 5 keys
      • 'host_name', 'script_name' global fields, 'application' request tag, plus 'group' and 'server' timer tag values
  • <histogram+percentiles>: histogram time and percentiles definition
    • 'no_percentiles': disable
    • syntax: 'hv=<min_time_ms>:<max_time_ms>:<bucket_count>,<percentiles>'
      • <percentiles>=p<double>[,p<double>[...]]
      • (alt syntax) <percentiles>='percentiles='<double>[:<double>[...]]
    • example: 'hv=0:2000:20000,p99,p99.9,p100'
      • this uses histogram for time range [0,2000) millseconds, with 20000 buckets, so each bucket is 0.1 ms 'wide'
      • also adds 3 percentiles to report 99th, 99.9th and 100th, percentile calculation precision is 0.1ms given above
      • uses 'request_time' (for packet/request reports) or 'timer_value' (for timer reports) from incoming packets for percentiles calculation
    • example (alt syntax): 'hv=0:2000:20000,percentiles=99:99.9:100'
      • same effect as above
  • <filters>: accept only packets maching these filters into this report
    • to disable: put 'no_filters' here, report will accept all packets
    • any of (separate with commas):
      • 'min_time=<milliseconds>'
      • 'max_time=<milliseconds>'
      • '<tag_spec>=<value>' - check that packet has fields, request or timer tags with given values and accept only those
    • <tag_spec> is the same as <key_spec> above, i.e. ~request_field,+request_tag,@timer_tag
    • example: min_time=0,max_time=1000,+browser=chrome
      • will accept only requests with request_time in range [0, 1000)ms with request tag 'browser' present and value 'chrome'
      • there is currently no way to filter timers by their timer_value, can't think of a use case really

User-defined reports

Packet report (like info in tony2001/pinba_engine)

General information about incoming packets

  • just aggregates everything into single item (mostly used to gauge general traffic)
  • Aggregation_key is always empty
  • Aggregated_data is global packet totals: { req_count, timer_count, hit_count, total_time, ru_utime, ru_stime, traffic, memory_footprint }
  • Histogram and Percentiles are calculated from data in request_time field

Table comment syntax

> 'v2/packet/<aggregation_window>/no_keys/<histogram+percentiles>/<filters>';

Example

mysql> CREATE TABLE `info` (
      `req_count` bigint(20) unsigned NOT NULL,
      `timer_count` bigint(20) unsigned NOT NULL,
      `time_total` double NOT NULL,
      `ru_utime_total` double NOT NULL,
      `ru_stime_total` double NOT NULL,
      `traffic` bigint(20) unsigned NOT NULL,
      `memory_footprint` bigint(20) unsigned NOT NULL
    ) ENGINE=PINBA DEFAULT CHARSET=latin1 COMMENT='v2/packet/default_history_time/no_keys/no_percentiles/no_filters'

mysql> select * from info;
+-----------+-------------+-------------------+------------------+-----------------+-----------+------------------+
| req_count | timer_count | time_total        | ru_utime_total   | ru_stime_total  | traffic   | memory_footprint |
+-----------+-------------+-------------------+------------------+-----------------+-----------+------------------+
|   3940547 |    59017168 | 6982620.849607239 | 128279.101920963 | 18963.268457099 | 141734072 |  317514981871616 |
+-----------+-------------+-------------------+------------------+-----------------+-----------+------------------+
1 row in set (0.00 sec)

Request data report

  • aggregates at request level, never touching timers at all
  • Aggregation_key is a combination of request_field (host, script, etc.) and request_tags (must NOT have timer_tag keys)
  • Aggregated_data is request-based
    • req_count, req_time_total, req_ru_utime, req_ru_stime, traffic_kb, mem_usage
  • Histogram and Percentiles are calculated from data in request_time field

Table comment syntax

> 'v2/packet/<aggregation_window>/<key_spec>/<histogram+percentiles>/<filters>';

example (report by script name only here)

mysql> CREATE TABLE `report_by_script_name` (
        `script` varchar(64) NOT NULL,
        `req_count` int(10) unsigned NOT NULL,
        `req_per_sec` float NOT NULL,
        `req_percent` float,
        `req_time_total` float NOT NULL,
        `req_time_per_sec` float NOT NULL,
        `req_time_percent` float,
        `ru_utime_total` float NOT NULL,
        `ru_utime_per_sec` float NOT NULL,
        `ru_utime_percent` float,
        `ru_stime_total` float NOT NULL,
        `ru_stime_per_sec` float NOT NULL,
        `ru_stime_percent` float,
        `traffic_total` bigint(20) unsigned NOT NULL,
        `traffic_per_sec` float NOT NULL,
        `traffic_percent` float,
        `memory_footprint` bigint(20) NOT NULL,
        `memory_per_sec` float NOT NULL,
        `memory_percent` float
        ) ENGINE=PINBA DEFAULT CHARSET=latin1 COMMENT='v2/request/60/~script/no_percentiles/no_filters';

mysql> select * from report_by_script_name; -- skipped some fields for brevity
+----------------+-----------+-------------+----------------+------------------+----------------+------------------+-----------------+------------------+
| script         | req_count | req_per_sec | req_time_total | req_time_per_sec | ru_utime_total | ru_stime_per_sec | traffic_per_sec | memory_footprint |
+----------------+-----------+-------------+----------------+------------------+----------------+------------------+-----------------+------------------+
| script-0.phtml |    200001 |     3333.35 |        200.001 |          3.33335 |              0 |                0 |               0 |                0 |
| script-6.phtml |    200000 |     3333.33 |            200 |          3.33333 |              0 |                0 |               0 |                0 |
| script-3.phtml |    200000 |     3333.33 |            200 |          3.33333 |              0 |                0 |               0 |                0 |
| script-5.phtml |    200000 |     3333.33 |            200 |          3.33333 |              0 |                0 |               0 |                0 |
| script-4.phtml |    200000 |     3333.33 |            200 |          3.33333 |              0 |                0 |               0 |                0 |
| script-8.phtml |    200000 |     3333.33 |            200 |          3.33333 |              0 |                0 |               0 |                0 |
| script-9.phtml |    200000 |     3333.33 |            200 |          3.33333 |              0 |                0 |               0 |                0 |
| script-1.phtml |    200001 |     3333.35 |        200.001 |          3.33335 |              0 |                0 |               0 |                0 |
| script-2.phtml |    200000 |     3333.33 |            200 |          3.33333 |              0 |                0 |               0 |                0 |
| script-7.phtml |    200000 |     3333.33 |            200 |          3.33333 |              0 |                0 |               0 |                0 |
+----------------+-----------+-------------+----------------+------------------+----------------+------------------+-----------------+------------------+
10 rows in set (0.00 sec)

Timer data report

This is the one you need for 95% uses

  • aggregates at request + timer levels
  • Aggregation_key is a combination of request_field (host, script, etc.), request_tags and timer_tags (must have at least one timer_tag key)
  • Aggregated_data is timer-based (aka taken from timer data)
    • req_count, timer_hit_count, timer_time_total, timer_ru_utime, timer_ru_stime
  • Histogram and Percentiles are calculated from data in timer_value

Table comment syntax

> 'v2/packet/<aggregation_window>/<key_spec>/<histogram+percentiles>/<filters>';

example (some complex report)

mysql> CREATE TABLE `tag_info_pinger_call_from_wwwbmamlan` (
      `pinger_dst_cluster` varchar(64) NOT NULL,
      `pinger_src_host` varchar(64) NOT NULL,
      `pinger_dst_host` varchar(64) NOT NULL,
      `req_count` int(11) NOT NULL,
      `req_per_sec` float NOT NULL,
      `req_percent` float,
      `hit_count` int(11) NOT NULL,
      `hit_per_sec` float NOT NULL,
      `hit_percent` float,
      `time_total` float NOT NULL,
      `time_per_sec` float NOT NULL,
      `time_percent` float,
      `ru_utime_total` float NOT NULL,
      `ru_utime_per_sec` float NOT NULL,
      `ru_utime_percent` float,
      `ru_stime_total` float NOT NULL,
      `ru_stime_per_sec` float NOT NULL,
      `ru_stime_percent` float,
      `p50` float NOT NULL,
      `p75` float NOT NULL,
      `p95` float NOT NULL,
      `p99` float NOT NULL,
      `p100` float NOT NULL,
      `histogram_data` text NOT NULL
    ) ENGINE=PINBA DEFAULT CHARSET=latin1
      COMMENT='v2/timer/60/@pinger_dst_cluster,@pinger_src_host,@pinger_dst_host/hv=0:1000:100000,p50,p75,p95,p99,p100/+pinger_phase=call,+pinger_src_cluster=wwwbma.mlan';

example (grouped by host_name, script_name, server_name and value timer tag "tag10")

mysql> CREATE TABLE `report_host_script_server_tag10` (
      `host` varchar(64) NOT NULL,
      `script` varchar(64) NOT NULL,
      `server` varchar(64) NOT NULL,
      `tag10` varchar(64) NOT NULL,
      `req_count` int(10) unsigned NOT NULL,
      `req_per_sec` float NOT NULL,
      `hit_count` int(10) unsigned NOT NULL,
      `hit_per_sec` float NOT NULL,
      `time_total` float NOT NULL,
      `time_per_sec` float NOT NULL,
      `ru_utime_total` float NOT NULL,
      `ru_utime_per_sec` float NOT NULL,
      `ru_stime_total` float NOT NULL,
      `ru_stime_per_sec` float NOT NULL
    ) ENGINE=PINBA DEFAULT CHARSET=latin1
      COMMENT='v2/timer/60/~host,~script,~server,@tag10/no_percentiles/no_filters';

mysql> select * from report_host_script_server_tag10; -- skipped some fields for brevity
+-----------+----------------+-------------+-----------+-----------+-----------+------------+----------------+----------------+
| host      | script         | server      | tag10     | req_count | hit_count | time_total | ru_utime_total | ru_stime_total |
+-----------+----------------+-------------+-----------+-----------+-----------+------------+----------------+----------------+
| localhost | script-3.phtml | antoxa-test | select    |       806 |       806 |      5.642 |              0 |              0 |
| localhost | script-6.phtml | antoxa-test | select    |       805 |       805 |      5.635 |              0 |              0 |
| localhost | script-0.phtml | antoxa-test | something |       800 |       800 |         12 |              0 |              0 |
| localhost | script-1.phtml | antoxa-test | select    |       804 |       804 |      5.628 |              0 |              0 |
| localhost | script-2.phtml | antoxa-test | something |       797 |       797 |     11.955 |              0 |              0 |
| localhost | script-8.phtml | antoxa-test | select    |       803 |       803 |      5.621 |              0 |              0 |
| localhost | script-6.phtml | antoxa-test | something |       805 |       805 |     12.075 |              0 |              0 |
| localhost | script-4.phtml | antoxa-test | select    |       798 |       798 |      5.586 |              0 |              0 |
| localhost | script-4.phtml | antoxa-test | something |       798 |       798 |      11.97 |              0 |              0 |
| localhost | script-3.phtml | antoxa-test | something |       806 |       806 |      12.09 |              0 |              0 |
| localhost | script-1.phtml | antoxa-test | something |       804 |       804 |      12.06 |              0 |              0 |
| localhost | script-2.phtml | antoxa-test | select    |       797 |       797 |      5.579 |              0 |              0 |
| localhost | script-9.phtml | antoxa-test | something |       806 |       806 |      12.09 |              0 |              0 |
| localhost | script-7.phtml | antoxa-test | select    |       801 |       801 |      5.607 |              0 |              0 |
| localhost | script-5.phtml | antoxa-test | select    |       802 |       802 |      5.614 |              0 |              0 |
| localhost | script-5.phtml | antoxa-test | something |       802 |       802 |      12.03 |              0 |              0 |
| localhost | script-9.phtml | antoxa-test | select    |       806 |       806 |      5.642 |              0 |              0 |
| localhost | script-0.phtml | antoxa-test | select    |       800 |       800 |        5.6 |              0 |              0 |
| localhost | script-8.phtml | antoxa-test | something |       803 |       803 |     12.045 |              0 |              0 |
| localhost | script-7.phtml | antoxa-test | something |       801 |       801 |     12.015 |              0 |              0 |
+-----------+----------------+-------------+-----------+-----------+-----------+------------+----------------+----------------+

System Reports

Active reports information table

This table lists all reports known to the engine with additional information about them.

Field Description
id internal id, useful for matching reports with system threads. report calls pthread_setname_np("rh/[id]")
table_name mysql fully qualified table name (including database)
internal_name the name known to the engine (it never changes with table renames, but you shouldn't really care about that).
kind internal report kind (one of the kinds described in this doc, like stats, active, etc.)
uptime time since report creation (seconds)
time_window time window this reports aggregates data for (that you specify when creating a table)
tick_count number of ticks, time_window is split into
approx_row_count approximate row count
approx_mem_used approximate memory usage
batches_sent number of packet batches sent from coordinator to report thread
batches_received number of packet batches received by report thread (if you have != 0 here, you're losing batches and packets)
packets_received packets received and processed
packets_lost packets that could not be processed and had to be dropped (aka, report couldn't cope with such packet rate)
packets_aggregated number of packets that we took useful information from
packets_dropped_by_bloom number of packets dropped by packet-level bloom filter
packets_dropped_by_filters number of packets dropped by packet-level filters
packets_dropped_by_rfield number of packets dropped by request_field aggregation
packets_dropped_by_rtag number of packets dropped by request_tag aggregation
packets_dropped_by_timertag number of packets dropped by timer_tag aggregation (i.e. no useful timers)
timers_scanned number of timers scanned
timers_aggregated number of timers that we took useful information from
timers_skipped_by_bloom number of timers skipped by timer-level bloom filter
timers_skipped_by_filters number of timers skipped by timertag filters
timers_skipped_by_tags number of timers skipped by not having required tags present
ru_utime rusage: user time
ru_stime rusage: system time
last_tick_time time we last merged temporary data to selectable data
last_tick_prepare_duration time it took to prepare to merge temp data to selectable data
last_snapshot_merge_duration time it took to prepare last select (not implemented yet)

Table comment syntax

> 'v2/active'

example

mysql> CREATE TABLE IF NOT EXISTS `pinba`.`active` (
      `id` int(10) unsigned NOT NULL,
      `table_name` varchar(128) NOT NULL,
      `internal_name` varchar(128) NOT NULL,
      `kind` varchar(64) NOT NULL,
      `uptime` double unsigned NOT NULL,
      `time_window_sec` int(10) unsigned NOT NULL,
      `tick_count` int(10) NOT NULL,
      `approx_row_count` int(10) unsigned NOT NULL,
      `approx_mem_used` bigint(20) unsigned NOT NULL,
      `batches_sent` bigint(20) unsigned NOT NULL,
      `batches_received` bigint(20) unsigned NOT NULL,
      `packets_received` bigint(20) unsigned NOT NULL,
      `packets_lost` bigint(20) unsigned NOT NULL,
      `packets_aggregated` bigint(20) unsigned NOT NULL,
      `packets_dropped_by_bloom` bigint(20) unsigned NOT NULL,
      `packets_dropped_by_filters` bigint(20) unsigned NOT NULL,
      `packets_dropped_by_rfield` bigint(20) unsigned NOT NULL,
      `packets_dropped_by_rtag` bigint(20) unsigned NOT NULL,
      `packets_dropped_by_timertag` bigint(20) unsigned NOT NULL,
      `timers_scanned` bigint(20) unsigned NOT NULL,
      `timers_aggregated` bigint(20) unsigned NOT NULL,
      `timers_skipped_by_bloom` bigint(20) unsigned NOT NULL,
      `timers_skipped_by_filters` bigint(20) unsigned NOT NULL,
      `timers_skipped_by_tags` bigint(20) unsigned NOT NULL,
      `ru_utime` double NOT NULL,
      `ru_stime` double NOT NULL,
      `last_tick_time` double NOT NULL,
      `last_tick_prepare_duration` double NOT NULL,
      `last_snapshot_merge_duration` double NOT NULL
    ) ENGINE=PINBA DEFAULT CHARSET=latin1 COMMENT='v2/active';


mysql> select *, packets_received/uptime as packets_per_sec, timers_scanned/uptime as timers_per_sec, ru_utime/uptime utime_per_sec from active\G
*************************** 1. row ***************************
                          id: 1
                  table_name: ./pinba/tag_report_perf___10us
               internal_name: ./pinba/tag_report_perf___10us
                        kind: report_by_timer_data
                      uptime: 2316.135996475
             time_window_sec: 60
                  tick_count: 60
            approx_row_count: 10830
             approx_mem_used: 117561688
                batches_sent: 185186
            batches_received: 185186
            packets_received: 38144533
                packets_lost: 0
          packets_aggregated: 6634543
    packets_dropped_by_bloom: 31509990
  packets_dropped_by_filters: 0
   packets_dropped_by_rfield: 0
     packets_dropped_by_rtag: 0
 packets_dropped_by_timertag: 0
              timers_scanned: 1455859105
           timers_aggregated: 1097993658
     timers_skipped_by_bloom: 357865447
   timers_skipped_by_filters: 0
      timers_skipped_by_tags: 0
                    ru_utime: 182.947086
                    ru_stime: 4.105066
              last_tick_time: 1525363484.9716723
  last_tick_prepare_duration: 0.006995009000000001
last_snapshot_merge_duration: 0.000000266
             packets_per_sec: 16469.038544391762      // 16.5k packets/sec
              timers_per_sec: 628896.7355846566       // 628k timers/sec, ~38 timers/packet
               utime_per_sec: 0.0789880586798154      // at ~8% cpu!
1 row in set (0.01 sec)

Stats (see also: status variables)

This table contains internal stats, useful for monitoring/debugging/performance tuning.

Table comment syntax

> 'v2/stats'

example

mysql> CREATE TABLE IF NOT EXISTS `stats` (
      `uptime` DOUBLE NOT NULL,
      `ru_utime` DOUBLE NOT NULL,
      `ru_stime` DOUBLE NOT NULL,
      `udp_poll_total` BIGINT(20) UNSIGNED NOT NULL,
      `udp_recv_total` BIGINT(20) UNSIGNED NOT NULL,
      `udp_recv_eagain` BIGINT(20) UNSIGNED NOT NULL,
      `udp_recv_bytes` BIGINT(20) UNSIGNED NOT NULL,
      `udp_recv_packets` BIGINT(20) UNSIGNED NOT NULL,
      `udp_packet_decode_err` BIGINT(20) UNSIGNED NOT NULL,
      `udp_batch_send_total` BIGINT(20) UNSIGNED NOT NULL,
      `udp_batch_send_err` BIGINT(20) UNSIGNED NOT NULL,
      `udp_packet_send_total` BIGINT(20) UNSIGNED NOT NULL,
      `udp_packet_send_err` BIGINT(20) UNSIGNED NOT NULL,
      `udp_ru_utime` DOUBLE NOT NULL,
      `udp_ru_stime` DOUBLE NOT NULL,
      `repacker_poll_total` BIGINT(20) UNSIGNED NOT NULL,
      `repacker_recv_total` BIGINT(20) UNSIGNED NOT NULL,
      `repacker_recv_eagain` BIGINT(20) UNSIGNED NOT NULL,
      `repacker_recv_packets` BIGINT(20) UNSIGNED NOT NULL,
      `repacker_packet_validate_err` BIGINT(20) UNSIGNED NOT NULL,
      `repacker_batch_send_total` BIGINT(20) UNSIGNED NOT NULL,
      `repacker_batch_send_by_timer` BIGINT(20) UNSIGNED NOT NULL,
      `repacker_batch_send_by_size` BIGINT(20) UNSIGNED NOT NULL,
      `repacker_ru_utime` DOUBLE NOT NULL,
      `repacker_ru_stime` DOUBLE NOT NULL,
      `coordinator_batches_received` BIGINT(20) UNSIGNED NOT NULL,
      `coordinator_batch_send_total` BIGINT(20) UNSIGNED NOT NULL,
      `coordinator_batch_send_err` BIGINT(20) UNSIGNED NOT NULL,
      `coordinator_control_requests` BIGINT(20) UNSIGNED NOT NULL,
      `coordinator_ru_utime` DOUBLE NOT NULL,
      `coordinator_ru_stime` DOUBLE NOT NULL,
      `dictionary_size` BIGINT(20) UNSIGNED NOT NULL,
      `dictionary_mem_hash` BIGINT(20) UNSIGNED NOT NULL,
      `dictionary_mem_list` BIGINT(20) UNSIGNED NOT NULL,
      `dictionary_mem_strings` BIGINT(20) UNSIGNED NOT NULL,
      `version_info` text(1024) NOT NULL,
      `build_string` text(1024) NOT NULL
    ) ENGINE=PINBA DEFAULT CHARSET=latin1 COMMENT='v2/stats';
mysql> select *, (repacker_ru_utime/uptime) as repacker_ru_utime_per_sec from stats\G
*************************** 1. row ***************************
                      uptime: 12.482723834
                    ru_utime: 2.248
                    ru_stime: 1.12
              udp_poll_total: 20924
              udp_recv_total: 49753
             udp_recv_eagain: 20904
              udp_recv_bytes: 192375675
            udp_recv_packets: 870451
       udp_packet_decode_err: 0
        udp_batch_send_total: 20915
          udp_batch_send_err: 0
       udp_packet_send_total: 870451
         udp_packet_send_err: 0
                udp_ru_utime: 0.8680000000000001
                udp_ru_stime: 0.8240000000000001
         repacker_poll_total: 20948
         repacker_recv_total: 41827
        repacker_recv_eagain: 20912
       repacker_recv_packets: 870451
repacker_packet_validate_err: 0
   repacker_batch_send_total: 849
repacker_batch_send_by_timer: 0
 repacker_batch_send_by_size: 849
           repacker_ru_utime: 1.1720000000000002
           repacker_ru_stime: 0.07200000000000001
coordinator_batches_received: 849
coordinator_batch_send_total: 0
  coordinator_batch_send_err: 0
coordinator_control_requests: 0
        coordinator_ru_utime: 0.032
        coordinator_ru_stime: 0
             dictionary_size: 444
         dictionary_mem_hash: 6311251
         dictionary_mem_list: 14208
      dictionary_mem_strings: 5587
                version_info: pinba 2.0.8, git: 1afd7eb872a6ef95e34efbbe730aea3926489798, modified: 1
                build_string: whatever-string-from-configure

Status Variables

Same values as in stats table, but 'built-in' (no need to create the table), but uglier to use in selects.

Example (all vars)

mysql> show status where Variable_name like 'Pinba%';
+------------------------------------+-----------+
| Variable_name                      | Value     |
+------------------------------------+-----------+
| Pinba_uptime                       | 30.312758 |
| Pinba_udp_poll_total               | 99344     |
| Pinba_udp_recv_total               | 227735    |
| Pinba_udp_recv_eagain              | 99299     |
| Pinba_udp_recv_bytes               | 367344280 |
| Pinba_udp_recv_packets             | 1642299   |
| Pinba_udp_packet_decode_err        | 0         |
| Pinba_udp_batch_send_total         | 94382     |
| Pinba_udp_batch_send_err           | 0         |
| Pinba_udp_ru_utime                 | 24.052000 |
| Pinba_udp_ru_stime                 | 32.820000 |
| Pinba_repacker_poll_total          | 94711     |
| Pinba_repacker_recv_total          | 188709    |
| Pinba_repacker_recv_eagain         | 94327     |
| Pinba_repacker_recv_packets        | 1642299   |
| Pinba_repacker_packet_validate_err | 0         |
| Pinba_repacker_batch_send_total    | 1622      |
| Pinba_repacker_batch_send_by_timer | 189       |
| Pinba_repacker_batch_send_by_size  | 1433      |
| Pinba_repacker_ru_utime            | 59.148000 |
| Pinba_repacker_ru_stime            | 23.564000 |
| Pinba_coordinator_batches_received | 1622      |
| Pinba_coordinator_batch_send_total | 1104      |
| Pinba_coordinator_batch_send_err   | 0         |
| Pinba_coordinator_control_requests | 9         |
| Pinba_coordinator_ru_utime         | 0.040000  |
| Pinba_coordinator_ru_stime         | 0.032000  |
| Pinba_dictionary_size              | 364       |
| Pinba_dictionary_mem_used          | 6303104   |
+------------------------------------+-----------+
29 rows in set (0.00 sec)

Example (var combo)

mysql> select
    (select VARIABLE_VALUE from information_schema.global_status where VARIABLE_NAME='PINBA_UDP_RECV_PACKETS')
    / (select VARIABLE_VALUE from information_schema.global_status where VARIABLE_NAME='PINBA_UPTIME')
    as packets_per_sec;
+-------------------+
| packets_per_sec   |
+-------------------+
| 54239.48988125529 |
+-------------------+
1 row in set (0.00 sec)

Histograms and Percentiles

TODO (need help describing details here).

You don't need to understand this to use the engine.

For all incoming time data (request_time or timer_value) - we build a histogram representing time values distribution for each 'row' in the report. This allows us to calculate percentiles (with some accuracy, that is given by histogram range and bucket count).

So each row in every report that has percentiles configured will have a histogram associated with it. When selecting data from that report, the engine processes the histogram to get percentile values.

Histogram

config defines the range and bucket count: hv=<min_value_ms>:<max_value_ms>:<bucket_count>. This defines a histogram with the following structure

given
  <hv_range>     = <max_value_ms> - <min_value_ms>
  <bucket_width> = <hv_range> / <bucket_count>

histogram looks like this
  [negative_infinity bucket] -> number of time values in range (-inf, <min_value_ms>]
  [0 bucket]                 -> number of time values in range (<min_value_ms>, <min_value_ms> + <bucket_width>]
  [1 bucket]                 -> number of time values in range (<min_value_ms> + <bucket_width>, <min_value_ms> + <bucket_width> * 2]
....
  [last bucket]              -> number of time values in range (<min_value_ms> + <bucket_width> * (<bucket_count> - 1), <min_value_ms> + <bucket_width> * <bucket_count>]
  [positive_infinity bucket] -> number of time values in range (<max_value_ms>, +inf)

Things to know about percentile caculation

  • when percentile calculation needs to take 'partial bucket' (i.e. not all values from the bucket) - it interpolates percentile value, assuming uniform distribution within the bucket
  • percentile 0 - is always equal to min_value_ms
  • percentile 100 - is always equal to max_value_ms

Raw Histogram output format

Generic format description

hv=<min_value_ms>:<min_value_ms>:<bucket_count>;values=[min:<negative_inf_value>,max:<positive_inf_value>,<bucket_id>:<value>, ...]

Example

// histogram configured with
//  min_value_ms = 0
//  min_value_ms = 2000  (aka 2 seconds)
//  bucket_count = 20000 (so histogram resolution is 2000ms/20000 = 100 microseconds)
//
// negative_inf bucket contains 3 values
// positive_inf bucket contains 3 values
// and bucket with id = 69, this bucket correspods to bucket (6ms, 7ms]
//    as buckets are numbered from 0, and (69 + 1)*100microseconds = 7000microseconds = 7milliseconds
hv=0:2000:20000;values=[min:3,max:3,69:3]

Percentile caculation example

Given the histogram above, say we need to calculate percentile 50 (aka median). Aka, the value that is larger than 50% of the values in the 'value set'. Our 'value set' is as follows

[ -inf, -inf, -inf, 7ms, 7ms, 7ms, +inf, +inf, +inf ]

or, transforming 'infinities' into min_value_ms and max_value_ms

[ 0ms, 0ms, 0ms, 7ms, 7ms, 7ms, 2000ms, 2000ms, 2000ms ]
  • calculate what '50% of all values' means, got 9 values, 50% is 4.5
  • round 4.5 up, take the value of 5th elt -> 7ms is the answer
  • but, taking into account a point from above (we interpolate within bucket, assuming uniform distribution)
    • actually the transformed value set will look like this
    [ 0ms, 0ms, 0ms, 6.33(3)ms, 6.66(6)ms, 7ms, 2000ms, 2000ms, 2000ms ]
    
    since we assume uniform distribution, virtually splitting the bucket into N=3 (the number of values in a bucket) sub-buckets
  • so our answer will be 6.66(6) millseconds

pinba2's People

Contributors

alexanderilyin avatar anton-povarov avatar caseycs avatar leonstafford avatar mkevac avatar sannis avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pinba2's Issues

Error when compiling pinba2 with maridb 10.5.10 (Debian buster)

I have error when compiling pinba2 with maridb 10.5.10. (Debian buster)

mariadb

cmake -Wno-dev -DWITHOUT_ROCKSDB=1 -DWITHOUT_MROONGA=1 -DWITHOUT_TOKUDB=1 \ 
-DPLUGIN_AUTH_GSSAPI_CLIENT=OFF -DCMAKE_SKIP_BUILD_RPATH:BOOL=YES \
-DWITHOUT_EXAMPLE_STORAGE_ENGINE=1 -DWITH_WSREP=OFF -DWITH_ROCKSDB_LZ4=OFF \
-DWITH_INNODB_SNAPPY=OFF -DWITH_ROCKSDB_snappy=OFF -DPLUGIN_MROONGA=NO \
-DWITHOUT_MROONGA=1 -DPLUGIN_OQGRAPH=NO -DWITHOUT_OQGRAPH=1 -DPLUGIN_ROCKSDB=NO \
-DWITHOUT_ROCKSDB=1 -DPLUGIN_SPHINX=NO -DWITHOUT_SPHINX=1 -DPLUGIN_SPIDER=NO \
-DWITHOUT_SPIDER=1 -DPLUGIN_TOKUDB=NO -DWITHOUT_TOKUDB=1  --enable-debug . && \ 
make -j4 

pinba

cd pinba2 && \
 ./configure \ 
--prefix=/_install/pinba2 \
--with-mysql=/var/src/pinba/mariadb \
--with-boost=/var/src/pinba/boost/ \
--with-meow=/var/src/pinba/meow \
--with-nanomsg=/_install/nanomsg \
--with-lz4=/_install/lz4 \
--enable-libmysqlservices && \
make -j4

Error

Making all in mysql_engine
make[2]: Entering directory '/var/src/pinba/pinba2/mysql_engine'
depbase=`echo view_conf.lo | sed 's|[^/]*$|.deps/&|;s|\.lo$||'`;\
/bin/bash ../libtool --preserve-dup-deps  --tag=CXX   --mode=compile g++ -DHAVE_CONFIG_H -I. -I..    -std=c++14 -fno-rtti  -pthread -Wformat -Wformat-security -Werror -Wno-unused -Wno-unused-parameter -Wno-unused-variable -Wno-missing-field-initializers -Wno-parentheses -fno-omit-frame-pointer -fPIC -DPIC -D_GNU_SOURCE -D_POSIX_SOURCE -maes -msse4 -msse4.2 -O3 -ffast-math -ggdb3 -mtune=native -I../third_party -I../third_party/robin-map/include -pthread -I/_install/nanomsg/include -I/var/src/pinba/meow -I/var/src/pinba/boost//include -I/var/src/pinba/boost/ -I/_install/lz4/include -DMYSQL_DYNAMIC_PLUGIN -DMYSQL_SERVER=1 -DPINBA_USE_MYSQL_SOURCE -I/var/src/pinba/mariadb -I/var/src/pinba/mariadb/sql -I/var/src/pinba/mariadb/regex -I/var/src/pinba/mariadb/include -I/var/src/pinba/mariadb/libbinlogevents/export -I/var/src/pinba/mariadb/libbinlogevents/include -DPINBA_ENGINE_DEBUG_OFF -I../include   -MT view_conf.lo -MD -MP -MF $depbase.Tpo -c -o view_conf.lo view_conf.cpp &&\
mv -f $depbase.Tpo $depbase.Plo
libtool: compile:  g++ -DHAVE_CONFIG_H -I. -I.. -std=c++14 -fno-rtti -pthread -Wformat -Wformat-security -Werror -Wno-unused -Wno-unused-parameter -Wno-unused-variable -Wno-missing-field-initializers -Wno-parentheses -fno-omit-frame-pointer -fPIC -DPIC -D_GNU_SOURCE -D_POSIX_SOURCE -maes -msse4 -msse4.2 -O3 -ffast-math -ggdb3 -mtune=native -I../third_party -I../third_party/robin-map/include -pthread -I/_install/nanomsg/include -I/var/src/pinba/meow -I/var/src/pinba/boost//include -I/var/src/pinba/boost/ -I/_install/lz4/include -DMYSQL_DYNAMIC_PLUGIN -DMYSQL_SERVER=1 -DPINBA_USE_MYSQL_SOURCE -I/var/src/pinba/mariadb -I/var/src/pinba/mariadb/sql -I/var/src/pinba/mariadb/regex -I/var/src/pinba/mariadb/include -I/var/src/pinba/mariadb/libbinlogevents/export -I/var/src/pinba/mariadb/libbinlogevents/include -DPINBA_ENGINE_DEBUG_OFF -I../include -MT view_conf.lo -MD -MP -MF .deps/view_conf.Tpo -c view_conf.cpp  -fPIC -DPIC -o .libs/view_conf.o
libtool: compile:  g++ -DHAVE_CONFIG_H -I. -I.. -std=c++14 -fno-rtti -pthread -Wformat -Wformat-security -Werror -Wno-unused -Wno-unused-parameter -Wno-unused-variable -Wno-missing-field-initializers -Wno-parentheses -fno-omit-frame-pointer -fPIC -DPIC -D_GNU_SOURCE -D_POSIX_SOURCE -maes -msse4 -msse4.2 -O3 -ffast-math -ggdb3 -mtune=native -I../third_party -I../third_party/robin-map/include -pthread -I/_install/nanomsg/include -I/var/src/pinba/meow -I/var/src/pinba/boost//include -I/var/src/pinba/boost/ -I/_install/lz4/include -DMYSQL_DYNAMIC_PLUGIN -DMYSQL_SERVER=1 -DPINBA_USE_MYSQL_SOURCE -I/var/src/pinba/mariadb -I/var/src/pinba/mariadb/sql -I/var/src/pinba/mariadb/regex -I/var/src/pinba/mariadb/include -I/var/src/pinba/mariadb/libbinlogevents/export -I/var/src/pinba/mariadb/libbinlogevents/include -DPINBA_ENGINE_DEBUG_OFF -I../include -MT view_conf.lo -MD -MP -MF .deps/view_conf.Tpo -c view_conf.cpp -o view_conf.o >/dev/null 2>&1
depbase=`echo plugin.lo | sed 's|[^/]*$|.deps/&|;s|\.lo$||'`;\
/bin/bash ../libtool --preserve-dup-deps  --tag=CXX   --mode=compile g++ -DHAVE_CONFIG_H -I. -I..    -std=c++14 -fno-rtti  -pthread -Wformat -Wformat-security -Werror -Wno-unused -Wno-unused-parameter -Wno-unused-variable -Wno-missing-field-initializers -Wno-parentheses -fno-omit-frame-pointer -fPIC -DPIC -D_GNU_SOURCE -D_POSIX_SOURCE -maes -msse4 -msse4.2 -O3 -ffast-math -ggdb3 -mtune=native -I../third_party -I../third_party/robin-map/include -pthread -I/_install/nanomsg/include -I/var/src/pinba/meow -I/var/src/pinba/boost//include -I/var/src/pinba/boost/ -I/_install/lz4/include -DMYSQL_DYNAMIC_PLUGIN -DMYSQL_SERVER=1 -DPINBA_USE_MYSQL_SOURCE -I/var/src/pinba/mariadb -I/var/src/pinba/mariadb/sql -I/var/src/pinba/mariadb/regex -I/var/src/pinba/mariadb/include -I/var/src/pinba/mariadb/libbinlogevents/export -I/var/src/pinba/mariadb/libbinlogevents/include -DPINBA_ENGINE_DEBUG_OFF -I../include   -MT plugin.lo -MD -MP -MF $depbase.Tpo -c -o plugin.lo plugin.cpp &&\
mv -f $depbase.Tpo $depbase.Plo
libtool: compile:  g++ -DHAVE_CONFIG_H -I. -I.. -std=c++14 -fno-rtti -pthread -Wformat -Wformat-security -Werror -Wno-unused -Wno-unused-parameter -Wno-unused-variable -Wno-missing-field-initializers -Wno-parentheses -fno-omit-frame-pointer -fPIC -DPIC -D_GNU_SOURCE -D_POSIX_SOURCE -maes -msse4 -msse4.2 -O3 -ffast-math -ggdb3 -mtune=native -I../third_party -I../third_party/robin-map/include -pthread -I/_install/nanomsg/include -I/var/src/pinba/meow -I/var/src/pinba/boost//include -I/var/src/pinba/boost/ -I/_install/lz4/include -DMYSQL_DYNAMIC_PLUGIN -DMYSQL_SERVER=1 -DPINBA_USE_MYSQL_SOURCE -I/var/src/pinba/mariadb -I/var/src/pinba/mariadb/sql -I/var/src/pinba/mariadb/regex -I/var/src/pinba/mariadb/include -I/var/src/pinba/mariadb/libbinlogevents/export -I/var/src/pinba/mariadb/libbinlogevents/include -DPINBA_ENGINE_DEBUG_OFF -I../include -MT plugin.lo -MD -MP -MF .deps/plugin.Tpo -c plugin.cpp  -fPIC -DPIC -o .libs/plugin.o
In file included from /var/src/pinba/mariadb/sql/handler.h:29,
                 from ../mysql_engine/handler.h:8,
                 from plugin.cpp:4:
/var/src/pinba/mariadb/sql/sql_basic_types.h:23:9: error: โ€˜ulonglongโ€™ does not name a type
   23 | typedef ulonglong sql_mode_t;
      |         ^~~~~~~~~
/var/src/pinba/mariadb/sql/sql_basic_types.h:24:9: error: โ€˜int64โ€™ does not name a type; did you mean โ€˜rintf64โ€™?
   24 | typedef int64 query_id_t;
      |         ^~~~~
      |         rintf64
/var/src/pinba/mariadb/sql/sql_basic_types.h:74:38: error: expected โ€˜)โ€™ before โ€˜fuzzydateโ€™
   74 |   explicit date_conv_mode_t(ulonglong fuzzydate)
      |                            ~         ^~~~~~~~~~
      |                                      )
/var/src/pinba/mariadb/sql/sql_basic_types.h:79:21: error: expected type-specifier before โ€˜ulonglongโ€™
   79 |   explicit operator ulonglong() const
      |                     ^~~~~~~~~
/var/src/pinba/mariadb/sql/sql_basic_types.h:89:3: error: โ€˜ulonglongโ€™ does not name a type
   89 |   ulonglong operator~() const
      |   ^~~~~~~~~
/var/src/pinba/mariadb/sql/sql_basic_types.h:99:36: error: โ€˜ulonglongโ€™ does not name a type
   99 |   date_conv_mode_t operator&(const ulonglong other) const
      |                                    ^~~~~~~~~
/var/src/pinba/mariadb/sql/sql_basic_types.h: In member function โ€˜date_conv_mode_t date_conv_mode_t::operator&(const date_conv_mode_t&) constโ€™:
/var/src/pinba/mariadb/sql/sql_basic_types.h:97:50: error: no matching function for call to โ€˜date_conv_mode_t::date_conv_mode_t(int)โ€™
   97 |     return date_conv_mode_t(m_mode & other.m_mode);
      |                                                  ^
/var/src/pinba/mariadb/sql/sql_basic_types.h:34:7: note: candidate: โ€˜date_conv_mode_t::date_conv_mode_t()โ€™
   34 | class date_conv_mode_t
      |       ^~~~~~~~~~~~~~~~
/var/src/pinba/mariadb/sql/sql_basic_types.h:34:7: note:   candidate expects 0 arguments, 1 provided
/var/src/pinba/mariadb/sql/sql_basic_types.h:34:7: note: candidate: โ€˜constexpr date_conv_mode_t::date_conv_mode_t(const date_conv_mode_t&)โ€™
/var/src/pinba/mariadb/sql/sql_basic_types.h:34:7: note:   no known conversion for argument 1 from โ€˜intโ€™ to โ€˜const date_conv_mode_t&โ€™
/var/src/pinba/mariadb/sql/sql_basic_types.h:34:7: note: candidate: โ€˜constexpr date_conv_mode_t::date_conv_mode_t(date_conv_mode_t&&)โ€™
/var/src/pinba/mariadb/sql/sql_basic_types.h:34:7: note:   no known conversion for argument 1 from โ€˜intโ€™ to โ€˜date_conv_mode_t&&โ€™
/var/src/pinba/mariadb/sql/sql_basic_types.h: In member function โ€˜date_conv_mode_t date_conv_mode_t::operator&(int) constโ€™:
/var/src/pinba/mariadb/sql/sql_basic_types.h:101:43: error: no matching function for call to โ€˜date_conv_mode_t::date_conv_mode_t(int)โ€™
  101 |     return date_conv_mode_t(m_mode & other);
      |                                           ^
/var/src/pinba/mariadb/sql/sql_basic_types.h:34:7: note: candidate: โ€˜date_conv_mode_t::date_conv_mode_t()โ€™
   34 | class date_conv_mode_t
      |       ^~~~~~~~~~~~~~~~
/var/src/pinba/mariadb/sql/sql_basic_types.h:34:7: note:   candidate expects 0 arguments, 1 provided
/var/src/pinba/mariadb/sql/sql_basic_types.h:34:7: note: candidate: โ€˜constexpr date_conv_mode_t::date_conv_mode_t(const date_conv_mode_t&)โ€™
/var/src/pinba/mariadb/sql/sql_basic_types.h:34:7: note:   no known conversion for argument 1 from โ€˜intโ€™ to โ€˜const date_conv_mode_t&โ€™
/var/src/pinba/mariadb/sql/sql_basic_types.h:34:7: note: candidate: โ€˜constexpr date_conv_mode_t::date_conv_mode_t(date_conv_mode_t&&)โ€™
/var/src/pinba/mariadb/sql/sql_basic_types.h:34:7: note:   no known conversion for argument 1 from โ€˜intโ€™ to โ€˜date_conv_mode_t&&โ€™
/var/src/pinba/mariadb/sql/sql_basic_types.h: In member function โ€˜date_conv_mode_t date_conv_mode_t::operator|(const date_conv_mode_t&) constโ€™:
/var/src/pinba/mariadb/sql/sql_basic_types.h:106:50: error: no matching function for call to โ€˜date_conv_mode_t::date_conv_mode_t(int)โ€™
  106 |     return date_conv_mode_t(m_mode | other.m_mode);
      |                                                  ^
/var/src/pinba/mariadb/sql/sql_basic_types.h:34:7: note: candidate: โ€˜date_conv_mode_t::date_conv_mode_t()โ€™
   34 | class date_conv_mode_t
      |       ^~~~~~~~~~~~~~~~
/var/src/pinba/mariadb/sql/sql_basic_types.h:34:7: note:   candidate expects 0 arguments, 1 provided
/var/src/pinba/mariadb/sql/sql_basic_types.h:34:7: note: candidate: โ€˜constexpr date_conv_mode_t::date_conv_mode_t(const date_conv_mode_t&)โ€™
/var/src/pinba/mariadb/sql/sql_basic_types.h:34:7: note:   no known conversion for argument 1 from โ€˜intโ€™ to โ€˜const date_conv_mode_t&โ€™
/var/src/pinba/mariadb/sql/sql_basic_types.h:34:7: note: candidate: โ€˜constexpr date_conv_mode_t::date_conv_mode_t(date_conv_mode_t&&)โ€™
/var/src/pinba/mariadb/sql/sql_basic_types.h:34:7: note:   no known conversion for argument 1 from โ€˜intโ€™ to โ€˜date_conv_mode_t&&โ€™
/var/src/pinba/mariadb/sql/sql_basic_types.h: At global scope:
/var/src/pinba/mariadb/sql/sql_basic_types.h:150:39: error: expected โ€˜)โ€™ before โ€˜modeโ€™
  150 |   explicit time_round_mode_t(ulonglong mode)
      |                             ~         ^~~~~
      |                                       )
/var/src/pinba/mariadb/sql/sql_basic_types.h:158:21: error: expected type-specifier before โ€˜ulonglongโ€™
  158 |   explicit operator ulonglong() const
      |                     ^~~~~~~~~
/var/src/pinba/mariadb/sql/sql_basic_types.h:202:33: error: expected โ€˜)โ€™ before โ€˜fuzzydateโ€™
  202 |   explicit date_mode_t(ulonglong fuzzydate)
      |                       ~         ^~~~~~~~~~
      |                                 )
/var/src/pinba/mariadb/sql/sql_basic_types.h:207:21: error: expected type-specifier before โ€˜ulonglongโ€™
  207 |   explicit operator ulonglong() const
      |                     ^~~~~~~~~
/var/src/pinba/mariadb/sql/sql_basic_types.h:224:3: error: โ€˜ulonglongโ€™ does not name a type
  224 |   ulonglong operator~() const
      |   ^~~~~~~~~
/var/src/pinba/mariadb/sql/sql_basic_types.h:238:25: error: โ€˜ulonglongโ€™ has not been declared
  238 |   date_mode_t operator&(ulonglong other) const
      |                         ^~~~~~~~~
/var/src/pinba/mariadb/sql/sql_basic_types.h: In member function โ€˜date_mode_t::operator date_conv_mode_t() constโ€™:
/var/src/pinba/mariadb/sql/sql_basic_types.h:217:29: error: โ€˜ulonglongโ€™ was not declared in this scope
  217 |     return date_conv_mode_t(ulonglong(m_mode) & date_conv_mode_t::KNOWN_MODES);
      |                             ^~~~~~~~~
/var/src/pinba/mariadb/sql/sql_basic_types.h: In member function โ€˜date_mode_t::operator time_round_mode_t() constโ€™:
/var/src/pinba/mariadb/sql/sql_basic_types.h:221:30: error: โ€˜ulonglongโ€™ was not declared in this scope
  221 |     return time_round_mode_t(ulonglong(m_mode) & time_round_mode_t::KNOWN_MODES);
      |                              ^~~~~~~~~
/var/src/pinba/mariadb/sql/sql_basic_types.h: In member function โ€˜date_mode_t date_mode_t::operator&(const date_mode_t&) constโ€™:
/var/src/pinba/mariadb/sql/sql_basic_types.h:236:45: error: no matching function for call to โ€˜date_mode_t::date_mode_t(int)โ€™
  236 |     return date_mode_t(m_mode & other.m_mode);
      |                                             ^
/var/src/pinba/mariadb/sql/sql_basic_types.h:181:7: note: candidate: โ€˜date_mode_t::date_mode_t()โ€™
  181 | class date_mode_t
      |       ^~~~~~~~~~~
/var/src/pinba/mariadb/sql/sql_basic_types.h:181:7: note:   candidate expects 0 arguments, 1 provided
/var/src/pinba/mariadb/sql/sql_basic_types.h:181:7: note: candidate: โ€˜constexpr date_mode_t::date_mode_t(const date_mode_t&)โ€™
/var/src/pinba/mariadb/sql/sql_basic_types.h:181:7: note:   no known conversion for argument 1 from โ€˜intโ€™ to โ€˜const date_mode_t&โ€™
/var/src/pinba/mariadb/sql/sql_basic_types.h:181:7: note: candidate: โ€˜constexpr date_mode_t::date_mode_t(date_mode_t&&)โ€™
/var/src/pinba/mariadb/sql/sql_basic_types.h:181:7: note:   no known conversion for argument 1 from โ€˜intโ€™ to โ€˜date_mode_t&&โ€™
/var/src/pinba/mariadb/sql/sql_basic_types.h: In member function โ€˜date_mode_t date_mode_t::operator&(int) constโ€™:
/var/src/pinba/mariadb/sql/sql_basic_types.h:240:38: error: no matching function for call to โ€˜date_mode_t::date_mode_t(int)โ€™
  240 |     return date_mode_t(m_mode & other);
      |                                      ^
/var/src/pinba/mariadb/sql/sql_basic_types.h:181:7: note: candidate: โ€˜date_mode_t::date_mode_t()โ€™
  181 | class date_mode_t
      |       ^~~~~~~~~~~
/var/src/pinba/mariadb/sql/sql_basic_types.h:181:7: note:   candidate expects 0 arguments, 1 provided
/var/src/pinba/mariadb/sql/sql_basic_types.h:181:7: note: candidate: โ€˜constexpr date_mode_t::date_mode_t(const date_mode_t&)โ€™
/var/src/pinba/mariadb/sql/sql_basic_types.h:181:7: note:   no known conversion for argument 1 from โ€˜intโ€™ to โ€˜const date_mode_t&โ€™
/var/src/pinba/mariadb/sql/sql_basic_types.h:181:7: note: candidate: โ€˜constexpr date_mode_t::date_mode_t(date_mode_t&&)โ€™
/var/src/pinba/mariadb/sql/sql_basic_types.h:181:7: note:   no known conversion for argument 1 from โ€˜intโ€™ to โ€˜date_mode_t&&โ€™
/var/src/pinba/mariadb/sql/sql_basic_types.h: In member function โ€˜date_mode_t date_mode_t::operator|(const date_mode_t&) constโ€™:
/var/src/pinba/mariadb/sql/sql_basic_types.h:245:45: error: no matching function for call to โ€˜date_mode_t::date_mode_t(int)โ€™
  245 |     return date_mode_t(m_mode | other.m_mode);
      |                                             ^
/var/src/pinba/mariadb/sql/sql_basic_types.h:181:7: note: candidate: โ€˜date_mode_t::date_mode_t()โ€™
  181 | class date_mode_t
      |       ^~~~~~~~~~~
/var/src/pinba/mariadb/sql/sql_basic_types.h:181:7: note:   candidate expects 0 arguments, 1 provided
/var/src/pinba/mariadb/sql/sql_basic_types.h:181:7: note: candidate: โ€˜constexpr date_mode_t::date_mode_t(const date_mode_t&)โ€™
/var/src/pinba/mariadb/sql/sql_basic_types.h:181:7: note:   no known conversion for argument 1 from โ€˜intโ€™ to โ€˜const date_mode_t&โ€™
/var/src/pinba/mariadb/sql/sql_basic_types.h:181:7: note: candidate: โ€˜constexpr date_mode_t::date_mode_t(date_mode_t&&)โ€™
/var/src/pinba/mariadb/sql/sql_basic_types.h:181:7: note:   no known conversion for argument 1 from โ€˜intโ€™ to โ€˜date_mode_t&&โ€™
/var/src/pinba/mariadb/sql/sql_basic_types.h: In member function โ€˜date_mode_t& date_mode_t::operator|=(const date_conv_mode_t&)โ€™:
/var/src/pinba/mariadb/sql/sql_basic_types.h:263:30: error: โ€˜ulonglongโ€™ was not declared in this scope
  263 |     m_mode= value_t(m_mode | ulonglong(other));
      |                              ^~~~~~~~~
/var/src/pinba/mariadb/sql/sql_basic_types.h: In function โ€˜date_mode_t operator|(const date_mode_t&, const date_conv_mode_t&)โ€™:
/var/src/pinba/mariadb/sql/sql_basic_types.h:273:22: error: โ€˜ulonglongโ€™ was not declared in this scope
  273 |   return date_mode_t(ulonglong(a) | ulonglong(b));
      |                      ^~~~~~~~~
/var/src/pinba/mariadb/sql/sql_basic_types.h: In function โ€˜date_mode_t operator|(const date_conv_mode_t&, const time_round_mode_t&)โ€™:
/var/src/pinba/mariadb/sql/sql_basic_types.h:279:22: error: โ€˜ulonglongโ€™ was not declared in this scope
  279 |   return date_mode_t(ulonglong(a) | ulonglong(b));
      |                      ^~~~~~~~~
/var/src/pinba/mariadb/sql/sql_basic_types.h: In function โ€˜date_mode_t operator|(const date_conv_mode_t&, const date_mode_t&)โ€™:
/var/src/pinba/mariadb/sql/sql_basic_types.h:286:22: error: โ€˜ulonglongโ€™ was not declared in this scope
  286 |   return date_mode_t(ulonglong(a) | ulonglong(b));
      |                      ^~~~~~~~~
/var/src/pinba/mariadb/sql/sql_basic_types.h: In function โ€˜date_conv_mode_t operator&(const date_mode_t&, const date_conv_mode_t&)โ€™:
/var/src/pinba/mariadb/sql/sql_basic_types.h:294:27: error: โ€˜ulonglongโ€™ was not declared in this scope
  294 |   return date_conv_mode_t(ulonglong(a) & ulonglong(b));
      |                           ^~~~~~~~~
/var/src/pinba/mariadb/sql/sql_basic_types.h: In function โ€˜date_conv_mode_t operator&(const date_conv_mode_t&, const date_mode_t&)โ€™:
/var/src/pinba/mariadb/sql/sql_basic_types.h:300:27: error: โ€˜ulonglongโ€™ was not declared in this scope
  300 |   return date_conv_mode_t(ulonglong(a) & ulonglong(b));
      |                           ^~~~~~~~~
/var/src/pinba/mariadb/sql/sql_basic_types.h: At global scope:
/var/src/pinba/mariadb/sql/sql_basic_types.h:303:32: error: declaration of โ€˜operator&โ€™ as non-function
  303 | static inline date_conv_mode_t operator&(sql_mode_t &a,
      |                                ^~~~~~~~
/var/src/pinba/mariadb/sql/sql_basic_types.h:303:42: error: โ€˜sql_mode_tโ€™ was not declared in this scope
  303 | static inline date_conv_mode_t operator&(sql_mode_t &a,
      |                                          ^~~~~~~~~~
/var/src/pinba/mariadb/sql/sql_basic_types.h:303:54: error: โ€˜aโ€™ was not declared in this scope
  303 | static inline date_conv_mode_t operator&(sql_mode_t &a,
      |                                                      ^
/var/src/pinba/mariadb/sql/sql_basic_types.h:304:42: error: expected primary-expression before โ€˜constโ€™
  304 |                                          const date_conv_mode_t &b)
      |                                          ^~~~~
/var/src/pinba/mariadb/sql/sql_basic_types.h:311:59: error: no matching function for call to โ€˜date_conv_mode_t::date_conv_mode_t(date_conv_mode_t::value_t)โ€™
  311 |   TIME_CONV_NONE              (date_conv_mode_t::CONV_NONE),
      |                                                           ^
/var/src/pinba/mariadb/sql/sql_basic_types.h:34:7: note: candidate: โ€˜date_conv_mode_t::date_conv_mode_t()โ€™
   34 | class date_conv_mode_t
      |       ^~~~~~~~~~~~~~~~
/var/src/pinba/mariadb/sql/sql_basic_types.h:34:7: note:   candidate expects 0 arguments, 1 provided
/var/src/pinba/mariadb/sql/sql_basic_types.h:34:7: note: candidate: โ€˜constexpr date_conv_mode_t::date_conv_mode_t(const date_conv_mode_t&)โ€™
/var/src/pinba/mariadb/sql/sql_basic_types.h:34:7: note:   no known conversion for argument 1 from โ€˜date_conv_mode_t::value_tโ€™ to โ€˜const date_conv_mode_t&โ€™
/var/src/pinba/mariadb/sql/sql_basic_types.h:34:7: note: candidate: โ€˜constexpr date_conv_mode_t::date_conv_mode_t(date_conv_mode_t&&)โ€™
/var/src/pinba/mariadb/sql/sql_basic_types.h:34:7: note:   no known conversion for argument 1 from โ€˜date_conv_mode_t::value_tโ€™ to โ€˜date_conv_mode_t&&โ€™
/var/src/pinba/mariadb/sql/sql_basic_types.h:312:61: error: no matching function for call to โ€˜date_conv_mode_t::date_conv_mode_t(date_conv_mode_t::value_t)โ€™
  312 |   TIME_FUZZY_DATES            (date_conv_mode_t::FUZZY_DATES),
      |                                                             ^
/var/src/pinba/mariadb/sql/sql_basic_types.h:34:7: note: candidate: โ€˜date_conv_mode_t::date_conv_mode_t()โ€™
   34 | class date_conv_mode_t
      |       ^~~~~~~~~~~~~~~~
/var/src/pinba/mariadb/sql/sql_basic_types.h:34:7: note:   candidate expects 0 arguments, 1 provided
/var/src/pinba/mariadb/sql/sql_basic_types.h:34:7: note: candidate: โ€˜constexpr date_conv_mode_t::date_conv_mode_t(const date_conv_mode_t&)โ€™
/var/src/pinba/mariadb/sql/sql_basic_types.h:34:7: note:   no known conversion for argument 1 from โ€˜date_conv_mode_t::value_tโ€™ to โ€˜const date_conv_mode_t&โ€™
/var/src/pinba/mariadb/sql/sql_basic_types.h:34:7: note: candidate: โ€˜constexpr date_conv_mode_t::date_conv_mode_t(date_conv_mode_t&&)โ€™
/var/src/pinba/mariadb/sql/sql_basic_types.h:34:7: note:   no known conversion for argument 1 from โ€˜date_conv_mode_t::value_tโ€™ to โ€˜date_conv_mode_t&&โ€™
/var/src/pinba/mariadb/sql/sql_basic_types.h:313:59: error: no matching function for call to โ€˜date_conv_mode_t::date_conv_mode_t(date_conv_mode_t::value_t)โ€™
  313 |   TIME_TIME_ONLY              (date_conv_mode_t::TIME_ONLY),
      |                                                           ^
/var/src/pinba/mariadb/sql/sql_basic_types.h:34:7: note: candidate: โ€˜date_conv_mode_t::date_conv_mode_t()โ€™
   34 | class date_conv_mode_t
      |       ^~~~~~~~~~~~~~~~
/var/src/pinba/mariadb/sql/sql_basic_types.h:34:7: note:   candidate expects 0 arguments, 1 provided
/var/src/pinba/mariadb/sql/sql_basic_types.h:34:7: note: candidate: โ€˜constexpr date_conv_mode_t::date_conv_mode_t(const date_conv_mode_t&)โ€™
/var/src/pinba/mariadb/sql/sql_basic_types.h:34:7: note:   no known conversion for argument 1 from โ€˜date_conv_mode_t::value_tโ€™ to โ€˜const date_conv_mode_t&โ€™
/var/src/pinba/mariadb/sql/sql_basic_types.h:34:7: note: candidate: โ€˜constexpr date_conv_mode_t::date_conv_mode_t(date_conv_mode_t&&)โ€™
/var/src/pinba/mariadb/sql/sql_basic_types.h:34:7: note:   no known conversion for argument 1 from โ€˜date_conv_mode_t::value_tโ€™ to โ€˜date_conv_mode_t&&โ€™
/var/src/pinba/mariadb/sql/sql_basic_types.h:314:67: error: no matching function for call to โ€˜date_conv_mode_t::date_conv_mode_t(date_conv_mode_t::value_t)โ€™
  314 |   TIME_INTERVAL_hhmmssff      (date_conv_mode_t::INTERVAL_hhmmssff),
      |                                                                   ^
/var/src/pinba/mariadb/sql/sql_basic_types.h:34:7: note: candidate: โ€˜date_conv_mode_t::date_conv_mode_t()โ€™
   34 | class date_conv_mode_t
      |       ^~~~~~~~~~~~~~~~
/var/src/pinba/mariadb/sql/sql_basic_types.h:34:7: note:   candidate expects 0 arguments, 1 provided
/var/src/pinba/mariadb/sql/sql_basic_types.h:34:7: note: candidate: โ€˜constexpr date_conv_mode_t::date_conv_mode_t(const date_conv_mode_t&)โ€™
/var/src/pinba/mariadb/sql/sql_basic_types.h:34:7: note:   no known conversion for argument 1 from โ€˜date_conv_mode_t::value_tโ€™ to โ€˜const date_conv_mode_t&โ€™
/var/src/pinba/mariadb/sql/sql_basic_types.h:34:7: note: candidate: โ€˜constexpr date_conv_mode_t::date_conv_mode_t(date_conv_mode_t&&)โ€™
/var/src/pinba/mariadb/sql/sql_basic_types.h:34:7: note:   no known conversion for argument 1 from โ€˜date_conv_mode_t::value_tโ€™ to โ€˜date_conv_mode_t&&โ€™
/var/src/pinba/mariadb/sql/sql_basic_types.h:315:62: error: no matching function for call to โ€˜date_conv_mode_t::date_conv_mode_t(date_conv_mode_t::value_t)โ€™
  315 |   TIME_INTERVAL_DAY           (date_conv_mode_t::INTERVAL_DAY),
      |                                                              ^
/var/src/pinba/mariadb/sql/sql_basic_types.h:34:7: note: candidate: โ€˜date_conv_mode_t::date_conv_mode_t()โ€™
   34 | class date_conv_mode_t
      |       ^~~~~~~~~~~~~~~~
/var/src/pinba/mariadb/sql/sql_basic_types.h:34:7: note:   candidate expects 0 arguments, 1 provided
/var/src/pinba/mariadb/sql/sql_basic_types.h:34:7: note: candidate: โ€˜constexpr date_conv_mode_t::date_conv_mode_t(const date_conv_mode_t&)โ€™
/var/src/pinba/mariadb/sql/sql_basic_types.h:34:7: note:   no known conversion for argument 1 from โ€˜date_conv_mode_t::value_tโ€™ to โ€˜const date_conv_mode_t&โ€™
/var/src/pinba/mariadb/sql/sql_basic_types.h:34:7: note: candidate: โ€˜constexpr date_conv_mode_t::date_conv_mode_t(date_conv_mode_t&&)โ€™
/var/src/pinba/mariadb/sql/sql_basic_types.h:34:7: note:   no known conversion for argument 1 from โ€˜date_conv_mode_t::value_tโ€™ to โ€˜date_conv_mode_t&&โ€™
/var/src/pinba/mariadb/sql/sql_basic_types.h:316:65: error: no matching function for call to โ€˜date_conv_mode_t::date_conv_mode_t(date_conv_mode_t::value_t)โ€™
  316 |   TIME_NO_ZERO_IN_DATE        (date_conv_mode_t::NO_ZERO_IN_DATE),
      |                                                                 ^
/var/src/pinba/mariadb/sql/sql_basic_types.h:34:7: note: candidate: โ€˜date_conv_mode_t::date_conv_mode_t()โ€™
   34 | class date_conv_mode_t
      |       ^~~~~~~~~~~~~~~~
/var/src/pinba/mariadb/sql/sql_basic_types.h:34:7: note:   candidate expects 0 arguments, 1 provided
/var/src/pinba/mariadb/sql/sql_basic_types.h:34:7: note: candidate: โ€˜constexpr date_conv_mode_t::date_conv_mode_t(const date_conv_mode_t&)โ€™
/var/src/pinba/mariadb/sql/sql_basic_types.h:34:7: note:   no known conversion for argument 1 from โ€˜date_conv_mode_t::value_tโ€™ to โ€˜const date_conv_mode_t&โ€™
/var/src/pinba/mariadb/sql/sql_basic_types.h:34:7: note: candidate: โ€˜constexpr date_conv_mode_t::date_conv_mode_t(date_conv_mode_t&&)โ€™
/var/src/pinba/mariadb/sql/sql_basic_types.h:34:7: note:   no known conversion for argument 1 from โ€˜date_conv_mode_t::value_tโ€™ to โ€˜date_conv_mode_t&&โ€™
/var/src/pinba/mariadb/sql/sql_basic_types.h:317:62: error: no matching function for call to โ€˜date_conv_mode_t::date_conv_mode_t(date_conv_mode_t::value_t)โ€™
  317 |   TIME_NO_ZERO_DATE           (date_conv_mode_t::NO_ZERO_DATE),
      |                                                              ^
/var/src/pinba/mariadb/sql/sql_basic_types.h:34:7: note: candidate: โ€˜date_conv_mode_t::date_conv_mode_t()โ€™
   34 | class date_conv_mode_t
      |       ^~~~~~~~~~~~~~~~
/var/src/pinba/mariadb/sql/sql_basic_types.h:34:7: note:   candidate expects 0 arguments, 1 provided
/var/src/pinba/mariadb/sql/sql_basic_types.h:34:7: note: candidate: โ€˜constexpr date_conv_mode_t::date_conv_mode_t(const date_conv_mode_t&)โ€™
/var/src/pinba/mariadb/sql/sql_basic_types.h:34:7: note:   no known conversion for argument 1 from โ€˜date_conv_mode_t::value_tโ€™ to โ€˜const date_conv_mode_t&โ€™
/var/src/pinba/mariadb/sql/sql_basic_types.h:34:7: note: candidate: โ€˜constexpr date_conv_mode_t::date_conv_mode_t(date_conv_mode_t&&)โ€™
/var/src/pinba/mariadb/sql/sql_basic_types.h:34:7: note:   no known conversion for argument 1 from โ€˜date_conv_mode_t::value_tโ€™ to โ€˜date_conv_mode_t&&โ€™
/var/src/pinba/mariadb/sql/sql_basic_types.h:318:63: error: no matching function for call to โ€˜date_conv_mode_t::date_conv_mode_t(date_conv_mode_t::value_t)โ€™
  318 |   TIME_INVALID_DATES          (date_conv_mode_t::INVALID_DATES);
      |                                                               ^
/var/src/pinba/mariadb/sql/sql_basic_types.h:34:7: note: candidate: โ€˜date_conv_mode_t::date_conv_mode_t()โ€™
   34 | class date_conv_mode_t
      |       ^~~~~~~~~~~~~~~~
/var/src/pinba/mariadb/sql/sql_basic_types.h:34:7: note:   candidate expects 0 arguments, 1 provided
/var/src/pinba/mariadb/sql/sql_basic_types.h:34:7: note: candidate: โ€˜constexpr date_conv_mode_t::date_conv_mode_t(const date_conv_mode_t&)โ€™
/var/src/pinba/mariadb/sql/sql_basic_types.h:34:7: note:   no known conversion for argument 1 from โ€˜date_conv_mode_t::value_tโ€™ to โ€˜const date_conv_mode_t&โ€™
/var/src/pinba/mariadb/sql/sql_basic_types.h:34:7: note: candidate: โ€˜constexpr date_conv_mode_t::date_conv_mode_t(date_conv_mode_t&&)โ€™
/var/src/pinba/mariadb/sql/sql_basic_types.h:34:7: note:   no known conversion for argument 1 from โ€˜date_conv_mode_t::value_tโ€™ to โ€˜date_conv_mode_t&&โ€™
/var/src/pinba/mariadb/sql/sql_basic_types.h:323:65: error: no matching function for call to โ€˜date_conv_mode_t::date_conv_mode_t(int)โ€™
  323 |                                date_conv_mode_t::NO_ZERO_IN_DATE);
      |                                                                 ^
/var/src/pinba/mariadb/sql/sql_basic_types.h:34:7: note: candidate: โ€˜date_conv_mode_t::date_conv_mode_t()โ€™
   34 | class date_conv_mode_t
      |       ^~~~~~~~~~~~~~~~
/var/src/pinba/mariadb/sql/sql_basic_types.h:34:7: note:   candidate expects 0 arguments, 1 provided
/var/src/pinba/mariadb/sql/sql_basic_types.h:34:7: note: candidate: โ€˜constexpr date_conv_mode_t::date_conv_mode_t(const date_conv_mode_t&)โ€™
/var/src/pinba/mariadb/sql/sql_basic_types.h:34:7: note:   no known conversion for argument 1 from โ€˜intโ€™ to โ€˜const date_conv_mode_t&โ€™
/var/src/pinba/mariadb/sql/sql_basic_types.h:34:7: note: candidate: โ€˜constexpr date_conv_mode_t::date_conv_mode_t(date_conv_mode_t&&)โ€™
/var/src/pinba/mariadb/sql/sql_basic_types.h:34:7: note:   no known conversion for argument 1 from โ€˜intโ€™ to โ€˜date_conv_mode_t&&โ€™
/var/src/pinba/mariadb/sql/sql_basic_types.h:329:58: error: no matching function for call to โ€˜date_conv_mode_t::date_conv_mode_t(int)โ€™
  329 |                                date_mode_t::INVALID_DATES);
      |                                                          ^
/var/src/pinba/mariadb/sql/sql_basic_types.h:34:7: note: candidate: โ€˜date_conv_mode_t::date_conv_mode_t()โ€™
   34 | class date_conv_mode_t
      |       ^~~~~~~~~~~~~~~~
/var/src/pinba/mariadb/sql/sql_basic_types.h:34:7: note:   candidate expects 0 arguments, 1 provided
/var/src/pinba/mariadb/sql/sql_basic_types.h:34:7: note: candidate: โ€˜constexpr date_conv_mode_t::date_conv_mode_t(const date_conv_mode_t&)โ€™
/var/src/pinba/mariadb/sql/sql_basic_types.h:34:7: note:   no known conversion for argument 1 from โ€˜intโ€™ to โ€˜const date_conv_mode_t&โ€™
/var/src/pinba/mariadb/sql/sql_basic_types.h:34:7: note: candidate: โ€˜constexpr date_conv_mode_t::date_conv_mode_t(date_conv_mode_t&&)โ€™
/var/src/pinba/mariadb/sql/sql_basic_types.h:34:7: note:   no known conversion for argument 1 from โ€˜intโ€™ to โ€˜date_conv_mode_t&&โ€™
/var/src/pinba/mariadb/sql/sql_basic_types.h:332:60: error: no matching function for call to โ€˜time_round_mode_t::time_round_mode_t(time_round_mode_t::value_t)โ€™
  332 |   TIME_FRAC_NONE              (time_round_mode_t::FRAC_NONE),
      |                                                            ^
/var/src/pinba/mariadb/sql/sql_basic_types.h:127:7: note: candidate: โ€˜time_round_mode_t::time_round_mode_t()โ€™
  127 | class time_round_mode_t
      |       ^~~~~~~~~~~~~~~~~
/var/src/pinba/mariadb/sql/sql_basic_types.h:127:7: note:   candidate expects 0 arguments, 1 provided
/var/src/pinba/mariadb/sql/sql_basic_types.h:127:7: note: candidate: โ€˜constexpr time_round_mode_t::time_round_mode_t(const time_round_mode_t&)โ€™
/var/src/pinba/mariadb/sql/sql_basic_types.h:127:7: note:   no known conversion for argument 1 from โ€˜time_round_mode_t::value_tโ€™ to โ€˜const time_round_mode_t&โ€™
/var/src/pinba/mariadb/sql/sql_basic_types.h:127:7: note: candidate: โ€˜constexpr time_round_mode_t::time_round_mode_t(time_round_mode_t&&)โ€™
/var/src/pinba/mariadb/sql/sql_basic_types.h:127:7: note:   no known conversion for argument 1 from โ€˜time_round_mode_t::value_tโ€™ to โ€˜time_round_mode_t&&โ€™
/var/src/pinba/mariadb/sql/sql_basic_types.h:333:64: error: no matching function for call to โ€˜time_round_mode_t::time_round_mode_t(time_round_mode_t::value_t)โ€™
  333 |   TIME_FRAC_TRUNCATE          (time_round_mode_t::FRAC_TRUNCATE),
      |                                                                ^
/var/src/pinba/mariadb/sql/sql_basic_types.h:127:7: note: candidate: โ€˜time_round_mode_t::time_round_mode_t()โ€™
  127 | class time_round_mode_t
      |       ^~~~~~~~~~~~~~~~~
/var/src/pinba/mariadb/sql/sql_basic_types.h:127:7: note:   candidate expects 0 arguments, 1 provided
/var/src/pinba/mariadb/sql/sql_basic_types.h:127:7: note: candidate: โ€˜constexpr time_round_mode_t::time_round_mode_t(const time_round_mode_t&)โ€™
/var/src/pinba/mariadb/sql/sql_basic_types.h:127:7: note:   no known conversion for argument 1 from โ€˜time_round_mode_t::value_tโ€™ to โ€˜const time_round_mode_t&โ€™
/var/src/pinba/mariadb/sql/sql_basic_types.h:127:7: note: candidate: โ€˜constexpr time_round_mode_t::time_round_mode_t(time_round_mode_t&&)โ€™
/var/src/pinba/mariadb/sql/sql_basic_types.h:127:7: note:   no known conversion for argument 1 from โ€˜time_round_mode_t::value_tโ€™ to โ€˜time_round_mode_t&&โ€™
/var/src/pinba/mariadb/sql/sql_basic_types.h:334:61: error: no matching function for call to โ€˜time_round_mode_t::time_round_mode_t(time_round_mode_t::value_t)โ€™
  334 |   TIME_FRAC_ROUND             (time_round_mode_t::FRAC_ROUND);
      |                                                             ^
/var/src/pinba/mariadb/sql/sql_basic_types.h:127:7: note: candidate: โ€˜time_round_mode_t::time_round_mode_t()โ€™
  127 | class time_round_mode_t
      |       ^~~~~~~~~~~~~~~~~
/var/src/pinba/mariadb/sql/sql_basic_types.h:127:7: note:   candidate expects 0 arguments, 1 provided
/var/src/pinba/mariadb/sql/sql_basic_types.h:127:7: note: candidate: โ€˜constexpr time_round_mode_t::time_round_mode_t(const time_round_mode_t&)โ€™
/var/src/pinba/mariadb/sql/sql_basic_types.h:127:7: note:   no known conversion for argument 1 from โ€˜time_round_mode_t::value_tโ€™ to โ€˜const time_round_mode_t&โ€™
/var/src/pinba/mariadb/sql/sql_basic_types.h:127:7: note: candidate: โ€˜constexpr time_round_mode_t::time_round_mode_t(time_round_mode_t&&)โ€™
/var/src/pinba/mariadb/sql/sql_basic_types.h:127:7: note:   no known conversion for argument 1 from โ€˜time_round_mode_t::value_tโ€™ to โ€˜time_round_mode_t&&โ€™
In file included from /var/src/pinba/mariadb/sql/mysqld.h:21,
                 from /var/src/pinba/mariadb/sql/handler.h:30,
                 from ../mysql_engine/handler.h:8,
                 from plugin.cpp:4:
/var/src/pinba/mariadb/sql/sql_mode.h:117:3: error: โ€˜sql_mode_tโ€™ does not name a type
  117 |   sql_mode_t m_hard;
      |   ^~~~~~~~~~
/var/src/pinba/mariadb/sql/sql_mode.h:118:3: error: โ€˜sql_mode_tโ€™ does not name a type
  118 |   sql_mode_t m_soft;
      |   ^~~~~~~~~~
/var/src/pinba/mariadb/sql/sql_mode.h:123:33: error: expected โ€˜)โ€™ before โ€˜hardโ€™
  123 |   Sql_mode_dependency(sql_mode_t hard, sql_mode_t soft)
      |                      ~          ^~~~~
      |                                 )
/var/src/pinba/mariadb/sql/sql_mode.h:126:3: error: โ€˜sql_mode_tโ€™ does not name a type
  126 |   sql_mode_t hard() const { return m_hard; }
      |   ^~~~~~~~~~
/var/src/pinba/mariadb/sql/sql_mode.h:127:3: error: โ€˜sql_mode_tโ€™ does not name a type
  127 |   sql_mode_t soft() const { return m_soft; }
      |   ^~~~~~~~~~
/var/src/pinba/mariadb/sql/sql_mode.h: In constructor โ€˜Sql_mode_dependency::Sql_mode_dependency()โ€™:
/var/src/pinba/mariadb/sql/sql_mode.h:121:5: error: class โ€˜Sql_mode_dependencyโ€™ does not have any field named โ€˜m_hardโ€™
  121 |    :m_hard(0), m_soft(0)
      |     ^~~~~~
/var/src/pinba/mariadb/sql/sql_mode.h:121:16: error: class โ€˜Sql_mode_dependencyโ€™ does not have any field named โ€˜m_softโ€™
  121 |    :m_hard(0), m_soft(0)
      |                ^~~~~~
/var/src/pinba/mariadb/sql/sql_mode.h: In member function โ€˜Sql_mode_dependency::operator bool() constโ€™:
/var/src/pinba/mariadb/sql/sql_mode.h:130:12: error: โ€˜m_hardโ€™ was not declared in this scope
  130 |     return m_hard > 0 || m_soft > 0;
      |            ^~~~~~
/var/src/pinba/mariadb/sql/sql_mode.h:130:26: error: โ€˜m_softโ€™ was not declared in this scope
  130 |     return m_hard > 0 || m_soft > 0;
      |                          ^~~~~~
/var/src/pinba/mariadb/sql/sql_mode.h: In member function โ€˜Sql_mode_dependency Sql_mode_dependency::operator|(const Sql_mode_dependency&) constโ€™:
/var/src/pinba/mariadb/sql/sql_mode.h:134:32: error: โ€˜m_hardโ€™ was not declared in this scope
  134 |     return Sql_mode_dependency(m_hard | other.m_hard, m_soft | other.m_soft);
      |                                ^~~~~~
/var/src/pinba/mariadb/sql/sql_mode.h:134:47: error: โ€˜const class Sql_mode_dependencyโ€™ has no member named โ€˜m_hardโ€™
  134 |     return Sql_mode_dependency(m_hard | other.m_hard, m_soft | other.m_soft);
      |                                               ^~~~~~
/var/src/pinba/mariadb/sql/sql_mode.h:134:55: error: โ€˜m_softโ€™ was not declared in this scope
  134 |     return Sql_mode_dependency(m_hard | other.m_hard, m_soft | other.m_soft);
      |                                                       ^~~~~~
/var/src/pinba/mariadb/sql/sql_mode.h:134:70: error: โ€˜const class Sql_mode_dependencyโ€™ has no member named โ€˜m_softโ€™
  134 |     return Sql_mode_dependency(m_hard | other.m_hard, m_soft | other.m_soft);
      |                                                                      ^~~~~~
/var/src/pinba/mariadb/sql/sql_mode.h: In member function โ€˜Sql_mode_dependency Sql_mode_dependency::operator&(const Sql_mode_dependency&) constโ€™:
/var/src/pinba/mariadb/sql/sql_mode.h:138:32: error: โ€˜m_hardโ€™ was not declared in this scope
  138 |     return Sql_mode_dependency(m_hard & other.m_hard, m_soft & other.m_soft);
      |                                ^~~~~~
/var/src/pinba/mariadb/sql/sql_mode.h:138:47: error: โ€˜const class Sql_mode_dependencyโ€™ has no member named โ€˜m_hardโ€™
  138 |     return Sql_mode_dependency(m_hard & other.m_hard, m_soft & other.m_soft);
      |                                               ^~~~~~
/var/src/pinba/mariadb/sql/sql_mode.h:138:55: error: โ€˜m_softโ€™ was not declared in this scope
  138 |     return Sql_mode_dependency(m_hard & other.m_hard, m_soft & other.m_soft);
      |                                                       ^~~~~~
/var/src/pinba/mariadb/sql/sql_mode.h:138:70: error: โ€˜const class Sql_mode_dependencyโ€™ has no member named โ€˜m_softโ€™
  138 |     return Sql_mode_dependency(m_hard & other.m_hard, m_soft & other.m_soft);
      |                                                                      ^~~~~~
/var/src/pinba/mariadb/sql/sql_mode.h: In member function โ€˜Sql_mode_dependency& Sql_mode_dependency::operator|=(const Sql_mode_dependency&)โ€™:
/var/src/pinba/mariadb/sql/sql_mode.h:142:5: error: โ€˜m_hardโ€™ was not declared in this scope
  142 |     m_hard|= other.m_hard;
      |     ^~~~~~
/var/src/pinba/mariadb/sql/sql_mode.h:142:20: error: โ€˜const class Sql_mode_dependencyโ€™ has no member named โ€˜m_hardโ€™
  142 |     m_hard|= other.m_hard;
      |                    ^~~~~~
/var/src/pinba/mariadb/sql/sql_mode.h:143:5: error: โ€˜m_softโ€™ was not declared in this scope
  143 |     m_soft|= other.m_soft;
      |     ^~~~~~
/var/src/pinba/mariadb/sql/sql_mode.h:143:20: error: โ€˜const class Sql_mode_dependencyโ€™ has no member named โ€˜m_softโ€™
  143 |     m_soft|= other.m_soft;
      |                    ^~~~~~
/var/src/pinba/mariadb/sql/sql_mode.h: In member function โ€˜Sql_mode_dependency& Sql_mode_dependency::operator&=(const Sql_mode_dependency&)โ€™:
/var/src/pinba/mariadb/sql/sql_mode.h:148:5: error: โ€˜m_hardโ€™ was not declared in this scope
  148 |     m_hard&= other.m_hard;
      |     ^~~~~~
/var/src/pinba/mariadb/sql/sql_mode.h:148:20: error: โ€˜const class Sql_mode_dependencyโ€™ has no member named โ€˜m_hardโ€™
  148 |     m_hard&= other.m_hard;
      |                    ^~~~~~
/var/src/pinba/mariadb/sql/sql_mode.h:149:5: error: โ€˜m_softโ€™ was not declared in this scope
  149 |     m_soft&= other.m_soft;
      |     ^~~~~~
/var/src/pinba/mariadb/sql/sql_mode.h:149:20: error: โ€˜const class Sql_mode_dependencyโ€™ has no member named โ€˜m_softโ€™
  149 |     m_soft&= other.m_soft;
      |                    ^~~~~~
/var/src/pinba/mariadb/sql/sql_mode.h: In member function โ€˜Sql_mode_dependency& Sql_mode_dependency::soft_to_hard()โ€™:
/var/src/pinba/mariadb/sql/sql_mode.h:154:5: error: โ€˜m_hardโ€™ was not declared in this scope
  154 |     m_hard|= m_soft;
      |     ^~~~~~
/var/src/pinba/mariadb/sql/sql_mode.h:154:14: error: โ€˜m_softโ€™ was not declared in this scope
  154 |     m_hard|= m_soft;
      |              ^~~~~~
In file included from /var/src/pinba/mariadb/sql/handler.h:30,
                 from ../mysql_engine/handler.h:8,
                 from plugin.cpp:4:
/var/src/pinba/mariadb/sql/mysqld.h: At global scope:
/var/src/pinba/mariadb/sql/mysqld.h:893:23: error: โ€˜query_id_tโ€™ was not declared in this scope
  893 | extern Atomic_counter<query_id_t> global_query_id;
      |                       ^~~~~~~~~~
/var/src/pinba/mariadb/sql/mysqld.h:893:33: error: template argument 1 is invalid
  893 | extern Atomic_counter<query_id_t> global_query_id;
      |                                 ^
/var/src/pinba/mariadb/sql/mysqld.h:896:44: error: โ€˜query_id_tโ€™ does not name a type
  896 | inline __attribute__((warn_unused_result)) query_id_t next_query_id()
      |                                            ^~~~~~~~~~
/var/src/pinba/mariadb/sql/mysqld.h:901:8: error: โ€˜query_id_tโ€™ does not name a type
  901 | inline query_id_t get_query_id()
      |        ^~~~~~~~~~
In file included from /var/src/pinba/mariadb/sql/handler.h:33,
                 from ../mysql_engine/handler.h:8,
                 from plugin.cpp:4:
/var/src/pinba/mariadb/sql/sql_cache.h:564:3: error: โ€˜sql_mode_tโ€™ does not name a type; did you mean โ€˜femode_tโ€™?
  564 |   sql_mode_t sql_mode;
      |   ^~~~~~~~~~
      |   femode_t
plugin.cpp: In function โ€˜int pinba_engine_init(void*)โ€™:
plugin.cpp:317:5: error: โ€˜struct handlertonโ€™ has no member named โ€˜stateโ€™
  317 |  h->state = SHOW_OPTION_YES;
      |     ^~~~~
make[2]: *** [Makefile:481: plugin.lo] Error 1
make[2]: Leaving directory '/var/src/pinba/pinba2/mysql_engine'
make[1]: *** [Makefile:496: all-recursive] Error 1
make[1]: Leaving directory '/var/src/pinba/pinba2'
make: *** [Makefile:386: all] Error 2

How can i solve my problem?

Thanks for attention on the matter

Docker Image does NOT build

@anton-povarov hey, I can' build docker image from master and getting following error:

g++ -DHAVE_CONFIG_H -I. -I..    -std=gnu++11 -fno-rtti  -pthread -Wall -Wextra -Wformat-security -Werror -Wno-unused -Wno-unused-parameter -Wno-unused-variable -Wno-missing-field-initializers -fno-omit-frame-pointer -fPIC -DPIC -D_GNU_SOURCE -D__STDC_FORMAT_MACROS -D_POSIX_SOURCE -maes -msse4 -msse4.2 -O3 -ffast-math -ggdb3 -mtune=native -pthread -I/_install/nanomsg/include -I/_src/meow -I/usr/include -I/usr -I.. -I../include   -MT report_by_packet.o -MD -MP -MF $depbase.Tpo -c -o report_by_packet.o report_by_packet.cpp &&\
mv -f $depbase.Tpo $depbase.Po
In file included from ../include/pinba/histogram.h:8:0,
                 from report_snapshot.cpp:3:
../include/pinba/hdr_histogram.h: In instantiation of 'bool hdr_histogram___impl_t<CounterT>::increment(const config_t&, int64_t, hdr_histogram___impl_t<CounterT>::counter_t) [with CounterT = unsigned int; hdr_histogram___impl_t<CounterT>::config_t = hdr_histogram_conf_t; int64_t = long int; hdr_histogram___impl_t<CounterT>::counter_t = unsigned int]':
../include/pinba/histogram.h:150:56:   required from here
../include/pinba/hdr_histogram.h:259:27: error: throw will always call terminate() [-Werror=terminate]
      throw std::bad_alloc();
                           ^
In file included from ../include/pinba/histogram.h:8:0,
                 from report_by_packet.cpp:8:
../include/pinba/hdr_histogram.h: In instantiation of 'bool hdr_histogram___impl_t<CounterT>::increment(const config_t&, int64_t, hdr_histogram___impl_t<CounterT>::counter_t) [with CounterT = unsigned int; hdr_histogram___impl_t<CounterT>::config_t = hdr_histogram_conf_t; int64_t = long int; hdr_histogram___impl_t<CounterT>::counter_t = unsigned int]':
../include/pinba/histogram.h:150:56:   required from here
../include/pinba/hdr_histogram.h:259:27: error: throw will always call terminate() [-Werror=terminate]
      throw std::bad_alloc();
                           ^
depbase=`echo report_by_request.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`;\
g++ -DHAVE_CONFIG_H -I. -I..    -std=gnu++11 -fno-rtti  -pthread -Wall -Wextra -Wformat-security -Werror -Wno-unused -Wno-unused-parameter -Wno-unused-variable -Wno-missing-field-initializers -fno-omit-frame-pointer -fPIC -DPIC -D_GNU_SOURCE -D__STDC_FORMAT_MACROS -D_POSIX_SOURCE -maes -msse4 -msse4.2 -O3 -ffast-math -ggdb3 -mtune=native -pthread -I/_install/nanomsg/include -I/_src/meow -I/usr/include -I/usr -I.. -I../include   -MT report_by_request.o -MD -MP -MF $depbase.Tpo -c -o report_by_request.o report_by_request.cpp &&\
mv -f $depbase.Tpo $depbase.Po
depbase=`echo report_by_timer.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`;\
g++ -DHAVE_CONFIG_H -I. -I..    -std=gnu++11 -fno-rtti  -pthread -Wall -Wextra -Wformat-security -Werror -Wno-unused -Wno-unused-parameter -Wno-unused-variable -Wno-missing-field-initializers -fno-omit-frame-pointer -fPIC -DPIC -D_GNU_SOURCE -D__STDC_FORMAT_MACROS -D_POSIX_SOURCE -maes -msse4 -msse4.2 -O3 -ffast-math -ggdb3 -mtune=native -pthread -I/_install/nanomsg/include -I/_src/meow -I/usr/include -I/usr -I.. -I../include   -MT report_by_timer.o -MD -MP -MF $depbase.Tpo -c -o report_by_timer.o report_by_timer.cpp &&\
mv -f $depbase.Tpo $depbase.Po
cc1plus: all warnings being treated as errors
Makefile:608: recipe for target 'report_snapshot.o' failed
make[2]: *** [report_snapshot.o] Error 1
make[2]: *** Waiting for unfinished jobs....
In file included from ../include/pinba/histogram.h:8:0,
                 from report_by_request.cpp:11:
../include/pinba/hdr_histogram.h: In instantiation of 'bool hdr_histogram___impl_t<CounterT>::increment(const config_t&, int64_t, hdr_histogram___impl_t<CounterT>::counter_t) [with CounterT = unsigned int; hdr_histogram___impl_t<CounterT>::config_t = hdr_histogram_conf_t; int64_t = long int; hdr_histogram___impl_t<CounterT>::counter_t = unsigned int]':
../include/pinba/histogram.h:150:56:   required from here
../include/pinba/hdr_histogram.h:259:27: error: throw will always call terminate() [-Werror=terminate]
      throw std::bad_alloc();
                           ^
cc1plus: all warnings being treated as errors
Makefile:608: recipe for target 'report_by_packet.o' failed
make[2]: *** [report_by_packet.o] Error 1
In file included from ../include/pinba/histogram.h:8:0,
                 from report_by_timer.cpp:17:
../include/pinba/hdr_histogram.h: In instantiation of 'bool hdr_histogram___impl_t<CounterT>::increment(const config_t&, int64_t, hdr_histogram___impl_t<CounterT>::counter_t) [with CounterT = unsigned int; hdr_histogram___impl_t<CounterT>::config_t = hdr_histogram_conf_t; int64_t = long int; hdr_histogram___impl_t<CounterT>::counter_t = unsigned int]':
../include/pinba/histogram.h:150:56:   required from here
../include/pinba/hdr_histogram.h:259:27: error: throw will always call terminate() [-Werror=terminate]
      throw std::bad_alloc();
                           ^
cc1plus: all warnings being treated as errors
make[2]: *** [report_by_timer.o] Error 1
Makefile:608: recipe for target 'report_by_timer.o' failed
cc1plus: all warnings being treated as errors
Makefile:608: recipe for target 'report_by_request.o' failed
make[2]: *** [report_by_request.o] Error 1
make[2]: Leaving directory '/_src/pinba2/src'
Makefile:493: recipe for target 'all-recursive' failed
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory '/_src/pinba2'
make: *** [all] Error 2
Makefile:383: recipe for target 'all' failed
The command '/bin/sh -c /_src/pinba2/docker/build-from-source.sh' returned a non-zero code: 2

Full log here: Log at 2018-10-08 14-12-12.txt

P. S.

Do you have ready-to use docker image?

Improve manual build instructions for centos7 (maybe add pre-built docker images)

Here's the HOWTO from Alexey Medov building on centos7 + mariadb 10.2
A nice starting point.

ะ”ะพะฑะฐะฒะปัะตะผ ั€ะตะฟะพะทะธั‚ะพั€ะธะน ะฝัƒะถะฝะพะน ะฒะตั€ัะธะธ MariaDB ะฟะพ ะธะฝัั‚ั€ัƒะบั†ะธะธ ะฟะพ ััั‹ะปะบะต
https://downloads.mariadb.org/mariadb/repositories/#mirror=mephi&distro=CentOS&distro_release=centos7-amd64--centos7&version=10.2

ะะฐ ั‚ะพั‚ ัะปัƒั‡ะฐะน ะตัะปะธ ััั‹ะปะบะฐ ะฝะต ั€ะฐะฑะพั‚ะฐะตั‚, ะฝัƒะถะฝะพ ัะพะทะดะฐั‚ัŒ ั„ะฐะนะป /etc/yum.repos.d/MariaDB.repo ะธ ะฟั€ะพะฟะธัะฐั‚ัŒ ะฒ ะฝะตะณะพ ัะปะตะดัƒัŽั‰ะธะน ั‚ะตะบัั‚:

MariaDB 10.2 CentOS repository list - created 2019-03-06 07:50 UTC

http://downloads.mariadb.org/mariadb/repositories/

[mariadb]
name = MariaDB
baseurl = http://yum.mariadb.org/10.2/centos7-amd64
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=1

ะŸะพั‚ะพะผ ะฒั‹ะฟะพะปะฝัะตะผ:
sudo rpm --import https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
yum clean metadata
yum install MariaDB-backup MariaDB-client MariaDB-common MariaDB-compat MariaDB-server MariaDB-shared
mysql --version

==========================================================================

yum install autoconf automake cmake make git libtool ncurses-devel openssl-devel
yum install centos-release-scl
yum install devtoolset-6-gcc*
scl enable devtoolset-6 bash
which gcc
gcc --version
yum install git -y
mkdir /_install
mkdir /build_folder
cd /build_folder/

git clone https://github.com/anton-povarov/meow.git
git clone https://github.com/badoo/pinba2.git
git clone https://github.com/nanomsg/nanomsg.git
wget https://dl.bintray.com/boostorg/release/1.69.0/source/boost_1_69_0_rc1.tar.gz
tar -xzf boost_1_69_0_rc1.tar.gz
rm -rf boost_1_69_0_rc1.tar.gz

ะšะฐั‡ะฐะตะผ ะฝัƒะถะฝัƒัŽ ะฒะตั€ัะธัŽ ะธัั…ะพะดะฝะธะบะพะฒ MariaDB ั ะพั„ะธั†ะธะฐะปัŒะฝะพะณะพ ัะฐะนั‚ะฐ https://downloads.mariadb.org/mariadb/10.2.22/
wget http://mirror.mephi.ru/mariadb//mariadb-10.2.22/source/mariadb-10.2.22.tar.gz
tar -xzf mariadb-10.2.22.tar.gz
rm -rf mariadb-10.2.22.tar.gz
cd mariadb-10.2.22
yum-builddep mariadb-server
yum install bison libxml2-devel libevent-devel rpm-build
scl enable devtoolset-6 bash ; rm -rf CMakeCache.txt ; make clean ; cmake -DRPM=centos7 . ; make -j 6

cd ../nanomsg
cmake -DNN_STATIC_LIB=ON -DNN_ENABLE_DOC=OFF -NN_MAX_SOCKETS=4096 -DCMAKE_C_FLAGS="-fPIC -DPIC" -DCMAKE_INSTALL_PREFIX=/_install/nanomsg -DCMAKE_INSTALL_LIBDIR=lib .
make ; make install

cd ../pinba2
./buildconf.sh
./configure --prefix=/_install/pinba2 --with-mysql=/build_folder/mariadb-10.2.22/ --with-nanomsg=/_install/nanomsg --with-meow=/build_folder/meow/ --with-boost=/build_folder/boost_1_69_0 --enable-libmysqlservices
systemctl start mariadb && systemctl enable mariadb && systemctl status mariadb
yum install mariadb-devel
mysql_secure_installation

ะ”ะฐะปะตะต ะดะพะฑะฐะฒะปัะตะผ ะฒ ั„ะฐะนะป /etc/my.cnf.d/server.conf ะฒ ัะตะบั†ะธัŽ [mysqld] ัั‚ั€ะพะบัƒ:
plugin_maturity=unknown
service mysqld restart && service mariadb restart
cp mysql_engine/.libs/libpinba_engine2.so mysql_config --plugindir
semanage permissive -a mysqld_t
echo "install plugin PINBA soname 'libpinba_engine2.so';" | mysql -uroot -p
echo "create database pinba;" | mysql -uroot -p
cat scripts/default_reports.sql | mysql -uroot -p
cat scripts/default_tables/active.sql | mysql -uroot -p
cat scripts/default_tables/info.sql | mysql -uroot -p
cat scripts/default_tables/stats.sql | mysql -uroot -p

ะŸั€ะพะฑะปะตะผะฐ ะฟั€ะธ ะบะพะผะฟะธะปัั†ะธะธ pinba2

ะ—ะดั€ะฐะฒัั‚ะฒัƒะนั‚ะต.
ะŸะพะดัะบะฐะถะธั‚ะต ะฒ ั‡ะตะผ ะผะพะถะตั‚ ะฑั‹ั‚ัŒ ะฟั€ะพะฑะปะตะผะฐ. ะ•ัั‚ัŒ debian 8.11, ะฟั‹ั‚ะฐัŽััŒ ัะบะพะผะฟะธะปะธั€ะพะฒะฐั‚ัŒ pinba2 ะฟะพ ะธะฝัั‚ั€ัƒะบั†ะธะธ, ะฝะพ ะฝะฐ ัั‚ะฐะฟะต "make" ะฟะพะปัƒั‡ะฐัŽ ัะปะตะดัƒัŽั‰ะธะต ะพั„ะธะฑะบะธ:

In file included from globals.cpp:15:0:
../include/pinba/dictionary.h:131:72: error: expected โ€˜,โ€™ before โ€˜)โ€™ token
static_assert(std::is_nothrow_move_constructible<nameword_t>::value);
^
../include/pinba/dictionary.h:131:72: error: expected string-literal before โ€˜)โ€™ token
../include/pinba/dictionary.h: In member function โ€˜const nameword_dictionary_t::nameword_t* nameword_dictionary_t::insert_with_external_locking(meow::str_ref)โ€™:
../include/pinba/dictionary.h:219:2: error: could not convert โ€˜{word_id, pinba::hash_number(((uint32_t)word_id)), word_hash}โ€™ from โ€˜โ€™ to โ€˜nameword_dictionary_t::nameword_tโ€™
};
^
globals.cpp: At global scope:
globals.cpp:207:90: error: expected โ€˜,โ€™ or โ€˜;โ€™ before โ€˜PINBA_VCS_FULL_HASHโ€™
volatile char const pinba_version_info[] = "pinba_version_info " PINBA_VERSION " git: " PINBA_VCS_FULL_HASH " modified: " PINBA_VCS_WC_MODIFIED;
^
Makefile:580: ะพัˆะธะฑะบะฐ ะฒั‹ะฟะพะปะฝะตะฝะธั ั€ะตั†ะตะฟั‚ะฐ ะดะปั ั†ะตะปะธ ยซglobals.oยป
make[2]: *** [globals.o] ะžัˆะธะฑะบะฐ 1
make[2]: ะฒั‹ั…ะพะด ะธะท ะบะฐั‚ะฐะปะพะณะฐ ยซ/home/vladimir/pinba/pinba2-master/srcยป
Makefile:483: ะพัˆะธะฑะบะฐ ะฒั‹ะฟะพะปะฝะตะฝะธั ั€ะตั†ะตะฟั‚ะฐ ะดะปั ั†ะตะปะธ ยซall-recursiveยป
make[1]: *** [all-recursive] ะžัˆะธะฑะบะฐ 1
make[1]: ะฒั‹ั…ะพะด ะธะท ะบะฐั‚ะฐะปะพะณะฐ ยซ/home/vladimir/pinba/pinba2-masterยป
Makefile:372: ะพัˆะธะฑะบะฐ ะฒั‹ะฟะพะปะฝะตะฝะธั ั€ะตั†ะตะฟั‚ะฐ ะดะปั ั†ะตะปะธ ยซallยป
make: *** [all] ะžัˆะธะฑะบะฐ 2

ะŸะพะดัะบะฐะถะธั‚ะต, ั‡ั‚ะพ ะธ ะณะดะต ะฟะพะดะฟั€ะฐะฒะธั‚ัŒ. ะกะฟะฐัะธะฑะพ.

ะžัˆะธะฑะบะธ ะฟั€ะธ ัะฑะพั€ะบะต.

/bin/bash ../libtool --preserve-dup-deps --tag=CXX --mode=link g++ -std=c++14 -fno-rtti -pthread -Wformat -Wformat-security -Werror -Wno-unused -Wno-unused-parameter -Wno-unused-variable -Wno-missing-field-initializers -Wno-parentheses -fno-omit-frame-pointer -fPIC -DPIC -D_GNU_SOURCE -D_POSIX_SOURCE -maes -msse4 -msse4.2 -O3 -ffast-math -ggdb3 -mtune=native -I../third_party -I../third_party/robin-map/include -pthread -I/usr/local/include -I/usr/src/meow/ -I/usr/include -I/usr -I../include -flto
-lrt -ldl -rdynamic -lanl -o pinba2 main.o libpinba2.a ../third_party/t1ha/libt1ha.a /usr/local/lib/libnanomsg.a
libtool: link: g++ -std=c++14 -fno-rtti -pthread -Wformat -Wformat-security -Werror -Wno-unused -Wno-unused-parameter -Wno-unused-variable -Wno-missing-field-initializers -Wno-parentheses -fno-omit-frame-pointer -fPIC -DPIC -D_GNU_SOURCE -D_POSIX_SOURCE -maes -msse4 -msse4.2 -O3 -ffast-math -ggdb3 -mtune=native -I../third_party -I../third_party/robin-map/include -pthread -I/usr/local/include -I/usr/src/meow/ -I/usr/include -I/usr -I../include -flto -rdynamic -o pinba2 main.o -lrt -ldl -lanl libpinba2.a ../third_party/t1ha/libt1ha.a /usr/local/lib/libnanomsg.a -pthread
libpinba2.a(os_symbols.o): In function (anonymous namespace)::aux::pinba_os_symbols_impl_t::~pinba_os_symbols_impl_t()': /usr/src/pinba2/src/os_symbols.cpp:27: undefined reference to dlclose'
libpinba2.a(os_symbols.o): In function pinba_os_symbols___init(pinba_globals_t*)': /usr/src/pinba2/src/os_symbols.cpp:17: undefined reference to dlopen'
/usr/src/pinba2/src/os_symbols.cpp:19: undefined reference to dlerror' libpinba2.a(os_symbols.o): In function (anonymous namespace)::aux::pinba_os_symbols_impl_t::resolve(meow::string_ref)':
/usr/src/pinba2/src/os_symbols.cpp:42: undefined reference to dlerror' /usr/src/pinba2/src/os_symbols.cpp:44: undefined reference to dlsym'
/usr/src/pinba2/src/os_symbols.cpp:45: undefined reference to dlerror' libpinba2.a(os_symbols.o): In function (anonymous namespace)::aux::pinba_os_symbols_impl_t::~pinba_os_symbols_impl_t()':
/usr/src/pinba2/src/os_symbols.cpp:27: undefined reference to `dlclose'
collect2: error: ld returned 1 exit status
Makefile:543: recipe for target 'pinba2' failed
make[2]: *** [pinba2] Error 1
make[2]: Leaving directory '/usr/src/pinba2/src'
Makefile:494: recipe for target 'all-recursive' failed

make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory '/usr/src/pinba2'
Makefile:384: recipe for target 'all' failed
make: *** [all] Error 2

No` LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 18.04.5 LTS
Release: 18.04
Codename: bionic

Mariadb 10.2

ะะต ะผะพะณัƒ ะฟะพะฝัั‚ัŒ ะฒ ั‡ั‘ะผ ะดะตะปะพ. ะŸะพะผะพะณะธั‚ะต ะฟะพะถะฐะปัƒะนัั‚ะฐ.

MySQL died after PHP send data to it.

Here is what I got in logs

2018-11-29  1:21:57 139656613899008 [Warning] IP address '172.18.0.1' could not be resolved: Name or service not known
181129  1:23:23 [ERROR] mysqld got signal 11 ;
This could be because you hit a bug. It is also possible that this binary
or one of the libraries it was linked against is corrupt, improperly built,
or misconfigured. This error can also be caused by malfunctioning hardware.
To report this bug, see https://mariadb.com/kb/en/reporting-bugs
We will try our best to scrape up some info that will hopefully help
diagnose the problem, but since we have already crashed,
something is definitely wrong and this may fail.
Server version: 10.1.26-MariaDB
key_buffer_size=134217728
read_buffer_size=131072
max_used_connections=1
max_threads=153
thread_count=0
It is possible that mysqld could use up to
key_buffer_size + (read_buffer_size + sort_buffer_size)*max_threads = 467133 K  bytes of memory
Hope that's ok; if not, decrease some variables in the equation.
Thread pointer: 0x0
Attempting backtrace. You can use the following information to find out
where mysqld died. If you see no messages after this, something went
terribly wrong...

After it, MySQL could not start and docker container goes in crush loop:

+ '[' mysqld = mysqld ']'
+ ln -snf /usr/libexec/mysqld /usr/local/bin
+ rm -rf /etc/my.cnf.d/auth_gssapi.cnf
+ mysql_install_db --rpm
my_print_defaults: [ERROR] unknown option '--mysqld'
2018-11-29  1:23:25 140014962817344 [Note] /usr/libexec/mysqld (mysqld 10.1.26-MariaDB) starting as process 18 ...
2018-11-29  1:23:29 140588855441728 [Note] /usr/libexec/mysqld (mysqld 10.1.26-MariaDB) starting as process 49 ...
2018-11-29  1:23:32 140083679729984 [Note] /usr/libexec/mysqld (mysqld 10.1.26-MariaDB) starting as process 79 ...
PLEASE REMEMBER TO SET A PASSWORD FOR THE MariaDB root USER !
To do so, start the server, then issue the following commands:
'/usr/bin/mysqladmin' -u root password 'new-password'
'/usr/bin/mysqladmin' -u root -h b02202262875 password 'new-password'
Alternatively you can run:
'/usr/bin/mysql_secure_installation'
which will also give you the option of removing the test
databases and anonymous user created by default.  This is
strongly recommended for production servers.
See the MariaDB Knowledgebase at http://mariadb.com/kb or the
MySQL manual for more instructions.
Please report any problems at http://mariadb.org/jira
The latest information about MariaDB is available at http://mariadb.org/.
You can find additional information about the MySQL part at:
http://dev.mysql.com
Consider joining MariaDB's strong and vibrant community:
https://mariadb.org/get-involved/
+ chmod -R 777 /var/lib/mysql
+ pid=107
+ for i in '{10..0}'
+ mysqld --skip-networking -umysql
+ mysql
+ echo 'SELECT 1'
+ echo 'MySQL init process in progress...'
+ sleep 1
MySQL init process in progress...
2018-11-29  1:23:35 139764970879296 [Note] mysqld (mysqld 10.1.26-MariaDB) starting as process 107 ...
2018-11-29 01:23:35 107 [Note] PINBA: engine initialized on 0.0.0.0:3002
2018-11-29  1:23:35 139764970879296 [Note] InnoDB: innodb_empty_free_list_algorithm has been changed to legacy because of small buffer pool size. In order to use backoff, increase buffer pool at least up to 20MB.
2018-11-29  1:23:35 139764970879296 [Note] InnoDB: Using mutexes to ref count buffer pool pages
2018-11-29  1:23:35 139764970879296 [Note] InnoDB: The InnoDB memory heap is disabled
2018-11-29  1:23:35 139764970879296 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2018-11-29  1:23:35 139764970879296 [Note] InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier
2018-11-29  1:23:35 139764970879296 [Note] InnoDB: Compressed tables use zlib 1.2.8
2018-11-29  1:23:35 139764970879296 [Note] InnoDB: Using Linux native AIO
2018-11-29  1:23:35 139764970879296 [Note] InnoDB: Using SSE crc32 instructions
2018-11-29  1:23:35 139764970879296 [Note] InnoDB: Initializing buffer pool, size = 128.0M
2018-11-29  1:23:35 139764970879296 [Note] InnoDB: Completed initialization of buffer pool
2018-11-29  1:23:35 139764970879296 [Note] InnoDB: Highest supported file format is Barracuda.
2018-11-29  1:23:35 139764970879296 [Note] InnoDB: 128 rollback segment(s) are active.
2018-11-29  1:23:35 139764970879296 [Note] InnoDB: Waiting for purge to start
2018-11-29  1:23:35 139764970879296 [Note] InnoDB:  Percona XtraDB (http://www.percona.com) 5.6.36-82.1 started; log sequence number 1616869
2018-11-29  1:23:35 139763868759808 [Note] InnoDB: Dumping buffer pool(s) not yet started
2018-11-29  1:23:35 139764970879296 [Note] Plugin 'FEEDBACK' is disabled.
2018-11-29  1:23:35 139764970879296 [Note] mysqld: ready for connections.
Version: '10.1.26-MariaDB'  socket: '/var/lib/mysql/mysql.sock'  port: 0  MariaDB Server
+ for i in '{10..0}'
+ mysql
+ echo 'SELECT 1'
+ echo 'MySQL init process in progress...'
+ sleep 1
MySQL init process in progress...
+ for i in '{10..0}'
+ echo 'SELECT 1'
+ mysql
+ echo 'MySQL init process in progress...'
+ sleep 1
MySQL init process in progress...
+ for i in '{10..0}'
+ echo 'SELECT 1'
+ mysql
+ echo 'MySQL init process in progress...'
+ sleep 1
MySQL init process in progress...
+ for i in '{10..0}'
+ mysql
+ echo 'SELECT 1'
MySQL init process in progress...
+ echo 'MySQL init process in progress...'
+ sleep 1
+ for i in '{10..0}'
+ echo 'SELECT 1'
+ mysql
MySQL init process in progress...
+ echo 'MySQL init process in progress...'
+ sleep 1
+ for i in '{10..0}'
+ echo 'SELECT 1'
+ mysql
+ echo 'MySQL init process in progress...'
+ sleep 1
MySQL init process in progress...
+ for i in '{10..0}'
+ echo 'SELECT 1'
+ mysql
+ echo 'MySQL init process in progress...'
+ sleep 1
MySQL init process in progress...
+ for i in '{10..0}'
+ echo 'SELECT 1'
+ mysql
MySQL init process in progress...
+ echo 'MySQL init process in progress...'
+ sleep 1
+ for i in '{10..0}'
+ echo 'SELECT 1'
+ mysql
+ echo 'MySQL init process in progress...'
+ sleep 1
MySQL init process in progress...
+ for i in '{10..0}'
+ echo 'SELECT 1'
+ mysql
+ echo 'MySQL init process in progress...'
MySQL init process in progress...
+ sleep 1
+ '[' 0 = 0 ']'
+ echo 'MySQL init process failed.'
MySQL init process failed.
+ exit 1

Following SQL was applied to MySQL. It was generated using https://github.com/badoo/pinba2/blob/master/scripts/convert_mysqldump.php

GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' identified by '***';
update mysql.user set password=PASSWORD("***") where User='root';

CREATE USER IF NOT EXISTS 'manager'@'%' IDENTIFIED BY '***';
GRANT ALL PRIVILEGES ON * . * TO 'manager'@'%';

CREATE USER IF NOT EXISTS 'pinboard'@'%' IDENTIFIED BY '***';
GRANT ALL PRIVILEGES ON * . * TO 'pinboard'@'%';
FLUSH PRIVILEGES;

CREATE DATABASE IF NOT EXISTS pinba DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_unicode_ci;

use pinba;

DROP TABLE IF EXISTS report_by_script_name;

CREATE TABLE `report_by_script_name` (
  `script_name` varchar(128) NOT NULL,
  `req_count` int(10) unsigned NOT NULL,
  `req_per_sec` float NOT NULL,
  `req_time_total` float NOT NULL,
  `req_time_per_sec` float NOT NULL,
  `ru_utime_total` float NOT NULL,
  `ru_utime_per_sec` float NOT NULL,
  `ru_stime_total` float NOT NULL,
  `ru_stime_per_sec` float NOT NULL,
  `traffic_total` bigint(20) unsigned NOT NULL,
  `traffic_per_sec` float NOT NULL,
  `memory_footprint` bigint(20) NOT NULL,
  `p50` float NOT NULL
) ENGINE=PINBA DEFAULT CHARSET=latin1 COMMENT='v2/request/default_history_time/~script/hv=0:60000:32768,p50/no_filters';

DROP TABLE IF EXISTS report_by_server_name;

CREATE TABLE `report_by_server_name` (
  `server_name` varchar(64) NOT NULL,
  `req_count` int(10) unsigned NOT NULL,
  `req_per_sec` float NOT NULL,
  `req_time_total` float NOT NULL,
  `req_time_per_sec` float NOT NULL,
  `ru_utime_total` float NOT NULL,
  `ru_utime_per_sec` float NOT NULL,
  `ru_stime_total` float NOT NULL,
  `ru_stime_per_sec` float NOT NULL,
  `traffic_total` bigint(20) unsigned NOT NULL,
  `traffic_per_sec` float NOT NULL,
  `memory_footprint` bigint(20) NOT NULL,
  `p50` float NOT NULL
) ENGINE=PINBA DEFAULT CHARSET=latin1 COMMENT='v2/request/default_history_time/~server/hv=0:60000:32768,p50/no_filters';

DROP TABLE IF EXISTS report_by_hostname;

CREATE TABLE `report_by_hostname` (
  `hostname` varchar(32) NOT NULL,
  `req_count` int(10) unsigned NOT NULL,
  `req_per_sec` float NOT NULL,
  `req_time_total` float NOT NULL,
  `req_time_per_sec` float NOT NULL,
  `ru_utime_total` float NOT NULL,
  `ru_utime_per_sec` float NOT NULL,
  `ru_stime_total` float NOT NULL,
  `ru_stime_per_sec` float NOT NULL,
  `traffic_total` bigint(20) unsigned NOT NULL,
  `traffic_per_sec` float NOT NULL,
  `memory_footprint` bigint(20) NOT NULL,
  `p50` float NOT NULL
) ENGINE=PINBA DEFAULT CHARSET=latin1 COMMENT='v2/request/default_history_time/~host/hv=0:60000:32768,p50/no_filters';

DROP TABLE IF EXISTS report_by_server_and_script;

CREATE TABLE `report_by_server_and_script` (
  `server_name` varchar(64) NOT NULL,
  `script_name` varchar(128) NOT NULL,
  `req_count` int(10) unsigned NOT NULL,
  `req_per_sec` float NOT NULL,
  `req_time_total` float NOT NULL,
  `req_time_per_sec` float NOT NULL,
  `ru_utime_total` float NOT NULL,
  `ru_utime_per_sec` float NOT NULL,
  `ru_stime_total` float NOT NULL,
  `ru_stime_per_sec` float NOT NULL,
  `traffic_total` bigint(20) unsigned NOT NULL,
  `traffic_per_sec` float NOT NULL,
  `memory_footprint` bigint(20) NOT NULL,
  `p50` float NOT NULL
) ENGINE=PINBA DEFAULT CHARSET=latin1 COMMENT='v2/request/default_history_time/~server,~script/hv=0:60000:32768,p50/no_filters';

DROP TABLE IF EXISTS report_by_hostname_and_script;

CREATE TABLE `report_by_hostname_and_script` (
  `hostname` varchar(32) NOT NULL,
  `script_name` varchar(128) NOT NULL,
  `req_count` int(10) unsigned NOT NULL,
  `req_per_sec` float NOT NULL,
  `req_time_total` float NOT NULL,
  `req_time_per_sec` float NOT NULL,
  `ru_utime_total` float NOT NULL,
  `ru_utime_per_sec` float NOT NULL,
  `ru_stime_total` float NOT NULL,
  `ru_stime_per_sec` float NOT NULL,
  `traffic_total` bigint(20) unsigned NOT NULL,
  `traffic_per_sec` float NOT NULL,
  `memory_footprint` bigint(20) NOT NULL,
  `p50` float NOT NULL
) ENGINE=PINBA DEFAULT CHARSET=latin1 COMMENT='v2/request/default_history_time/~host,~script/hv=0:60000:32768,p50/no_filters';

DROP TABLE IF EXISTS report_by_hostname_and_server;

CREATE TABLE `report_by_hostname_and_server` (
  `hostname` varchar(32) NOT NULL,
  `server_name` varchar(64) NOT NULL,
  `req_count` int(10) unsigned NOT NULL,
  `req_per_sec` float NOT NULL,
  `req_time_total` float NOT NULL,
  `req_time_per_sec` float NOT NULL,
  `ru_utime_total` float NOT NULL,
  `ru_utime_per_sec` float NOT NULL,
  `ru_stime_total` float NOT NULL,
  `ru_stime_per_sec` float NOT NULL,
  `traffic_total` bigint(20) unsigned NOT NULL,
  `traffic_per_sec` float NOT NULL,
  `memory_footprint` bigint(20) NOT NULL,
  `p50` float NOT NULL
) ENGINE=PINBA DEFAULT CHARSET=latin1 COMMENT='v2/request/default_history_time/~host,~server/hv=0:60000:32768,p50/no_filters';

DROP TABLE IF EXISTS report_by_hostname_server_and_script;

CREATE TABLE `report_by_hostname_server_and_script` (
  `hostname` varchar(32) NOT NULL,
  `server_name` varchar(64) NOT NULL,
  `script_name` varchar(128) NOT NULL,
  `req_count` int(10) unsigned NOT NULL,
  `req_per_sec` float NOT NULL,
  `req_time_total` float NOT NULL,
  `req_time_per_sec` float NOT NULL,
  `ru_utime_total` float NOT NULL,
  `ru_utime_per_sec` float NOT NULL,
  `ru_stime_total` float NOT NULL,
  `ru_stime_per_sec` float NOT NULL,
  `traffic_total` bigint(20) unsigned NOT NULL,
  `traffic_per_sec` float NOT NULL,
  `memory_footprint` bigint(20) NOT NULL,
  `p50` float NOT NULL
) ENGINE=PINBA DEFAULT CHARSET=latin1 COMMENT='v2/request/default_history_time/~host,~server,~script/hv=0:60000:32768,p50/no_filters';

DROP TABLE IF EXISTS report_by_status;

CREATE TABLE `report_by_status` (
  `status` int(11) NOT NULL,
  `req_count` int(10) unsigned NOT NULL,
  `req_per_sec` float NOT NULL,
  `req_time_total` float NOT NULL,
  `req_time_per_sec` float NOT NULL,
  `ru_utime_total` float NOT NULL,
  `ru_utime_per_sec` float NOT NULL,
  `ru_stime_total` float NOT NULL,
  `ru_stime_per_sec` float NOT NULL,
  `traffic_total` bigint(20) unsigned NOT NULL,
  `traffic_per_sec` float NOT NULL,
  `memory_footprint` bigint(20) NOT NULL,
  `p50` float NOT NULL
) ENGINE=PINBA DEFAULT CHARSET=latin1 COMMENT='v2/request/default_history_time/~status/hv=0:60000:32768,p50/no_filters';

DROP TABLE IF EXISTS report_by_script_and_status;

CREATE TABLE `report_by_script_and_status` (
  `script_name` varchar(128) NOT NULL,
  `status` int(11) NOT NULL,
  `req_count` int(10) unsigned NOT NULL,
  `req_per_sec` float NOT NULL,
  `req_time_total` float NOT NULL,
  `req_time_per_sec` float NOT NULL,
  `ru_utime_total` float NOT NULL,
  `ru_utime_per_sec` float NOT NULL,
  `ru_stime_total` float NOT NULL,
  `ru_stime_per_sec` float NOT NULL,
  `traffic_total` bigint(20) unsigned NOT NULL,
  `traffic_per_sec` float NOT NULL,
  `memory_footprint` bigint(20) NOT NULL,
  `p50` float NOT NULL
) ENGINE=PINBA DEFAULT CHARSET=latin1 COMMENT='v2/request/default_history_time/~script,~status/hv=0:60000:32768,p50/no_filters';

DROP TABLE IF EXISTS report_by_server_and_status;

CREATE TABLE `report_by_server_and_status` (
  `server_name` varchar(64) NOT NULL,
  `status` int(11) NOT NULL,
  `req_count` int(10) unsigned NOT NULL,
  `req_per_sec` float NOT NULL,
  `req_time_total` float NOT NULL,
  `req_time_per_sec` float NOT NULL,
  `ru_utime_total` float NOT NULL,
  `ru_utime_per_sec` float NOT NULL,
  `ru_stime_total` float NOT NULL,
  `ru_stime_per_sec` float NOT NULL,
  `traffic_total` bigint(20) unsigned NOT NULL,
  `traffic_per_sec` float NOT NULL,
  `memory_footprint` bigint(20) NOT NULL,
  `p50` float NOT NULL
) ENGINE=PINBA DEFAULT CHARSET=latin1 COMMENT='v2/request/default_history_time/~server,~status/hv=0:60000:32768,p50/no_filters';

DROP TABLE IF EXISTS report_by_hostname_and_status;

CREATE TABLE `report_by_hostname_and_status` (
  `hostname` varchar(32) NOT NULL,
  `status` int(11) NOT NULL,
  `req_count` int(10) unsigned NOT NULL,
  `req_per_sec` float NOT NULL,
  `req_time_total` float NOT NULL,
  `req_time_per_sec` float NOT NULL,
  `ru_utime_total` float NOT NULL,
  `ru_utime_per_sec` float NOT NULL,
  `ru_stime_total` float NOT NULL,
  `ru_stime_per_sec` float NOT NULL,
  `traffic_total` bigint(20) unsigned NOT NULL,
  `traffic_per_sec` float NOT NULL,
  `memory_footprint` bigint(20) NOT NULL,
  `p50` float NOT NULL
) ENGINE=PINBA DEFAULT CHARSET=latin1 COMMENT='v2/request/default_history_time/~host,~status/hv=0:60000:32768,p50/no_filters';

DROP TABLE IF EXISTS report_by_hostname_script_and_status;

CREATE TABLE `report_by_hostname_script_and_status` (
  `hostname` varchar(32) NOT NULL,
  `script_name` varchar(128) NOT NULL,
  `status` int(11) NOT NULL,
  `req_count` int(10) unsigned NOT NULL,
  `req_per_sec` float NOT NULL,
  `req_time_total` float NOT NULL,
  `req_time_per_sec` float NOT NULL,
  `ru_utime_total` float NOT NULL,
  `ru_utime_per_sec` float NOT NULL,
  `ru_stime_total` float NOT NULL,
  `ru_stime_per_sec` float NOT NULL,
  `traffic_total` bigint(20) unsigned NOT NULL,
  `traffic_per_sec` float NOT NULL,
  `memory_footprint` bigint(20) NOT NULL,
  `p50` float NOT NULL
) ENGINE=PINBA DEFAULT CHARSET=latin1 COMMENT='v2/request/default_history_time/~host,~script,~status/hv=0:60000:32768,p50/no_filters';

DROP TABLE IF EXISTS report_by_schema;

CREATE TABLE `report_by_schema` (
  `schema` varchar(16) NOT NULL,
  `req_count` int(10) unsigned NOT NULL,
  `req_per_sec` float NOT NULL,
  `req_time_total` float NOT NULL,
  `req_time_per_sec` float NOT NULL,
  `ru_utime_total` float NOT NULL,
  `ru_utime_per_sec` float NOT NULL,
  `ru_stime_total` float NOT NULL,
  `ru_stime_per_sec` float NOT NULL,
  `traffic_total` bigint(20) unsigned NOT NULL,
  `traffic_per_sec` float NOT NULL,
  `memory_footprint` bigint(20) NOT NULL,
  `p50` float NOT NULL
) ENGINE=PINBA DEFAULT CHARSET=latin1 COMMENT='v2/request/default_history_time/~schema/hv=0:60000:32768,p50/no_filters';

DROP TABLE IF EXISTS report_by_script_and_schema;

CREATE TABLE `report_by_script_and_schema` (
  `script_name` varchar(128) NOT NULL,
  `schema` varchar(16) NOT NULL,
  `req_count` int(10) unsigned NOT NULL,
  `req_per_sec` float NOT NULL,
  `req_time_total` float NOT NULL,
  `req_time_per_sec` float NOT NULL,
  `ru_utime_total` float NOT NULL,
  `ru_utime_per_sec` float NOT NULL,
  `ru_stime_total` float NOT NULL,
  `ru_stime_per_sec` float NOT NULL,
  `traffic_total` bigint(20) unsigned NOT NULL,
  `traffic_per_sec` float NOT NULL,
  `memory_footprint` bigint(20) NOT NULL,
  `p50` float NOT NULL
) ENGINE=PINBA DEFAULT CHARSET=latin1 COMMENT='v2/request/default_history_time/~script,~schema/hv=0:60000:32768,p50/no_filters';

DROP TABLE IF EXISTS report_by_server_and_schema;

CREATE TABLE `report_by_server_and_schema` (
  `server_name` varchar(64) NOT NULL,
  `schema` varchar(16) NOT NULL,
  `req_count` int(10) unsigned NOT NULL,
  `req_per_sec` float NOT NULL,
  `req_time_total` float NOT NULL,
  `req_time_per_sec` float NOT NULL,
  `ru_utime_total` float NOT NULL,
  `ru_utime_per_sec` float NOT NULL,
  `ru_stime_total` float NOT NULL,
  `ru_stime_per_sec` float NOT NULL,
  `traffic_total` bigint(20) unsigned NOT NULL,
  `traffic_per_sec` float NOT NULL,
  `memory_footprint` bigint(20) NOT NULL,
  `p50` float NOT NULL
) ENGINE=PINBA DEFAULT CHARSET=latin1 COMMENT='v2/request/default_history_time/~server,~schema/hv=0:60000:32768,p50/no_filters';

DROP TABLE IF EXISTS report_by_hostname_and_schema;

CREATE TABLE `report_by_hostname_and_schema` (
  `hostname` varchar(32) NOT NULL,
  `schema` varchar(16) NOT NULL,
  `req_count` int(10) unsigned NOT NULL,
  `req_per_sec` float NOT NULL,
  `req_time_total` float NOT NULL,
  `req_time_per_sec` float NOT NULL,
  `ru_utime_total` float NOT NULL,
  `ru_utime_per_sec` float NOT NULL,
  `ru_stime_total` float NOT NULL,
  `ru_stime_per_sec` float NOT NULL,
  `traffic_total` bigint(20) unsigned NOT NULL,
  `traffic_per_sec` float NOT NULL,
  `memory_footprint` bigint(20) NOT NULL,
  `p50` float NOT NULL
) ENGINE=PINBA DEFAULT CHARSET=latin1 COMMENT='v2/request/default_history_time/~host,~schema/hv=0:60000:32768,p50/no_filters';

DROP TABLE IF EXISTS report_by_hostname_script_and_schema;

CREATE TABLE `report_by_hostname_script_and_schema` (
  `hostname` varchar(32) NOT NULL,
  `script_name` varchar(128) NOT NULL,
  `schema` varchar(16) NOT NULL,
  `req_count` int(10) unsigned NOT NULL,
  `req_per_sec` float NOT NULL,
  `req_time_total` float NOT NULL,
  `req_time_per_sec` float NOT NULL,
  `ru_utime_total` float NOT NULL,
  `ru_utime_per_sec` float NOT NULL,
  `ru_stime_total` float NOT NULL,
  `ru_stime_per_sec` float NOT NULL,
  `traffic_total` bigint(20) unsigned NOT NULL,
  `traffic_per_sec` float NOT NULL,
  `memory_footprint` bigint(20) NOT NULL,
  `p50` float NOT NULL
) ENGINE=PINBA DEFAULT CHARSET=latin1 COMMENT='v2/request/default_history_time/~host,~script,~schema/hv=0:60000:32768,p50/no_filters';

DROP TABLE IF EXISTS report_by_hostname_status_and_schema;

CREATE TABLE `report_by_hostname_status_and_schema` (
  `hostname` varchar(32) NOT NULL,
  `status` int(11) NOT NULL,
  `schema` varchar(16) NOT NULL,
  `req_count` int(10) unsigned NOT NULL,
  `req_per_sec` float NOT NULL,
  `req_time_total` float NOT NULL,
  `req_time_per_sec` float NOT NULL,
  `ru_utime_total` float NOT NULL,
  `ru_utime_per_sec` float NOT NULL,
  `ru_stime_total` float NOT NULL,
  `ru_stime_per_sec` float NOT NULL,
  `traffic_total` bigint(20) unsigned NOT NULL,
  `traffic_per_sec` float NOT NULL,
  `memory_footprint` bigint(20) NOT NULL,
  `p50` float NOT NULL
) ENGINE=PINBA DEFAULT CHARSET=latin1 COMMENT='v2/request/default_history_time/~host,~status,~schema/hv=0:60000:32768,p50/no_filters';

Tables like request, tag, timer, timertag, info and status were not converted by script and were not created in new MySQL.

Here are details about used PHP version

PHP 7.2.11 (cli) (built: Oct 15 2018 18:55:39) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
    with Zend OPcache v7.2.11, Copyright (c) 1999-2018, by Zend Technologies

and pinba extention:

Extension [ <persistent> extension #49 pinba version 1.1.2-dev ] {

  - INI {
    Entry [ pinba.server <ALL> ]
      Current = '127.0.0.1:3002'
    }
    Entry [ pinba.enabled <ALL> ]
      Current = '1'
    }
    Entry [ pinba.auto_flush <ALL> ]
      Current = '1'
    }
  }

  - Constants [5] {
    Constant [ integer PINBA_FLUSH_ONLY_STOPPED_TIMERS ] { 1 }
    Constant [ integer PINBA_FLUSH_RESET_DATA ] { 2 }
    Constant [ integer PINBA_ONLY_STOPPED_TIMERS ] { 1 }
    Constant [ integer PINBA_ONLY_RUNNING_TIMERS ] { 4 }
    Constant [ integer PINBA_AUTO_FLUSH ] { 8 }
  }

  - Functions {
    Function [ <internal:pinba> function pinba_timer_start ] {

      - Parameters [3] {
        Parameter #0 [ <required> $tags ]
        Parameter #1 [ <optional> $data ]
        Parameter #2 [ <optional> $hit_count ]
      }
    }
    Function [ <internal:pinba> function pinba_timer_add ] {

      - Parameters [3] {
        Parameter #0 [ <required> $tags ]
        Parameter #1 [ <required> $value ]
        Parameter #2 [ <optional> $data ]
      }
    }
    Function [ <internal:pinba> function pinba_timer_stop ] {

      - Parameters [1] {
        Parameter #0 [ <required> $timer ]
      }
    }
    Function [ <internal:pinba> function pinba_timer_delete ] {

      - Parameters [1] {
        Parameter #0 [ <required> $timer ]
      }
    }
    Function [ <internal:pinba> function pinba_timer_data_merge ] {

      - Parameters [2] {
        Parameter #0 [ <required> $timer ]
        Parameter #1 [ <required> $data ]
      }
    }
    Function [ <internal:pinba> function pinba_timer_data_replace ] {

      - Parameters [2] {
        Parameter #0 [ <required> $timer ]
        Parameter #1 [ <required> $data ]
      }
    }
    Function [ <internal:pinba> function pinba_timer_tags_merge ] {

      - Parameters [2] {
        Parameter #0 [ <required> $timer ]
        Parameter #1 [ <required> $tags ]
      }
    }
    Function [ <internal:pinba> function pinba_timer_tags_replace ] {

      - Parameters [2] {
        Parameter #0 [ <required> $timer ]
        Parameter #1 [ <required> $tags ]
      }
    }
    Function [ <internal:pinba> function pinba_flush ] {

      - Parameters [2] {
        Parameter #0 [ <optional> $custom_script_name ]
        Parameter #1 [ <optional> $flags ]
      }
    }
    Function [ <internal:pinba> function pinba_reset ] {

      - Parameters [0] {
      }
    }
    Function [ <internal:pinba> function pinba_get_info ] {

      - Parameters [0] {
      }
    }
    Function [ <internal:pinba> function pinba_get_data ] {

      - Parameters [1] {
        Parameter #0 [ <optional> $flags ]
      }
    }
    Function [ <internal:pinba> function pinba_timer_get_info ] {

      - Parameters [1] {
        Parameter #0 [ <required> $timer ]
      }
    }
    Function [ <internal:pinba> function pinba_timers_stop ] {

      - Parameters [0] {
      }
    }
    Function [ <internal:pinba> function pinba_timers_get ] {

      - Parameters [0] {
      }
    }
    Function [ <internal:pinba> function pinba_script_name_set ] {

      - Parameters [1] {
        Parameter #0 [ <required> $custom_script_name ]
      }
    }
    Function [ <internal:pinba> function pinba_hostname_set ] {

      - Parameters [1] {
        Parameter #0 [ <required> $custom_hostname ]
      }
    }
    Function [ <internal:pinba> function pinba_server_name_set ] {

      - Parameters [1] {
        Parameter #0 [ <required> $custom_server_name ]
      }
    }
    Function [ <internal:pinba> function pinba_schema_set ] {

      - Parameters [1] {
        Parameter #0 [ <required> $custom_schema ]
      }
    }
    Function [ <internal:pinba> function pinba_request_time_set ] {

      - Parameters [1] {
        Parameter #0 [ <required> $request_time ]
      }
    }
    Function [ <internal:pinba> function pinba_tag_set ] {

      - Parameters [2] {
        Parameter #0 [ <required> $tag ]
        Parameter #1 [ <required> $value ]
      }
    }
    Function [ <internal:pinba> function pinba_tag_get ] {

      - Parameters [1] {
        Parameter #0 [ <required> $tag ]
      }
    }
    Function [ <internal:pinba> function pinba_tag_delete ] {

      - Parameters [1] {
        Parameter #0 [ <required> $tag ]
      }
    }
    Function [ <internal:pinba> function pinba_tags_get ] {

      - Parameters [0] {
      }
    }
  }

  - Classes [1] {
    Class [ <internal:pinba> class PinbaClient ] {

      - Constants [0] {
      }

      - Static properties [0] {
      }

      - Static methods [0] {
      }

      - Properties [0] {
      }

      - Methods [17] {
        Method [ <internal:pinba, ctor> public method __construct ] {

          - Parameters [1] {
            Parameter #0 [ <required> $servers ]
          }
        }

        Method [ <internal:pinba> public method setHostname ] {

          - Parameters [1] {
            Parameter #0 [ <required> $value ]
          }
        }

        Method [ <internal:pinba> public method setScriptname ] {

          - Parameters [1] {
            Parameter #0 [ <required> $value ]
          }
        }

        Method [ <internal:pinba> public method setServername ] {

          - Parameters [1] {
            Parameter #0 [ <required> $value ]
          }
        }

        Method [ <internal:pinba> public method setRequestCount ] {

          - Parameters [1] {
            Parameter #0 [ <required> $value ]
          }
        }

        Method [ <internal:pinba> public method setDocumentSize ] {

          - Parameters [1] {
            Parameter #0 [ <required> $value ]
          }
        }

        Method [ <internal:pinba> public method setMemoryPeak ] {

          - Parameters [1] {
            Parameter #0 [ <required> $value ]
          }
        }

        Method [ <internal:pinba> public method setMemoryFootprint ] {

          - Parameters [1] {
            Parameter #0 [ <required> $value ]
          }
        }

        Method [ <internal:pinba> public method setRusage ] {

          - Parameters [1] {
            Parameter #0 [ <required> $value ]
          }
        }

        Method [ <internal:pinba> public method setRequestTime ] {

          - Parameters [1] {
            Parameter #0 [ <required> $value ]
          }
        }

        Method [ <internal:pinba> public method setStatus ] {

          - Parameters [1] {
            Parameter #0 [ <required> $value ]
          }
        }

        Method [ <internal:pinba> public method setSchema ] {

          - Parameters [1] {
            Parameter #0 [ <required> $value ]
          }
        }

        Method [ <internal:pinba> public method setTag ] {

          - Parameters [2] {
            Parameter #0 [ <required> $tag ]
            Parameter #1 [ <required> $value ]
          }
        }

        Method [ <internal:pinba> public method setTimer ] {

          - Parameters [4] {
            Parameter #0 [ <required> $tags ]
            Parameter #1 [ <required> $value ]
            Parameter #2 [ <optional> $rusage ]
            Parameter #3 [ <optional> $hit_count ]
          }
        }

        Method [ <internal:pinba> public method addTimer ] {

          - Parameters [4] {
            Parameter #0 [ <required> $tags ]
            Parameter #1 [ <required> $value ]
            Parameter #2 [ <optional> $rusage ]
            Parameter #3 [ <optional> $hit_count ]
          }
        }

        Method [ <internal:pinba> public method send ] {

          - Parameters [1] {
            Parameter #0 [ <optional> $flags ]
          }
        }

        Method [ <internal:pinba> public method getData ] {

          - Parameters [1] {
            Parameter #0 [ <optional> $flags ]
          }
        }
      }
    }
  }
}

MySQL crushed after first fpm request was processed. Please send help.

Docker-compose issues

Hi!
I'm building pinba2 in docker env (git clone of master -> docker-compose build -> docker-compose up)

I have no issues during build phase, but "up" stage failing: mysql daemon cannot start:
pinba2-fedora-25 | ERROR 1126 (HY000) at line 1: Can't open shared library '/usr/lib64/mysql/plugin/libpinba_engine2.so' (errno: 13, undefined symbol: gai_cancel)
pinba2-fedora-25 exited with code 1

Mysql/Mariadb version seems to be correct:
pinba2-fedora-25 | Version: '10.1.26-MariaDB' socket: '/var/lib/mysql/mysql.sock' port: 0 MariaDB Server

Have you any workardounds for this issue?
Thanks!

Idea: improve select-s performance with lockless word_id -> word translations

Currently to translate word_id -> word_str (done for each key in each selected row, potentially millions of times per select) - we need to read lock global dictionary shard.

This incurs significant overhead just for locks themselves.
An in cases where contention might be high (when per-repacker caching is inefficient, e.g. nginx urls) - might also slow down new packets processing.

The lock is only needed, because we use std::deque to find a word by offset, and it might get inserted into while we're reading (changing it's structure).

The proposed idea is to rework dictionary shard to use just a contiguous mmap()-ed memory region, enabling fully-lockless read-at-offset path (as the mmap()-ed region pointer never changes).

The word_t size is less than modern x86 CPU's cache line size, but due to the strong x86 cache-coherence model - this might only incur a performance penalty, but not compromise correctness.

As far as i understand it, anyway :)

Why Latin1 for report tables?

Is it ok to use eg. utf8 charset when defining the reports tables? It would seem to make sense, given the script/hostname data present in them

Move to c++14

Just as a minimal requirement.

And fix a few things (more to be added)

  • collector move lambda capture when creating reader threads (after ipv6 support is merged)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.