# HG changeset patch # User Sascha L. Teichmann # Date 1636071168 -3600 # Node ID 02c2d0edeb2a3d8931cfa61b72164cf2022a33bc # Parent f8c370af9e6f69c970a5d79bf4c6bd3b0fc40a28 Added gmaggregate tool as contrib. diff -r f8c370af9e6f -r 02c2d0edeb2a Makefile --- a/Makefile Sun Oct 31 01:56:35 2021 +0200 +++ b/Makefile Fri Nov 05 01:12:48 2021 +0100 @@ -12,9 +12,9 @@ export BUILDBASE -.PHONY: all gemma client clean +.PHONY: all gemma gmaggregate client clean -all: gemma client +all: gemma gmaggregate client $(ENVWARPPER): @echo "Preparing go build environment:" @@ -30,21 +30,28 @@ gemma: $(ENVWARPPER) "$(ENVWARPPER)" go build -o ./cmd/gemma/gemma ./cmd/gemma +gmaggregate: $(ENVWARPPER) + cd ./contrib/gmaggregate; "$(ENVWARPPER)" go build + client: $(MAKE) -f Makefile.build -C client install: gemma cp cmd/gemma/gemma $(BINDIR) + cp contrib/gmaggregate/gmaggregate $(BINDIR) tar: all v="gemma-$$(hg id -i)" ;\ tar --transform "s@^@$${v}/@" \ -cJf "../$${v}.tar.xz" \ - cmd/gemma/gemma schema style-templates report-templates \ + cmd/gemma/gemma \ + contrib/gmaggregate/gmaggregate \ + schema style-templates report-templates \ web misc example_conf.toml clean: $(MAKE) -f Makefile.build -C client $@ - rm -f "$(gemma-bin)" + rm -f contrib/gmaggregate/gmaggregate + rm -f cmd/gemma/gemma chmod -R u+w "$(BUILDBASE)" # This is neccessary for deletion to work... rm -rf "$(BUILDBASE)" diff -r f8c370af9e6f -r 02c2d0edeb2a contrib/gmaggregate/README.md --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/contrib/gmaggregate/README.md Fri Nov 05 01:12:48 2021 +0100 @@ -0,0 +1,89 @@ +# gmaggregate + +*Attention:* This is a copy of [gmaggregate](https://heptapod.host/intevation/gemma/gmaggregate). + +A log message transformation tool for gauge measurement (gm) imports +in the gemma server. + +We recognized that the logging of the gm imports is producing a lot +of data itself by been very verbose and redundant. The has led +to the fact that over 99% of the log messages of all imports +in the gemma server are stemming from the gm imports ... +hundreds of millions of log lines. + +The logging itself is now done in a more compact and aggregated +way increasing the readability of the logs, too. +To get rid of the repetitive old logs entries without losing +information these logs has to be aggregated in the same way, +too. + +Normally, we use SQL or PL/pgSQL scripts for this kind of migrations. +We had a version of this for this task but first experiments +had shown that its run time would only be acceptable +for small data sets, but not for the multi million data sets +of the production system. It also had no to very little potential +to be significantly improved. Therefore we re-crafted this tool in Go. + +## Build + +You need a working Go build environment (tested successfully with 1.17). + +```(shell) +hg clone https://heptapod.host/intevation/gemma/gmaggregate +cd gmaggregate +go build +``` + +Place the resulting `gmaggregate` binary into the `PATH` of your +database server. It needs execution rights for the `postgres` user. + +If you've modified the expressions in [matcher.rl](matcher.rl) you need +an installation of the [Ragel](http://www.colm.net/open-source/ragel/) FSM compiler. +Compile the modified sources with: + +```(shell) +go generate +go build +``` + +## Usage + +`gmaggregate` works in two phases: **filter** and **transfer**. +The **filter** phase creates a new table in the database in which +the aggregated logs of the gm import logs are stored. In this +phase the original logs are __not__ modified. The modifications +are done in the **transfer** phase. In this phase the original +log lines are removed from the database which are associated +with the gm imports leading to the entries in the table +created in the first phase. All other log lines are not +touched. After the deletion off the old lines the content +of the new table is copied back into the log table and +the new table is dropped. All operations in the transfer +phase are are encapsulated within a transaction so that +no harm is done if the execution is failing. + +`gmaggregate` runs the two phases **filter** and **transfer** +one right after each other. If you want to run them +separated by hand you can can do this this the `-phases` +flag. + +> **CSV export**: For debugging purposes `gmaggregate` supports +> exporting the aggregated log lines as a CSV file. Use the +> `-c` flag to specify the file to write it to. When running +> the CVS export the new table in the database is not created. +> So the transfer phase will fail. Therefore you should use +> the CSV export togetjer with the `-phase=filter` flag. + +For more options see `gmaggregate --help`. + +> Tip: After running the `gmaggregate` migration you should consider running +> `VACCUM FULL; CLUSTER import.import_logs USING import_logs_import_id;` +> from a `psql` shell on the database to recover the space +> used by the original log lines and physically order the data +> in a way corresponing to the process of logging. + +## License + +This is Free Software covered by the terms of the +GNU Affero General Public License version 3.0 or later. +See [AGPL-3.0.txt](../../LICENSES/AGPL-3.0.txt) for details. diff -r f8c370af9e6f -r 02c2d0edeb2a contrib/gmaggregate/go.mod --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/contrib/gmaggregate/go.mod Fri Nov 05 01:12:48 2021 +0100 @@ -0,0 +1,17 @@ +module heptapod.host/intevation/gemma/gmaggregate + +go 1.17 + +require github.com/jackc/pgx/v4 v4.13.0 + +require ( + github.com/jackc/chunkreader/v2 v2.0.1 // indirect + github.com/jackc/pgconn v1.10.0 // indirect + github.com/jackc/pgio v1.0.0 // indirect + github.com/jackc/pgpassfile v1.0.0 // indirect + github.com/jackc/pgproto3/v2 v2.1.1 // indirect + github.com/jackc/pgservicefile v0.0.0-20200714003250-2b9c44734f2b // indirect + github.com/jackc/pgtype v1.8.1 // indirect + golang.org/x/crypto v0.0.0-20210711020723-a769d52b0f97 // indirect + golang.org/x/text v0.3.6 // indirect +) diff -r f8c370af9e6f -r 02c2d0edeb2a contrib/gmaggregate/go.sum --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/contrib/gmaggregate/go.sum Fri Nov 05 01:12:48 2021 +0100 @@ -0,0 +1,176 @@ +github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= +github.com/Masterminds/semver/v3 v3.1.1 h1:hLg3sBzpNErnxhQtUy/mmLR2I9foDujNK030IGemrRc= +github.com/Masterminds/semver/v3 v3.1.1/go.mod h1:VPu/7SZ7ePZ3QOrcuXROw5FAcLl4a0cBrbBpGY/8hQs= +github.com/cockroachdb/apd v1.1.0 h1:3LFP3629v+1aKXU5Q37mxmRxX/pIu1nijXydLShEq5I= +github.com/cockroachdb/apd v1.1.0/go.mod h1:8Sl8LxpKi29FqWXR16WEFZRNSz3SoPzUzeMeY4+DwBQ= +github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= +github.com/coreos/go-systemd v0.0.0-20190719114852-fd7a80b32e1f/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= +github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY= +github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/go-kit/log v0.1.0/go.mod h1:zbhenjAZHb184qTLMA9ZjW7ThYL0H2mk7Q6pNt4vbaY= +github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A= +github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= +github.com/gofrs/uuid v4.0.0+incompatible h1:1SD/1F5pU8p29ybwgQSwpQk+mwdRrXCYuPhW6m+TnJw= +github.com/gofrs/uuid v4.0.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= +github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= +github.com/jackc/chunkreader v1.0.0 h1:4s39bBR8ByfqH+DKm8rQA3E1LHZWB9XWcrz8fqaZbe0= +github.com/jackc/chunkreader v1.0.0/go.mod h1:RT6O25fNZIuasFJRyZ4R/Y2BbhasbmZXF9QQ7T3kePo= +github.com/jackc/chunkreader/v2 v2.0.0/go.mod h1:odVSm741yZoC3dpHEUXIqA9tQRhFrgOHwnPIn9lDKlk= +github.com/jackc/chunkreader/v2 v2.0.1 h1:i+RDz65UE+mmpjTfyz0MoVTnzeYxroil2G82ki7MGG8= +github.com/jackc/chunkreader/v2 v2.0.1/go.mod h1:odVSm741yZoC3dpHEUXIqA9tQRhFrgOHwnPIn9lDKlk= +github.com/jackc/pgconn v0.0.0-20190420214824-7e0022ef6ba3/go.mod h1:jkELnwuX+w9qN5YIfX0fl88Ehu4XC3keFuOJJk9pcnA= +github.com/jackc/pgconn v0.0.0-20190824142844-760dd75542eb/go.mod h1:lLjNuW/+OfW9/pnVKPazfWOgNfH2aPem8YQ7ilXGvJE= +github.com/jackc/pgconn v0.0.0-20190831204454-2fabfa3c18b7/go.mod h1:ZJKsE/KZfsUgOEh9hBm+xYTstcNHg7UPMVJqRfQxq4s= +github.com/jackc/pgconn v1.8.0/go.mod h1:1C2Pb36bGIP9QHGBYCjnyhqu7Rv3sGshaQUvmfGIB/o= +github.com/jackc/pgconn v1.9.0/go.mod h1:YctiPyvzfU11JFxoXokUOOKQXQmDMoJL9vJzHH8/2JY= +github.com/jackc/pgconn v1.9.1-0.20210724152538-d89c8390a530/go.mod h1:4z2w8XhRbP1hYxkpTuBjTS3ne3J48K83+u0zoyvg2pI= +github.com/jackc/pgconn v1.10.0 h1:4EYhlDVEMsJ30nNj0mmgwIUXoq7e9sMJrVC2ED6QlCU= +github.com/jackc/pgconn v1.10.0/go.mod h1:4z2w8XhRbP1hYxkpTuBjTS3ne3J48K83+u0zoyvg2pI= +github.com/jackc/pgio v1.0.0 h1:g12B9UwVnzGhueNavwioyEEpAmqMe1E/BN9ES+8ovkE= +github.com/jackc/pgio v1.0.0/go.mod h1:oP+2QK2wFfUWgr+gxjoBH9KGBb31Eio69xUb0w5bYf8= +github.com/jackc/pgmock v0.0.0-20190831213851-13a1b77aafa2/go.mod h1:fGZlG77KXmcq05nJLRkk0+p82V8B8Dw8KN2/V9c/OAE= +github.com/jackc/pgmock v0.0.0-20201204152224-4fe30f7445fd/go.mod h1:hrBW0Enj2AZTNpt/7Y5rr2xe/9Mn757Wtb2xeBzPv2c= +github.com/jackc/pgmock v0.0.0-20210724152146-4ad1a8207f65 h1:DadwsjnMwFjfWc9y5Wi/+Zz7xoE5ALHsRQlOctkOiHc= +github.com/jackc/pgmock v0.0.0-20210724152146-4ad1a8207f65/go.mod h1:5R2h2EEX+qri8jOWMbJCtaPWkrrNc7OHwsp2TCqp7ak= +github.com/jackc/pgpassfile v1.0.0 h1:/6Hmqy13Ss2zCq62VdNG8tM1wchn8zjSGOBJ6icpsIM= +github.com/jackc/pgpassfile v1.0.0/go.mod h1:CEx0iS5ambNFdcRtxPj5JhEz+xB6uRky5eyVu/W2HEg= +github.com/jackc/pgproto3 v1.1.0 h1:FYYE4yRw+AgI8wXIinMlNjBbp/UitDJwfj5LqqewP1A= +github.com/jackc/pgproto3 v1.1.0/go.mod h1:eR5FA3leWg7p9aeAqi37XOTgTIbkABlvcPB3E5rlc78= +github.com/jackc/pgproto3/v2 v2.0.0-alpha1.0.20190420180111-c116219b62db/go.mod h1:bhq50y+xrl9n5mRYyCBFKkpRVTLYJVWeCc+mEAI3yXA= +github.com/jackc/pgproto3/v2 v2.0.0-alpha1.0.20190609003834-432c2951c711/go.mod h1:uH0AWtUmuShn0bcesswc4aBTWGvw0cAxIJp+6OB//Wg= +github.com/jackc/pgproto3/v2 v2.0.0-rc3/go.mod h1:ryONWYqW6dqSg1Lw6vXNMXoBJhpzvWKnT95C46ckYeM= +github.com/jackc/pgproto3/v2 v2.0.0-rc3.0.20190831210041-4c03ce451f29/go.mod h1:ryONWYqW6dqSg1Lw6vXNMXoBJhpzvWKnT95C46ckYeM= +github.com/jackc/pgproto3/v2 v2.0.6/go.mod h1:WfJCnwN3HIg9Ish/j3sgWXnAfK8A9Y0bwXYU5xKaEdA= +github.com/jackc/pgproto3/v2 v2.1.1 h1:7PQ/4gLoqnl87ZxL7xjO0DR5gYuviDCZxQJsUlFW1eI= +github.com/jackc/pgproto3/v2 v2.1.1/go.mod h1:WfJCnwN3HIg9Ish/j3sgWXnAfK8A9Y0bwXYU5xKaEdA= +github.com/jackc/pgservicefile v0.0.0-20200714003250-2b9c44734f2b h1:C8S2+VttkHFdOOCXJe+YGfa4vHYwlt4Zx+IVXQ97jYg= +github.com/jackc/pgservicefile v0.0.0-20200714003250-2b9c44734f2b/go.mod h1:vsD4gTJCa9TptPL8sPkXrLZ+hDuNrZCnj29CQpr4X1E= +github.com/jackc/pgtype v0.0.0-20190421001408-4ed0de4755e0/go.mod h1:hdSHsc1V01CGwFsrv11mJRHWJ6aifDLfdV3aVjFF0zg= +github.com/jackc/pgtype v0.0.0-20190824184912-ab885b375b90/go.mod h1:KcahbBH1nCMSo2DXpzsoWOAfFkdEtEJpPbVLq8eE+mc= +github.com/jackc/pgtype v0.0.0-20190828014616-a8802b16cc59/go.mod h1:MWlu30kVJrUS8lot6TQqcg7mtthZ9T0EoIBFiJcmcyw= +github.com/jackc/pgtype v1.8.1-0.20210724151600-32e20a603178/go.mod h1:C516IlIV9NKqfsMCXTdChteoXmwgUceqaLfjg2e3NlM= +github.com/jackc/pgtype v1.8.1 h1:9k0IXtdJXHJbyAWQgbWr1lU+MEhPXZz6RIXxfR5oxXs= +github.com/jackc/pgtype v1.8.1/go.mod h1:LUMuVrfsFfdKGLw+AFFVv6KtHOFMwRgDDzBt76IqCA4= +github.com/jackc/pgx/v4 v4.0.0-20190420224344-cc3461e65d96/go.mod h1:mdxmSJJuR08CZQyj1PVQBHy9XOp5p8/SHH6a0psbY9Y= +github.com/jackc/pgx/v4 v4.0.0-20190421002000-1b8f0016e912/go.mod h1:no/Y67Jkk/9WuGR0JG/JseM9irFbnEPbuWV2EELPNuM= +github.com/jackc/pgx/v4 v4.0.0-pre1.0.20190824185557-6972a5742186/go.mod h1:X+GQnOEnf1dqHGpw7JmHqHc1NxDoalibchSk9/RWuDc= +github.com/jackc/pgx/v4 v4.12.1-0.20210724153913-640aa07df17c/go.mod h1:1QD0+tgSXP7iUjYm9C1NxKhny7lq6ee99u/z+IHFcgs= +github.com/jackc/pgx/v4 v4.13.0 h1:JCjhT5vmhMAf/YwBHLvrBn4OGdIQBiFG6ym8Zmdx570= +github.com/jackc/pgx/v4 v4.13.0/go.mod h1:9P4X524sErlaxj0XSGZk7s+LD0eOyu1ZDUrrpznYDF0= +github.com/jackc/puddle v0.0.0-20190413234325-e4ced69a3a2b/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk= +github.com/jackc/puddle v0.0.0-20190608224051-11cab39313c9/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk= +github.com/jackc/puddle v1.1.3/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk= +github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= +github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= +github.com/konsorten/go-windows-terminal-sequences v1.0.2/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= +github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= +github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= +github.com/kr/pty v1.1.8/go.mod h1:O1sed60cT9XZ5uDucP5qwvh+TE3NnUj51EiZO/lmSfw= +github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= +github.com/lib/pq v1.0.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= +github.com/lib/pq v1.1.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= +github.com/lib/pq v1.2.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= +github.com/lib/pq v1.10.2 h1:AqzbZs4ZoCBp+GtejcpCpcxM3zlSMx29dXbUSeVtJb8= +github.com/lib/pq v1.10.2/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= +github.com/mattn/go-colorable v0.1.1/go.mod h1:FuOcm+DKB9mbwrcAfNl7/TZVBZ6rcnceauSikq3lYCQ= +github.com/mattn/go-colorable v0.1.6/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= +github.com/mattn/go-isatty v0.0.5/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= +github.com/mattn/go-isatty v0.0.7/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= +github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= +github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I= +github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= +github.com/rs/xid v1.2.1/go.mod h1:+uKXf+4Djp6Md1KODXJxgGQPKngRmWyn10oCKFzNHOQ= +github.com/rs/zerolog v1.13.0/go.mod h1:YbFCdg8HfsridGWAh22vktObvhZbQsZXe4/zB0OKkWU= +github.com/rs/zerolog v1.15.0/go.mod h1:xYTKnLHcpfU2225ny5qZjxnj9NvkumZYjJHlAThCjNc= +github.com/satori/go.uuid v1.2.0/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdhQKdks0= +github.com/shopspring/decimal v0.0.0-20180709203117-cd690d0c9e24/go.mod h1:M+9NzErvs504Cn4c5DxATwIqPbtswREoFCre64PpcG4= +github.com/shopspring/decimal v1.2.0 h1:abSATXmQEYyShuxI4/vyW3tV1MrKAJzCZ/0zLUXYbsQ= +github.com/shopspring/decimal v1.2.0/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o= +github.com/sirupsen/logrus v1.4.1/go.mod h1:ni0Sbl8bgC9z8RoU9G6nDWqqs/fq4eDPysMBDgk/93Q= +github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE= +github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= +github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= +github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= +github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= +github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= +github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/zenazn/goji v0.9.0/go.mod h1:7S9M489iMyHBNxwZnk9/EHS098H4/F6TATF2mIxtB1Q= +go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= +go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= +go.uber.org/atomic v1.5.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= +go.uber.org/atomic v1.6.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= +go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= +go.uber.org/multierr v1.3.0/go.mod h1:VgVr7evmIr6uPjLBxg28wmKNXyqE9akIJ5XnfpiKl+4= +go.uber.org/multierr v1.5.0/go.mod h1:FeouvMocqHpRaaGuG9EjoKcStLC43Zu/fmqdUMPcKYU= +go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee/go.mod h1:vJERXedbb3MVM5f9Ejo0C68/HhF8uaILCdgjnY+goOA= +go.uber.org/zap v1.9.1/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= +go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= +go.uber.org/zap v1.13.0/go.mod h1:zwrFLgMcdUuIBviXEYEH1YKNaOBnKXsx2IPda5bBwHM= +golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/crypto v0.0.0-20190411191339-88737f569e3a/go.mod h1:WFFai1msRO1wXaEeE5yQxYXgSfI8pQAWXbQop6sCtWE= +golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20190820162420-60c769a6c586/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20201203163018-be400aefbc4c/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I= +golang.org/x/crypto v0.0.0-20210616213533-5ff15b29337e/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= +golang.org/x/crypto v0.0.0-20210711020723-a769d52b0f97 h1:/UOmuWzQfxxo9UtlXMwuQU8CMgg1eZXqTRwkSQJWKOI= +golang.org/x/crypto v0.0.0-20210711020723-a769d52b0f97/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= +golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= +golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= +golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190813141303-74dc4d7220e7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= +golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190403152447-81d4e9dc473e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190813064441-fde4db37ae7a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= +golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= +golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.6 h1:aRYxNxv6iGQlyVaZmk6ZgYEDa+Jg18DxebPSrd6bg1M= +golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190425163242-31fd60d6bfdc/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190823170909-c4a336ef6a2f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191029041327-9cc4af7d6b2c/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191029190741-b9c20aec41a5/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20200103221440-774c71fcf114/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/xerrors v0.0.0-20190410155217-1f06c39b4373/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20190513163551-3ee3066db522/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= +gopkg.in/inconshreveable/log15.v2 v2.0.0-20180818164646-67afb5ed74ec/go.mod h1:aPpfJ7XW+gOuirDoZ8gHhLh3kZ1B08FtV2bbmy7Jv3s= +gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo= +gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= diff -r f8c370af9e6f -r 02c2d0edeb2a contrib/gmaggregate/main.go --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/contrib/gmaggregate/main.go Fri Nov 05 01:12:48 2021 +0100 @@ -0,0 +1,765 @@ +// This is Free Software under GNU Affero General Public License v >= 3.0 +// without warranty, see README.md and license for details. +// +// SPDX-License-Identifier: AGPL-3.0-or-later +// License-Filename: LICENSE +// +// Copyright (C) 2021 by via donau +// - Österreichische Wasserstraßen-Gesellschaft mbH +// Software engineering by Intevation GmbH +// +// Author(s): +// * Sascha L. Teichmann + +//go:generate ragel -Z -G2 -o matcher.go matcher.rl +//go:generate go fmt matcher.go + +package main + +import ( + "container/heap" + "context" + "database/sql" + "encoding/csv" + "flag" + "fmt" + "log" + "os" + "runtime" + "sort" + "strconv" + "strings" + "sync" + "time" + + _ "github.com/jackc/pgx/v4/stdlib" +) + +const ( + selectOldGMLogsSQL = ` + SELECT + lo.import_id, + lo.time, + lo.kind, + lo.msg + FROM import.imports im + JOIN import.import_logs lo + ON lo.import_id = im.id + WHERE im.kind = 'gm' + ORDER BY lo.import_id` + + createFilteredLogsSQL = ` + CREATE TABLE filtered_logs ( + import_id integer NOT NULL, + time timestamp with time zone NOT NULL, + kind log_type NOT NULL, + msg text NOT NULL + )` + + insertFilteredLogsSQL = ` + INSERT INTO filtered_logs (import_id, time, kind, msg) + VALUES ($1, $2, $3::log_type, $4)` + + deleteOldGMLogsSQL = ` + DELETE FROM import.import_logs WHERE import_id IN ( + SELECT import_id FROM filtered_logs)` + + copyDataSQL = ` + INSERT INTO import.import_logs (import_id, time, kind, msg) + SELECT import_id, time, kind, msg + FROM filtered_logs` + + dropFilteredLogsSQL = `DROP TABLE filtered_logs` +) + +type phases int + +const ( + nonePhase phases = 0 + filterPhase phases = 1 << iota + transferPhase +) + +type gauge struct { + gid string + unknown bool + assumeZPG bool + ignMeasCodes []string + rescaleErrors []string + missingValues []string + assumeCM int + badValues int + measurements int + predictions int +} + +type aggregator struct { + current string + hold *line + + lastGauge *gauge + gauges []*gauge + + stack [4]string +} + +type line struct { + time time.Time + kind string + msg string +} + +type importLines struct { + seq int + id int64 + lines []line +} + +type processor struct { + cond *sync.Cond + aggregated []*importLines + nextOutSeq int + done bool +} + +type writer interface { + prepare(context.Context, *sql.Conn) error + write(*importLines) + finish() + error() error +} + +type csvWriter struct { + err error + file *os.File + out *csv.Writer + row [1 + 1 + 1 + 1]string +} + +type sqlWriter struct { + err error + ctx context.Context + tx *sql.Tx + stmt *sql.Stmt +} + +func (ps phases) has(p phases) bool { + return ps&p == p +} + +func parsePhases(s string) (phases, error) { + ps := nonePhase + for _, x := range strings.Split(s, ",") { + switch strings.ToLower(strings.TrimSpace(x)) { + case "transfer": + ps |= transferPhase + case "filter": + ps |= filterPhase + default: + return nonePhase, fmt.Errorf("invalid phase '%s'", x) + } + } + return ps, nil +} + +func (g *gauge) getAssumeZPG() bool { return g.assumeZPG } +func (g *gauge) getUnkown() bool { return g.unknown } +func (g *gauge) getIgnoredMeasureCodes() []string { return g.ignMeasCodes } +func (g *gauge) getRescaleErrors() []string { return g.rescaleErrors } +func (g *gauge) getMissingValues() []string { return g.missingValues } +func (g *gauge) getAssumeCM() int { return g.assumeCM } +func (g *gauge) getBadValues() int { return g.badValues } +func (g *gauge) getPredictions() int { return g.predictions } +func (g *gauge) getMeasurements() int { return g.measurements } +func (g *gauge) nothingChanged() bool { return g.measurements == 0 && g.predictions == 0 } + +func (agg *aggregator) reset() { + agg.current = "" + agg.hold = nil + agg.lastGauge = nil + agg.gauges = nil +} + +func (agg *aggregator) find(name string) *gauge { + if agg.lastGauge != nil && name == agg.lastGauge.gid { + return agg.lastGauge + } + for _, g := range agg.gauges { + if g.gid == name { + agg.lastGauge = g + return g + } + } + g := &gauge{gid: name} + agg.gauges = append(agg.gauges, g) + agg.lastGauge = g + return g +} + +func extend(haystack []string, needle string) []string { + for _, straw := range haystack { + if straw == needle { + return haystack + } + } + return append(haystack, needle) +} + +func (agg *aggregator) logBool( + access func(*gauge) bool, + header string, + log func(string), +) { + var sb strings.Builder + for _, g := range agg.gauges { + if access(g) { + if sb.Len() == 0 { + sb.WriteString(header) + } else { + sb.WriteString(", ") + } + sb.WriteString(g.gid) + } + } + if sb.Len() > 0 { + log(sb.String()) + } +} + +func (agg *aggregator) logInt( + access func(*gauge) int, + header string, + log func(string), +) { + gs := make([]*gauge, 0, len(agg.gauges)) + for _, g := range agg.gauges { + if access(g) > 0 { + gs = append(gs, g) + } + } + + if len(gs) == 0 { + return + } + + sort.SliceStable(gs, func(i, j int) bool { + return access(gs[i]) < access(gs[j]) + }) + + var sb strings.Builder + var last int + + for _, g := range gs { + if c := access(g); c != last { + if sb.Len() == 0 { + sb.WriteString(header) + } else { + sb.WriteString("); ") + } + sb.WriteString(strconv.Itoa(c)) + sb.WriteString(" (") + last = c + } else { + sb.WriteString(", ") + } + sb.WriteString(g.gid) + } + + sb.WriteByte(')') + log(sb.String()) +} + +func (agg *aggregator) logString( + access func(*gauge) []string, + header string, + log func(string), +) { + var sb strings.Builder + for _, g := range agg.gauges { + if s := access(g); len(s) > 0 { + if sb.Len() == 0 { + sb.WriteString(header) + } else { + sb.WriteString(", ") + } + sb.WriteString(g.gid) + sb.WriteString(" (") + for i, v := range s { + if i > 0 { + sb.WriteString("; ") + } + sb.WriteString(v) + } + sb.WriteByte(')') + } + } + if sb.Len() > 0 { + log(sb.String()) + } +} + +func (agg *aggregator) aggregate(out []line, last time.Time) []line { + + // Guarantee that new lines has a time after already put out lines. + if n := len(out); n > 0 && !out[n-1].time.Before(last) { + last = out[n-1].time.Add(time.Millisecond) + } + + log := func(kind, msg string) { + out = append(out, line{last, kind, msg}) + last = last.Add(time.Millisecond) + } + + infoLog := func(msg string) { log("info", msg) } + warnLog := func(msg string) { log("warn", msg) } + errLog := func(msg string) { log("error", msg) } + + agg.logBool( + (*gauge).getUnkown, + "Cannot find following gauges: ", + warnLog) + + agg.logBool( + (*gauge).getAssumeZPG, + "'Reference_code' not specified. Assuming 'ZPG': ", + warnLog) + + agg.logInt( + (*gauge).getAssumeCM, + "'Unit' not specified. Assuming 'cm': ", + warnLog) + + agg.logInt( + (*gauge).getBadValues, + "Ignored measurements with value -99999: ", + warnLog) + + agg.logString( + (*gauge).getMissingValues, + "Missing mandatory values: ", + warnLog) + + agg.logString( + (*gauge).getRescaleErrors, + "Cannot convert units: ", + errLog) + + agg.logString( + (*gauge).getRescaleErrors, + "Ignored measure codes: ", + warnLog) + + agg.logInt( + (*gauge).getPredictions, + "New predictions: ", + infoLog) + + agg.logInt( + (*gauge).getMeasurements, + "New measurements: ", + infoLog) + + agg.logBool( + (*gauge).nothingChanged, + "No changes for: ", + infoLog) + + if agg.hold != nil { + agg.hold.time = last + out = append(out, *agg.hold) + } + return out +} + +func (agg *aggregator) run( + wg *sync.WaitGroup, + logs <-chan *importLines, + pr *processor, +) { + defer wg.Done() + for l := range logs { + // Do sorting by time in user land to take advantage + // of concurrent workers. + lines := l.lines + sort.Slice(lines, func(i, j int) bool { + return lines[i].time.Before(lines[j].time) + }) + + out := lines[:0:len(lines)] + for i := range lines { + line := &lines[i] + if !agg.match(line.msg, line) { + out = append(out, *line) + } + } + l.lines = agg.aggregate(out, lines[len(lines)-1].time) + pr.consume(l) + agg.reset() + } +} + +const timeFormat = "2006-01-02 15:04:05.999999-07" + +func newCSVWriter(filename string) (*csvWriter, error) { + + f, err := os.Create(filename) + if err != nil { + return nil, err + } + + return &csvWriter{ + file: f, + out: csv.NewWriter(f), + }, nil +} + +func (cw *csvWriter) prepare(context.Context, *sql.Conn) error { + return nil +} + +func (cw *csvWriter) error() error { return cw.err } + +func (cw *csvWriter) write(entry *importLines) { + if cw.err != nil { + return + } + row := cw.row[:] + row[0] = strconv.FormatInt(entry.id, 10) + for _, l := range entry.lines { + row[1] = l.time.Format(timeFormat) + row[2] = l.kind + row[3] = l.msg + if cw.err = cw.out.Write(row); cw.err != nil { + log.Printf("error: Writing to CSV file failed: %v\n", cw.err) + return + } + } +} + +func (cw *csvWriter) finish() { + cw.out.Flush() + if err := cw.out.Error(); err != nil { + log.Printf("error: flushing CSV file failed: %v\n", err) + } + if err := cw.file.Close(); err != nil { + log.Printf("Closing CSV file failed: %v\n", err) + } +} + +func (sw *sqlWriter) prepare(ctx context.Context, conn *sql.Conn) error { + + tx, err := conn.BeginTx(ctx, nil) + if err != nil { + return err + } + + if _, err := tx.ExecContext(ctx, createFilteredLogsSQL); err != nil { + tx.Rollback() + return fmt.Errorf("cannot create new log table: %v\n", err) + } + + stmt, err := tx.PrepareContext(ctx, insertFilteredLogsSQL) + if err != nil { + tx.Rollback() + return err + } + + sw.ctx = ctx + sw.tx = tx + sw.stmt = stmt + return nil +} + +func (sw *sqlWriter) error() error { return sw.err } + +func (sw *sqlWriter) write(entry *importLines) { + if sw.err != nil { + return + } + for _, l := range entry.lines { + if _, sw.err = sw.stmt.ExecContext( + sw.ctx, + entry.id, + l.time, + l.kind, + l.msg, + ); sw.err != nil { + log.Printf("error: writing log line to db failed: %v\n", sw.err) + return + } + } +} + +func (sw *sqlWriter) finish() { + if err := sw.stmt.Close(); err != nil { + log.Printf("error: close stmt failed: %v\n", err) + } + if sw.err == nil { + if err := sw.tx.Commit(); err != nil { + log.Printf("error: Commiting transaction failed: %v\n", err) + } + } else if err := sw.tx.Rollback(); err != nil { + log.Printf("error: Rollback transaction failed: %v\n", err) + } +} + +func (pr *processor) Push(x interface{}) { + pr.aggregated = append(pr.aggregated, x.(*importLines)) +} + +func (pr *processor) Pop() interface{} { + n := len(pr.aggregated) + x := pr.aggregated[n-1] + pr.aggregated[n-1] = nil + pr.aggregated = pr.aggregated[:n-1] + return x +} + +func (pr *processor) Len() int { return len(pr.aggregated) } + +func (pr *processor) Less(i, j int) bool { + return pr.aggregated[i].seq < pr.aggregated[j].seq +} + +func (pr *processor) Swap(i, j int) { + pr.aggregated[i], pr.aggregated[j] = pr.aggregated[j], pr.aggregated[i] +} + +func (pr *processor) consume(l *importLines) { + pr.cond.L.Lock() + heap.Push(pr, l) + pr.cond.L.Unlock() + pr.cond.Signal() +} + +func (pr *processor) quit() { + pr.cond.L.Lock() + pr.done = true + pr.cond.L.Unlock() + pr.cond.Signal() +} + +func (pr *processor) drain(write func(*importLines)) { + + for { + pr.cond.L.Lock() + for !pr.done && + (len(pr.aggregated) == 0 || pr.aggregated[0].seq != pr.nextOutSeq) { + pr.cond.Wait() + } + if pr.done { + for len(pr.aggregated) > 0 { + write(heap.Pop(pr).(*importLines)) + } + pr.cond.L.Unlock() + return + } + l := heap.Pop(pr).(*importLines) + //log.Printf("%d %p\n", c.nextOutSeq, l) + pr.nextOutSeq++ + pr.cond.L.Unlock() + write(l) + } +} + +func (pr *processor) filterPhase(db *sql.DB, worker int, wr writer) error { + + log.Println("filter phase started") + + ctx := context.Background() + + con1, err := db.Conn(ctx) + if err != nil { + return err + } + defer con1.Close() + + con2, err := db.Conn(ctx) + if err != nil { + return err + } + defer con2.Close() + + tx, err := con1.BeginTx(ctx, &sql.TxOptions{ReadOnly: true}) + if err != nil { + return err + } + defer tx.Rollback() + + if err := wr.prepare(ctx, con2); err != nil { + return err + } + defer wr.finish() + + logs := make(chan *importLines) + var wg sync.WaitGroup + + for i := 0; i < worker; i++ { + wg.Add(1) + go new(aggregator).run(&wg, logs, pr) + } + + writeDone := make(chan struct{}) + + go func() { + defer close(writeDone) + pr.drain(wr.write) + }() + + log.Println("Querying for old logs started. (Can take a while.)") + rows, err := tx.QueryContext(ctx, selectOldGMLogsSQL) + if err != nil { + return err + } + defer rows.Close() + + log.Println("Querying done. (Maybe restart the gemma server, now?)") + + var ( + count int64 + current *importLines + seq int + l line + importID int64 + start = time.Now() + last = start + ) + + log.Println("Filtering started.") + for rows.Next() { + if err := rows.Scan(&importID, &l.time, &l.kind, &l.msg); err != nil { + return err + } + + if current == nil || importID != current.id { + if current != nil { + logs <- current + } + current = &importLines{ + seq: seq, + id: importID, + } + seq++ + } + current.lines = append(current.lines, l) + + if count++; count%1_000_000 == 0 { + now := time.Now() + diff := now.Sub(last) + log.Printf("lines: %d rate: %.2f lines/s\n", + count, + 1_000_000/diff.Seconds()) + last = now + } + } + if current != nil && len(current.lines) > 0 { + logs <- current + } + close(logs) + wg.Wait() + + pr.quit() + + <-writeDone + + rate := float64(count) / time.Since(start).Seconds() + log.Printf("lines: %d rate: %.2f lines/s imports: %d\n", + count, rate, seq) + return nil +} + +func (pr *processor) transferPhase(db *sql.DB) error { + log.Println("Transfer phase started.") + ctx := context.Background() + conn, err := db.Conn(ctx) + if err != nil { + return err + } + defer conn.Close() + tx, err := conn.BeginTx(ctx, nil) + if err != nil { + return err + } + defer tx.Rollback() + + for _, sql := range []string{ + deleteOldGMLogsSQL, + copyDataSQL, + dropFilteredLogsSQL, + } { + if _, err := tx.ExecContext(ctx, sql); err != nil { + return err + } + } + return tx.Commit() +} + +func newProcessor() *processor { + return &processor{ + cond: sync.NewCond(new(sync.Mutex)), + } +} + +func process( + host, dbname string, port int, + worker int, + csvFile string, + ps phases, +) error { + + p := newProcessor() + var wr writer + + if csvFile != "" { + var err error + if wr, err = newCSVWriter(csvFile); err != nil { + return fmt.Errorf("error: Cannot create CSV file: %v", err) + } + } else { + wr = new(sqlWriter) + } + + dsn := fmt.Sprintf("host=%s dbname=%s port=%d", host, dbname, port) + db, err := sql.Open("pgx", dsn) + if err != nil { + return err + } + defer db.Close() + + if ps.has(filterPhase) { + if err := p.filterPhase(db, worker, wr); err != nil { + return err + } + } + if ps.has(transferPhase) { + if err := p.transferPhase(db); err != nil { + return err + } + } + + return nil +} + +func main() { + var ( + host = flag.String("h", "/var/run/postgresql", "database host") + dbname = flag.String("d", "gemma", "database") + port = flag.Int("p", 5432, "database port") + worker = flag.Int("w", runtime.NumCPU(), "workers to aggregate") + csv = flag.String("c", "", "CSV file to be written") + phases = flag.String("phases", "filter,transfer", "Phases filter and/or transfer") + ) + + flag.Parse() + + ps, err := parsePhases(*phases) + if err != nil { + log.Fatalf("error: %v\n", err) + } + + start := time.Now() + if err := process(*host, *dbname, *port, *worker, *csv, ps); err != nil { + log.Fatalf("error: %v\n", err) + } + log.Printf("time took: %s\n", time.Since(start)) +} diff -r f8c370af9e6f -r 02c2d0edeb2a contrib/gmaggregate/matcher.go --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/contrib/gmaggregate/matcher.go Fri Nov 05 01:12:48 2021 +0100 @@ -0,0 +1,5744 @@ +//line matcher.rl:1 +// This is Free Software under GNU Affero General Public License v >= 3.0 +// without warranty, see README.md and license for details. +// +// SPDX-License-Identifier: AGPL-3.0-or-later +// License-Filename: LICENSE +// +// Copyright (C) 2021 by via donau +// - Österreichische Wasserstraßen-Gesellschaft mbH +// Software engineering by Intevation GmbH +// +// Author(s): +// * Sascha L. Teichmann +package main + +import "strconv" + +//line matcher.go:21 +const expression_start int = 1 +const expression_first_final int = 408 +const expression_error int = 0 + +const expression_en_expr int = 1 + +//line matcher.rl:20 + +func (agg *aggregator) match(data string, l *line) bool { + + // data := []rune(line) + + var cs int + + p, pe := 0, len(data) + + stack := agg.stack[:0] + var pos int + + var g *gauge + var v int + + current := func() string { return string(data[pos+1 : p+1]) } + + pop := func() string { + s := stack[len(stack)-1] + stack = stack[:len(stack)-1] + return s + } + +//line matcher.rl:138 + +//line matcher.go:59 + { + cs = expression_start + } + +//line matcher.rl:141 + +//line matcher.go:66 + { + if p == pe { + goto _test_eof + } + switch cs { + case 1: + goto st_case_1 + case 0: + goto st_case_0 + case 2: + goto st_case_2 + case 3: + goto st_case_3 + case 4: + goto st_case_4 + case 5: + goto st_case_5 + case 6: + goto st_case_6 + case 7: + goto st_case_7 + case 8: + goto st_case_8 + case 9: + goto st_case_9 + case 10: + goto st_case_10 + case 11: + goto st_case_11 + case 12: + goto st_case_12 + case 13: + goto st_case_13 + case 14: + goto st_case_14 + case 15: + goto st_case_15 + case 16: + goto st_case_16 + case 17: + goto st_case_17 + case 18: + goto st_case_18 + case 19: + goto st_case_19 + case 20: + goto st_case_20 + case 21: + goto st_case_21 + case 22: + goto st_case_22 + case 23: + goto st_case_23 + case 24: + goto st_case_24 + case 25: + goto st_case_25 + case 26: + goto st_case_26 + case 27: + goto st_case_27 + case 28: + goto st_case_28 + case 29: + goto st_case_29 + case 30: + goto st_case_30 + case 31: + goto st_case_31 + case 32: + goto st_case_32 + case 33: + goto st_case_33 + case 34: + goto st_case_34 + case 35: + goto st_case_35 + case 36: + goto st_case_36 + case 37: + goto st_case_37 + case 38: + goto st_case_38 + case 39: + goto st_case_39 + case 40: + goto st_case_40 + case 41: + goto st_case_41 + case 42: + goto st_case_42 + case 43: + goto st_case_43 + case 44: + goto st_case_44 + case 45: + goto st_case_45 + case 46: + goto st_case_46 + case 408: + goto st_case_408 + case 47: + goto st_case_47 + case 48: + goto st_case_48 + case 49: + goto st_case_49 + case 50: + goto st_case_50 + case 51: + goto st_case_51 + case 52: + goto st_case_52 + case 53: + goto st_case_53 + case 54: + goto st_case_54 + case 55: + goto st_case_55 + case 56: + goto st_case_56 + case 57: + goto st_case_57 + case 58: + goto st_case_58 + case 59: + goto st_case_59 + case 60: + goto st_case_60 + case 61: + goto st_case_61 + case 62: + goto st_case_62 + case 63: + goto st_case_63 + case 64: + goto st_case_64 + case 65: + goto st_case_65 + case 66: + goto st_case_66 + case 67: + goto st_case_67 + case 68: + goto st_case_68 + case 69: + goto st_case_69 + case 70: + goto st_case_70 + case 71: + goto st_case_71 + case 72: + goto st_case_72 + case 73: + goto st_case_73 + case 74: + goto st_case_74 + case 75: + goto st_case_75 + case 76: + goto st_case_76 + case 77: + goto st_case_77 + case 78: + goto st_case_78 + case 79: + goto st_case_79 + case 80: + goto st_case_80 + case 81: + goto st_case_81 + case 82: + goto st_case_82 + case 83: + goto st_case_83 + case 84: + goto st_case_84 + case 85: + goto st_case_85 + case 86: + goto st_case_86 + case 87: + goto st_case_87 + case 88: + goto st_case_88 + case 89: + goto st_case_89 + case 90: + goto st_case_90 + case 91: + goto st_case_91 + case 92: + goto st_case_92 + case 93: + goto st_case_93 + case 94: + goto st_case_94 + case 95: + goto st_case_95 + case 96: + goto st_case_96 + case 97: + goto st_case_97 + case 98: + goto st_case_98 + case 99: + goto st_case_99 + case 100: + goto st_case_100 + case 101: + goto st_case_101 + case 102: + goto st_case_102 + case 103: + goto st_case_103 + case 104: + goto st_case_104 + case 105: + goto st_case_105 + case 106: + goto st_case_106 + case 107: + goto st_case_107 + case 108: + goto st_case_108 + case 109: + goto st_case_109 + case 110: + goto st_case_110 + case 111: + goto st_case_111 + case 112: + goto st_case_112 + case 113: + goto st_case_113 + case 114: + goto st_case_114 + case 115: + goto st_case_115 + case 116: + goto st_case_116 + case 117: + goto st_case_117 + case 118: + goto st_case_118 + case 119: + goto st_case_119 + case 120: + goto st_case_120 + case 121: + goto st_case_121 + case 122: + goto st_case_122 + case 123: + goto st_case_123 + case 124: + goto st_case_124 + case 125: + goto st_case_125 + case 126: + goto st_case_126 + case 127: + goto st_case_127 + case 128: + goto st_case_128 + case 129: + goto st_case_129 + case 130: + goto st_case_130 + case 131: + goto st_case_131 + case 132: + goto st_case_132 + case 133: + goto st_case_133 + case 134: + goto st_case_134 + case 135: + goto st_case_135 + case 136: + goto st_case_136 + case 137: + goto st_case_137 + case 138: + goto st_case_138 + case 139: + goto st_case_139 + case 140: + goto st_case_140 + case 141: + goto st_case_141 + case 142: + goto st_case_142 + case 143: + goto st_case_143 + case 144: + goto st_case_144 + case 145: + goto st_case_145 + case 146: + goto st_case_146 + case 147: + goto st_case_147 + case 148: + goto st_case_148 + case 149: + goto st_case_149 + case 150: + goto st_case_150 + case 151: + goto st_case_151 + case 152: + goto st_case_152 + case 153: + goto st_case_153 + case 154: + goto st_case_154 + case 155: + goto st_case_155 + case 156: + goto st_case_156 + case 157: + goto st_case_157 + case 158: + goto st_case_158 + case 159: + goto st_case_159 + case 160: + goto st_case_160 + case 161: + goto st_case_161 + case 162: + goto st_case_162 + case 163: + goto st_case_163 + case 164: + goto st_case_164 + case 165: + goto st_case_165 + case 166: + goto st_case_166 + case 167: + goto st_case_167 + case 168: + goto st_case_168 + case 169: + goto st_case_169 + case 170: + goto st_case_170 + case 171: + goto st_case_171 + case 172: + goto st_case_172 + case 173: + goto st_case_173 + case 174: + goto st_case_174 + case 175: + goto st_case_175 + case 176: + goto st_case_176 + case 177: + goto st_case_177 + case 178: + goto st_case_178 + case 179: + goto st_case_179 + case 180: + goto st_case_180 + case 181: + goto st_case_181 + case 182: + goto st_case_182 + case 183: + goto st_case_183 + case 184: + goto st_case_184 + case 185: + goto st_case_185 + case 186: + goto st_case_186 + case 187: + goto st_case_187 + case 188: + goto st_case_188 + case 189: + goto st_case_189 + case 190: + goto st_case_190 + case 191: + goto st_case_191 + case 192: + goto st_case_192 + case 193: + goto st_case_193 + case 194: + goto st_case_194 + case 195: + goto st_case_195 + case 196: + goto st_case_196 + case 197: + goto st_case_197 + case 198: + goto st_case_198 + case 199: + goto st_case_199 + case 200: + goto st_case_200 + case 201: + goto st_case_201 + case 202: + goto st_case_202 + case 203: + goto st_case_203 + case 204: + goto st_case_204 + case 205: + goto st_case_205 + case 206: + goto st_case_206 + case 207: + goto st_case_207 + case 208: + goto st_case_208 + case 209: + goto st_case_209 + case 210: + goto st_case_210 + case 211: + goto st_case_211 + case 212: + goto st_case_212 + case 213: + goto st_case_213 + case 214: + goto st_case_214 + case 215: + goto st_case_215 + case 216: + goto st_case_216 + case 217: + goto st_case_217 + case 218: + goto st_case_218 + case 219: + goto st_case_219 + case 220: + goto st_case_220 + case 221: + goto st_case_221 + case 222: + goto st_case_222 + case 223: + goto st_case_223 + case 224: + goto st_case_224 + case 225: + goto st_case_225 + case 226: + goto st_case_226 + case 227: + goto st_case_227 + case 228: + goto st_case_228 + case 229: + goto st_case_229 + case 230: + goto st_case_230 + case 231: + goto st_case_231 + case 232: + goto st_case_232 + case 233: + goto st_case_233 + case 234: + goto st_case_234 + case 235: + goto st_case_235 + case 236: + goto st_case_236 + case 237: + goto st_case_237 + case 409: + goto st_case_409 + case 238: + goto st_case_238 + case 239: + goto st_case_239 + case 240: + goto st_case_240 + case 241: + goto st_case_241 + case 242: + goto st_case_242 + case 243: + goto st_case_243 + case 244: + goto st_case_244 + case 245: + goto st_case_245 + case 246: + goto st_case_246 + case 247: + goto st_case_247 + case 248: + goto st_case_248 + case 249: + goto st_case_249 + case 250: + goto st_case_250 + case 251: + goto st_case_251 + case 252: + goto st_case_252 + case 253: + goto st_case_253 + case 254: + goto st_case_254 + case 255: + goto st_case_255 + case 256: + goto st_case_256 + case 257: + goto st_case_257 + case 258: + goto st_case_258 + case 259: + goto st_case_259 + case 260: + goto st_case_260 + case 261: + goto st_case_261 + case 262: + goto st_case_262 + case 263: + goto st_case_263 + case 264: + goto st_case_264 + case 265: + goto st_case_265 + case 266: + goto st_case_266 + case 267: + goto st_case_267 + case 268: + goto st_case_268 + case 269: + goto st_case_269 + case 270: + goto st_case_270 + case 271: + goto st_case_271 + case 272: + goto st_case_272 + case 273: + goto st_case_273 + case 274: + goto st_case_274 + case 275: + goto st_case_275 + case 276: + goto st_case_276 + case 277: + goto st_case_277 + case 278: + goto st_case_278 + case 279: + goto st_case_279 + case 280: + goto st_case_280 + case 281: + goto st_case_281 + case 282: + goto st_case_282 + case 283: + goto st_case_283 + case 284: + goto st_case_284 + case 285: + goto st_case_285 + case 286: + goto st_case_286 + case 287: + goto st_case_287 + case 288: + goto st_case_288 + case 289: + goto st_case_289 + case 290: + goto st_case_290 + case 291: + goto st_case_291 + case 292: + goto st_case_292 + case 293: + goto st_case_293 + case 294: + goto st_case_294 + case 295: + goto st_case_295 + case 296: + goto st_case_296 + case 297: + goto st_case_297 + case 298: + goto st_case_298 + case 299: + goto st_case_299 + case 300: + goto st_case_300 + case 301: + goto st_case_301 + case 302: + goto st_case_302 + case 303: + goto st_case_303 + case 304: + goto st_case_304 + case 305: + goto st_case_305 + case 306: + goto st_case_306 + case 307: + goto st_case_307 + case 308: + goto st_case_308 + case 309: + goto st_case_309 + case 310: + goto st_case_310 + case 311: + goto st_case_311 + case 312: + goto st_case_312 + case 313: + goto st_case_313 + case 314: + goto st_case_314 + case 315: + goto st_case_315 + case 316: + goto st_case_316 + case 317: + goto st_case_317 + case 318: + goto st_case_318 + case 319: + goto st_case_319 + case 320: + goto st_case_320 + case 321: + goto st_case_321 + case 322: + goto st_case_322 + case 323: + goto st_case_323 + case 324: + goto st_case_324 + case 325: + goto st_case_325 + case 326: + goto st_case_326 + case 327: + goto st_case_327 + case 328: + goto st_case_328 + case 329: + goto st_case_329 + case 330: + goto st_case_330 + case 331: + goto st_case_331 + case 332: + goto st_case_332 + case 333: + goto st_case_333 + case 334: + goto st_case_334 + case 335: + goto st_case_335 + case 336: + goto st_case_336 + case 337: + goto st_case_337 + case 338: + goto st_case_338 + case 339: + goto st_case_339 + case 340: + goto st_case_340 + case 341: + goto st_case_341 + case 342: + goto st_case_342 + case 343: + goto st_case_343 + case 344: + goto st_case_344 + case 345: + goto st_case_345 + case 346: + goto st_case_346 + case 347: + goto st_case_347 + case 348: + goto st_case_348 + case 349: + goto st_case_349 + case 350: + goto st_case_350 + case 351: + goto st_case_351 + case 352: + goto st_case_352 + case 353: + goto st_case_353 + case 354: + goto st_case_354 + case 355: + goto st_case_355 + case 356: + goto st_case_356 + case 357: + goto st_case_357 + case 358: + goto st_case_358 + case 359: + goto st_case_359 + case 360: + goto st_case_360 + case 361: + goto st_case_361 + case 362: + goto st_case_362 + case 363: + goto st_case_363 + case 364: + goto st_case_364 + case 365: + goto st_case_365 + case 366: + goto st_case_366 + case 367: + goto st_case_367 + case 368: + goto st_case_368 + case 369: + goto st_case_369 + case 370: + goto st_case_370 + case 371: + goto st_case_371 + case 372: + goto st_case_372 + case 373: + goto st_case_373 + case 374: + goto st_case_374 + case 375: + goto st_case_375 + case 376: + goto st_case_376 + case 377: + goto st_case_377 + case 378: + goto st_case_378 + case 379: + goto st_case_379 + case 380: + goto st_case_380 + case 381: + goto st_case_381 + case 382: + goto st_case_382 + case 383: + goto st_case_383 + case 384: + goto st_case_384 + case 385: + goto st_case_385 + case 386: + goto st_case_386 + case 387: + goto st_case_387 + case 388: + goto st_case_388 + case 389: + goto st_case_389 + case 390: + goto st_case_390 + case 391: + goto st_case_391 + case 392: + goto st_case_392 + case 393: + goto st_case_393 + case 394: + goto st_case_394 + case 395: + goto st_case_395 + case 396: + goto st_case_396 + case 397: + goto st_case_397 + case 398: + goto st_case_398 + case 399: + goto st_case_399 + case 400: + goto st_case_400 + case 401: + goto st_case_401 + case 402: + goto st_case_402 + case 403: + goto st_case_403 + case 404: + goto st_case_404 + case 405: + goto st_case_405 + case 406: + goto st_case_406 + case 407: + goto st_case_407 + } + goto st_out + st_case_1: + switch data[p] { + case 39: + goto st2 + case 67: + goto st80 + case 70: + goto st119 + case 73: + goto st173 + case 77: + goto st351 + case 101: + goto st379 + case 117: + goto st394 + } + goto st0 + st_case_0: + st0: + cs = 0 + goto _out + st2: + if p++; p == pe { + goto _test_eof2 + } + st_case_2: + switch data[p] { + case 82: + goto st3 + case 85: + goto st47 + } + goto st0 + st3: + if p++; p == pe { + goto _test_eof3 + } + st_case_3: + if data[p] == 101 { + goto st4 + } + goto st0 + st4: + if p++; p == pe { + goto _test_eof4 + } + st_case_4: + if data[p] == 102 { + goto st5 + } + goto st0 + st5: + if p++; p == pe { + goto _test_eof5 + } + st_case_5: + if data[p] == 101 { + goto st6 + } + goto st0 + st6: + if p++; p == pe { + goto _test_eof6 + } + st_case_6: + if data[p] == 114 { + goto st7 + } + goto st0 + st7: + if p++; p == pe { + goto _test_eof7 + } + st_case_7: + if data[p] == 101 { + goto st8 + } + goto st0 + st8: + if p++; p == pe { + goto _test_eof8 + } + st_case_8: + if data[p] == 110 { + goto st9 + } + goto st0 + st9: + if p++; p == pe { + goto _test_eof9 + } + st_case_9: + if data[p] == 99 { + goto st10 + } + goto st0 + st10: + if p++; p == pe { + goto _test_eof10 + } + st_case_10: + if data[p] == 101 { + goto st11 + } + goto st0 + st11: + if p++; p == pe { + goto _test_eof11 + } + st_case_11: + if data[p] == 95 { + goto st12 + } + goto st0 + st12: + if p++; p == pe { + goto _test_eof12 + } + st_case_12: + if data[p] == 99 { + goto st13 + } + goto st0 + st13: + if p++; p == pe { + goto _test_eof13 + } + st_case_13: + if data[p] == 111 { + goto st14 + } + goto st0 + st14: + if p++; p == pe { + goto _test_eof14 + } + st_case_14: + if data[p] == 100 { + goto st15 + } + goto st0 + st15: + if p++; p == pe { + goto _test_eof15 + } + st_case_15: + if data[p] == 101 { + goto st16 + } + goto st0 + st16: + if p++; p == pe { + goto _test_eof16 + } + st_case_16: + if data[p] == 39 { + goto st17 + } + goto st0 + st17: + if p++; p == pe { + goto _test_eof17 + } + st_case_17: + if data[p] == 32 { + goto st18 + } + goto st0 + st18: + if p++; p == pe { + goto _test_eof18 + } + st_case_18: + if data[p] == 110 { + goto st19 + } + goto st0 + st19: + if p++; p == pe { + goto _test_eof19 + } + st_case_19: + if data[p] == 111 { + goto st20 + } + goto st0 + st20: + if p++; p == pe { + goto _test_eof20 + } + st_case_20: + if data[p] == 116 { + goto st21 + } + goto st0 + st21: + if p++; p == pe { + goto _test_eof21 + } + st_case_21: + if data[p] == 32 { + goto st22 + } + goto st0 + st22: + if p++; p == pe { + goto _test_eof22 + } + st_case_22: + if data[p] == 115 { + goto st23 + } + goto st0 + st23: + if p++; p == pe { + goto _test_eof23 + } + st_case_23: + if data[p] == 112 { + goto st24 + } + goto st0 + st24: + if p++; p == pe { + goto _test_eof24 + } + st_case_24: + if data[p] == 101 { + goto st25 + } + goto st0 + st25: + if p++; p == pe { + goto _test_eof25 + } + st_case_25: + if data[p] == 99 { + goto st26 + } + goto st0 + st26: + if p++; p == pe { + goto _test_eof26 + } + st_case_26: + if data[p] == 105 { + goto st27 + } + goto st0 + st27: + if p++; p == pe { + goto _test_eof27 + } + st_case_27: + if data[p] == 102 { + goto st28 + } + goto st0 + st28: + if p++; p == pe { + goto _test_eof28 + } + st_case_28: + if data[p] == 105 { + goto st29 + } + goto st0 + st29: + if p++; p == pe { + goto _test_eof29 + } + st_case_29: + if data[p] == 101 { + goto st30 + } + goto st0 + st30: + if p++; p == pe { + goto _test_eof30 + } + st_case_30: + if data[p] == 100 { + goto st31 + } + goto st0 + st31: + if p++; p == pe { + goto _test_eof31 + } + st_case_31: + if data[p] == 46 { + goto st32 + } + goto st0 + st32: + if p++; p == pe { + goto _test_eof32 + } + st_case_32: + if data[p] == 32 { + goto st33 + } + goto st0 + st33: + if p++; p == pe { + goto _test_eof33 + } + st_case_33: + if data[p] == 65 { + goto st34 + } + goto st0 + st34: + if p++; p == pe { + goto _test_eof34 + } + st_case_34: + if data[p] == 115 { + goto st35 + } + goto st0 + st35: + if p++; p == pe { + goto _test_eof35 + } + st_case_35: + if data[p] == 115 { + goto st36 + } + goto st0 + st36: + if p++; p == pe { + goto _test_eof36 + } + st_case_36: + if data[p] == 117 { + goto st37 + } + goto st0 + st37: + if p++; p == pe { + goto _test_eof37 + } + st_case_37: + if data[p] == 109 { + goto st38 + } + goto st0 + st38: + if p++; p == pe { + goto _test_eof38 + } + st_case_38: + if data[p] == 105 { + goto st39 + } + goto st0 + st39: + if p++; p == pe { + goto _test_eof39 + } + st_case_39: + if data[p] == 110 { + goto st40 + } + goto st0 + st40: + if p++; p == pe { + goto _test_eof40 + } + st_case_40: + if data[p] == 103 { + goto st41 + } + goto st0 + st41: + if p++; p == pe { + goto _test_eof41 + } + st_case_41: + if data[p] == 32 { + goto st42 + } + goto st0 + st42: + if p++; p == pe { + goto _test_eof42 + } + st_case_42: + if data[p] == 39 { + goto st43 + } + goto st0 + st43: + if p++; p == pe { + goto _test_eof43 + } + st_case_43: + if data[p] == 90 { + goto st44 + } + goto st0 + st44: + if p++; p == pe { + goto _test_eof44 + } + st_case_44: + if data[p] == 80 { + goto st45 + } + goto st0 + st45: + if p++; p == pe { + goto _test_eof45 + } + st_case_45: + if data[p] == 71 { + goto st46 + } + goto st0 + st46: + if p++; p == pe { + goto _test_eof46 + } + st_case_46: + if data[p] == 39 { + goto tr53 + } + goto st0 + tr53: +//line matcher.rl:68 + + agg.find(agg.current).assumeZPG = true + return true + + goto st408 + tr86: +//line matcher.rl:84 + + agg.find(agg.current).assumeCM++ + return true + + goto st408 + tr125: +//line matcher.rl:79 + + agg.find(pop()).unknown = true + return true + + goto st408 + tr179: +//line matcher.rl:49 + + agg.current = current() + return true + + goto st408 + tr221: +//line matcher.rl:73 + + v, _ = strconv.Atoi(pop()) + agg.find(agg.current).badValues += v + return true + + goto st408 + tr279: +//line matcher.rl:107 + + agg.hold = l + return true + + goto st408 + tr326: +//line matcher.rl:54 + + g = agg.find(current()) + v, _ = strconv.Atoi(pop()) + g.measurements += v + return true + + goto st408 + tr361: +//line matcher.rl:61 + + g = agg.find(current()) + v, _ = strconv.Atoi(pop()) + g.predictions += v + return true + + goto st408 + tr389: +//line matcher.rl:95 + + g = agg.find(agg.current) + g.missingValues = extend(g.missingValues, pop()) + return true + + goto st408 + tr418: +//line matcher.rl:101 + + g = agg.find(agg.current) + g.rescaleErrors = extend(g.rescaleErrors, pop()) + return true + + goto st408 + st408: + if p++; p == pe { + goto _test_eof408 + } + st_case_408: +//line matcher.go:1406 + goto st0 + st47: + if p++; p == pe { + goto _test_eof47 + } + st_case_47: + if data[p] == 110 { + goto st48 + } + goto st0 + st48: + if p++; p == pe { + goto _test_eof48 + } + st_case_48: + if data[p] == 105 { + goto st49 + } + goto st0 + st49: + if p++; p == pe { + goto _test_eof49 + } + st_case_49: + if data[p] == 116 { + goto st50 + } + goto st0 + st50: + if p++; p == pe { + goto _test_eof50 + } + st_case_50: + if data[p] == 39 { + goto st51 + } + goto st0 + st51: + if p++; p == pe { + goto _test_eof51 + } + st_case_51: + if data[p] == 32 { + goto st52 + } + goto st0 + st52: + if p++; p == pe { + goto _test_eof52 + } + st_case_52: + if data[p] == 110 { + goto st53 + } + goto st0 + st53: + if p++; p == pe { + goto _test_eof53 + } + st_case_53: + if data[p] == 111 { + goto st54 + } + goto st0 + st54: + if p++; p == pe { + goto _test_eof54 + } + st_case_54: + if data[p] == 116 { + goto st55 + } + goto st0 + st55: + if p++; p == pe { + goto _test_eof55 + } + st_case_55: + if data[p] == 32 { + goto st56 + } + goto st0 + st56: + if p++; p == pe { + goto _test_eof56 + } + st_case_56: + if data[p] == 115 { + goto st57 + } + goto st0 + st57: + if p++; p == pe { + goto _test_eof57 + } + st_case_57: + if data[p] == 112 { + goto st58 + } + goto st0 + st58: + if p++; p == pe { + goto _test_eof58 + } + st_case_58: + if data[p] == 101 { + goto st59 + } + goto st0 + st59: + if p++; p == pe { + goto _test_eof59 + } + st_case_59: + if data[p] == 99 { + goto st60 + } + goto st0 + st60: + if p++; p == pe { + goto _test_eof60 + } + st_case_60: + if data[p] == 105 { + goto st61 + } + goto st0 + st61: + if p++; p == pe { + goto _test_eof61 + } + st_case_61: + if data[p] == 102 { + goto st62 + } + goto st0 + st62: + if p++; p == pe { + goto _test_eof62 + } + st_case_62: + if data[p] == 105 { + goto st63 + } + goto st0 + st63: + if p++; p == pe { + goto _test_eof63 + } + st_case_63: + if data[p] == 101 { + goto st64 + } + goto st0 + st64: + if p++; p == pe { + goto _test_eof64 + } + st_case_64: + if data[p] == 100 { + goto st65 + } + goto st0 + st65: + if p++; p == pe { + goto _test_eof65 + } + st_case_65: + if data[p] == 46 { + goto st66 + } + goto st0 + st66: + if p++; p == pe { + goto _test_eof66 + } + st_case_66: + if data[p] == 32 { + goto st67 + } + goto st0 + st67: + if p++; p == pe { + goto _test_eof67 + } + st_case_67: + if data[p] == 65 { + goto st68 + } + goto st0 + st68: + if p++; p == pe { + goto _test_eof68 + } + st_case_68: + if data[p] == 115 { + goto st69 + } + goto st0 + st69: + if p++; p == pe { + goto _test_eof69 + } + st_case_69: + if data[p] == 115 { + goto st70 + } + goto st0 + st70: + if p++; p == pe { + goto _test_eof70 + } + st_case_70: + if data[p] == 117 { + goto st71 + } + goto st0 + st71: + if p++; p == pe { + goto _test_eof71 + } + st_case_71: + if data[p] == 109 { + goto st72 + } + goto st0 + st72: + if p++; p == pe { + goto _test_eof72 + } + st_case_72: + if data[p] == 105 { + goto st73 + } + goto st0 + st73: + if p++; p == pe { + goto _test_eof73 + } + st_case_73: + if data[p] == 110 { + goto st74 + } + goto st0 + st74: + if p++; p == pe { + goto _test_eof74 + } + st_case_74: + if data[p] == 103 { + goto st75 + } + goto st0 + st75: + if p++; p == pe { + goto _test_eof75 + } + st_case_75: + if data[p] == 32 { + goto st76 + } + goto st0 + st76: + if p++; p == pe { + goto _test_eof76 + } + st_case_76: + if data[p] == 39 { + goto st77 + } + goto st0 + st77: + if p++; p == pe { + goto _test_eof77 + } + st_case_77: + if data[p] == 99 { + goto st78 + } + goto st0 + st78: + if p++; p == pe { + goto _test_eof78 + } + st_case_78: + if data[p] == 109 { + goto st79 + } + goto st0 + st79: + if p++; p == pe { + goto _test_eof79 + } + st_case_79: + if data[p] == 39 { + goto tr86 + } + goto st0 + st80: + if p++; p == pe { + goto _test_eof80 + } + st_case_80: + if data[p] == 97 { + goto st81 + } + goto st0 + st81: + if p++; p == pe { + goto _test_eof81 + } + st_case_81: + if data[p] == 110 { + goto st82 + } + goto st0 + st82: + if p++; p == pe { + goto _test_eof82 + } + st_case_82: + if data[p] == 110 { + goto st83 + } + goto st0 + st83: + if p++; p == pe { + goto _test_eof83 + } + st_case_83: + if data[p] == 111 { + goto st84 + } + goto st0 + st84: + if p++; p == pe { + goto _test_eof84 + } + st_case_84: + if data[p] == 116 { + goto st85 + } + goto st0 + st85: + if p++; p == pe { + goto _test_eof85 + } + st_case_85: + if data[p] == 32 { + goto st86 + } + goto st0 + st86: + if p++; p == pe { + goto _test_eof86 + } + st_case_86: + if data[p] == 102 { + goto st87 + } + goto st0 + st87: + if p++; p == pe { + goto _test_eof87 + } + st_case_87: + if data[p] == 105 { + goto st88 + } + goto st0 + st88: + if p++; p == pe { + goto _test_eof88 + } + st_case_88: + if data[p] == 110 { + goto st89 + } + goto st0 + st89: + if p++; p == pe { + goto _test_eof89 + } + st_case_89: + if data[p] == 100 { + goto st90 + } + goto st0 + st90: + if p++; p == pe { + goto _test_eof90 + } + st_case_90: + if data[p] == 32 { + goto st91 + } + goto st0 + st91: + if p++; p == pe { + goto _test_eof91 + } + st_case_91: + if data[p] == 103 { + goto st92 + } + goto st0 + st92: + if p++; p == pe { + goto _test_eof92 + } + st_case_92: + if data[p] == 97 { + goto st93 + } + goto st0 + st93: + if p++; p == pe { + goto _test_eof93 + } + st_case_93: + if data[p] == 117 { + goto st94 + } + goto st0 + st94: + if p++; p == pe { + goto _test_eof94 + } + st_case_94: + if data[p] == 103 { + goto st95 + } + goto st0 + st95: + if p++; p == pe { + goto _test_eof95 + } + st_case_95: + if data[p] == 101 { + goto st96 + } + goto st0 + st96: + if p++; p == pe { + goto _test_eof96 + } + st_case_96: + if data[p] == 32 { + goto st97 + } + goto st0 + st97: + if p++; p == pe { + goto _test_eof97 + } + st_case_97: + if data[p] == 34 { + goto tr104 + } + goto st0 + tr104: +//line matcher.rl:45 + pos = p + goto st98 + st98: + if p++; p == pe { + goto _test_eof98 + } + st_case_98: +//line matcher.go:1876 + goto st99 + st99: + if p++; p == pe { + goto _test_eof99 + } + st_case_99: + goto st100 + st100: + if p++; p == pe { + goto _test_eof100 + } + st_case_100: + goto st101 + st101: + if p++; p == pe { + goto _test_eof101 + } + st_case_101: + goto st102 + st102: + if p++; p == pe { + goto _test_eof102 + } + st_case_102: + goto st103 + st103: + if p++; p == pe { + goto _test_eof103 + } + st_case_103: + goto st104 + st104: + if p++; p == pe { + goto _test_eof104 + } + st_case_104: + goto st105 + st105: + if p++; p == pe { + goto _test_eof105 + } + st_case_105: + goto st106 + st106: + if p++; p == pe { + goto _test_eof106 + } + st_case_106: + goto st107 + st107: + if p++; p == pe { + goto _test_eof107 + } + st_case_107: + goto st108 + st108: + if p++; p == pe { + goto _test_eof108 + } + st_case_108: + goto st109 + st109: + if p++; p == pe { + goto _test_eof109 + } + st_case_109: + goto st110 + st110: + if p++; p == pe { + goto _test_eof110 + } + st_case_110: + goto st111 + st111: + if p++; p == pe { + goto _test_eof111 + } + st_case_111: + goto st112 + st112: + if p++; p == pe { + goto _test_eof112 + } + st_case_112: + goto st113 + st113: + if p++; p == pe { + goto _test_eof113 + } + st_case_113: + goto st114 + st114: + if p++; p == pe { + goto _test_eof114 + } + st_case_114: + goto st115 + st115: + if p++; p == pe { + goto _test_eof115 + } + st_case_115: + goto st116 + st116: + if p++; p == pe { + goto _test_eof116 + } + st_case_116: + goto st117 + st117: + if p++; p == pe { + goto _test_eof117 + } + st_case_117: + goto tr124 + tr124: +//line matcher.rl:47 + stack = append(stack, current()) + goto st118 + st118: + if p++; p == pe { + goto _test_eof118 + } + st_case_118: +//line matcher.go:2001 + if data[p] == 34 { + goto tr125 + } + goto st0 + st119: + if p++; p == pe { + goto _test_eof119 + } + st_case_119: + if data[p] == 111 { + goto st120 + } + goto st0 + st120: + if p++; p == pe { + goto _test_eof120 + } + st_case_120: + if data[p] == 117 { + goto st121 + } + goto st0 + st121: + if p++; p == pe { + goto _test_eof121 + } + st_case_121: + if data[p] == 110 { + goto st122 + } + goto st0 + st122: + if p++; p == pe { + goto _test_eof122 + } + st_case_122: + if data[p] == 100 { + goto st123 + } + goto st0 + st123: + if p++; p == pe { + goto _test_eof123 + } + st_case_123: + if data[p] == 32 { + goto st124 + } + goto st0 + st124: + if p++; p == pe { + goto _test_eof124 + } + st_case_124: + if data[p] == 109 { + goto st125 + } + goto st0 + st125: + if p++; p == pe { + goto _test_eof125 + } + st_case_125: + if data[p] == 101 { + goto st126 + } + goto st0 + st126: + if p++; p == pe { + goto _test_eof126 + } + st_case_126: + if data[p] == 97 { + goto st127 + } + goto st0 + st127: + if p++; p == pe { + goto _test_eof127 + } + st_case_127: + if data[p] == 115 { + goto st128 + } + goto st0 + st128: + if p++; p == pe { + goto _test_eof128 + } + st_case_128: + if data[p] == 117 { + goto st129 + } + goto st0 + st129: + if p++; p == pe { + goto _test_eof129 + } + st_case_129: + if data[p] == 114 { + goto st130 + } + goto st0 + st130: + if p++; p == pe { + goto _test_eof130 + } + st_case_130: + if data[p] == 101 { + goto st131 + } + goto st0 + st131: + if p++; p == pe { + goto _test_eof131 + } + st_case_131: + if data[p] == 109 { + goto st132 + } + goto st0 + st132: + if p++; p == pe { + goto _test_eof132 + } + st_case_132: + if data[p] == 101 { + goto st133 + } + goto st0 + st133: + if p++; p == pe { + goto _test_eof133 + } + st_case_133: + if data[p] == 110 { + goto st134 + } + goto st0 + st134: + if p++; p == pe { + goto _test_eof134 + } + st_case_134: + if data[p] == 116 { + goto st135 + } + goto st0 + st135: + if p++; p == pe { + goto _test_eof135 + } + st_case_135: + if data[p] == 115 { + goto st136 + } + goto st0 + st136: + if p++; p == pe { + goto _test_eof136 + } + st_case_136: + if data[p] == 47 { + goto st137 + } + goto st0 + st137: + if p++; p == pe { + goto _test_eof137 + } + st_case_137: + if data[p] == 112 { + goto st138 + } + goto st0 + st138: + if p++; p == pe { + goto _test_eof138 + } + st_case_138: + if data[p] == 114 { + goto st139 + } + goto st0 + st139: + if p++; p == pe { + goto _test_eof139 + } + st_case_139: + if data[p] == 101 { + goto st140 + } + goto st0 + st140: + if p++; p == pe { + goto _test_eof140 + } + st_case_140: + if data[p] == 100 { + goto st141 + } + goto st0 + st141: + if p++; p == pe { + goto _test_eof141 + } + st_case_141: + if data[p] == 105 { + goto st142 + } + goto st0 + st142: + if p++; p == pe { + goto _test_eof142 + } + st_case_142: + if data[p] == 99 { + goto st143 + } + goto st0 + st143: + if p++; p == pe { + goto _test_eof143 + } + st_case_143: + if data[p] == 116 { + goto st144 + } + goto st0 + st144: + if p++; p == pe { + goto _test_eof144 + } + st_case_144: + if data[p] == 105 { + goto st145 + } + goto st0 + st145: + if p++; p == pe { + goto _test_eof145 + } + st_case_145: + if data[p] == 111 { + goto st146 + } + goto st0 + st146: + if p++; p == pe { + goto _test_eof146 + } + st_case_146: + if data[p] == 110 { + goto st147 + } + goto st0 + st147: + if p++; p == pe { + goto _test_eof147 + } + st_case_147: + if data[p] == 115 { + goto st148 + } + goto st0 + st148: + if p++; p == pe { + goto _test_eof148 + } + st_case_148: + if data[p] == 32 { + goto st149 + } + goto st0 + st149: + if p++; p == pe { + goto _test_eof149 + } + st_case_149: + if data[p] == 102 { + goto st150 + } + goto st0 + st150: + if p++; p == pe { + goto _test_eof150 + } + st_case_150: + if data[p] == 111 { + goto st151 + } + goto st0 + st151: + if p++; p == pe { + goto _test_eof151 + } + st_case_151: + if data[p] == 114 { + goto st152 + } + goto st0 + st152: + if p++; p == pe { + goto _test_eof152 + } + st_case_152: + if data[p] == 32 { + goto tr159 + } + goto st0 + tr159: +//line matcher.rl:45 + pos = p + goto st153 + st153: + if p++; p == pe { + goto _test_eof153 + } + st_case_153: +//line matcher.go:2321 + goto st154 + st154: + if p++; p == pe { + goto _test_eof154 + } + st_case_154: + goto st155 + st155: + if p++; p == pe { + goto _test_eof155 + } + st_case_155: + goto st156 + st156: + if p++; p == pe { + goto _test_eof156 + } + st_case_156: + goto st157 + st157: + if p++; p == pe { + goto _test_eof157 + } + st_case_157: + goto st158 + st158: + if p++; p == pe { + goto _test_eof158 + } + st_case_158: + goto st159 + st159: + if p++; p == pe { + goto _test_eof159 + } + st_case_159: + goto st160 + st160: + if p++; p == pe { + goto _test_eof160 + } + st_case_160: + goto st161 + st161: + if p++; p == pe { + goto _test_eof161 + } + st_case_161: + goto st162 + st162: + if p++; p == pe { + goto _test_eof162 + } + st_case_162: + goto st163 + st163: + if p++; p == pe { + goto _test_eof163 + } + st_case_163: + goto st164 + st164: + if p++; p == pe { + goto _test_eof164 + } + st_case_164: + goto st165 + st165: + if p++; p == pe { + goto _test_eof165 + } + st_case_165: + goto st166 + st166: + if p++; p == pe { + goto _test_eof166 + } + st_case_166: + goto st167 + st167: + if p++; p == pe { + goto _test_eof167 + } + st_case_167: + goto st168 + st168: + if p++; p == pe { + goto _test_eof168 + } + st_case_168: + goto st169 + st169: + if p++; p == pe { + goto _test_eof169 + } + st_case_169: + goto st170 + st170: + if p++; p == pe { + goto _test_eof170 + } + st_case_170: + goto st171 + st171: + if p++; p == pe { + goto _test_eof171 + } + st_case_171: + goto st172 + st172: + if p++; p == pe { + goto _test_eof172 + } + st_case_172: + goto tr179 + st173: + if p++; p == pe { + goto _test_eof173 + } + st_case_173: + switch data[p] { + case 103: + goto st174 + case 109: + goto st238 + case 110: + goto st270 + } + goto st0 + st174: + if p++; p == pe { + goto _test_eof174 + } + st_case_174: + if data[p] == 110 { + goto st175 + } + goto st0 + st175: + if p++; p == pe { + goto _test_eof175 + } + st_case_175: + if data[p] == 111 { + goto st176 + } + goto st0 + st176: + if p++; p == pe { + goto _test_eof176 + } + st_case_176: + if data[p] == 114 { + goto st177 + } + goto st0 + st177: + if p++; p == pe { + goto _test_eof177 + } + st_case_177: + if data[p] == 101 { + goto st178 + } + goto st0 + st178: + if p++; p == pe { + goto _test_eof178 + } + st_case_178: + if data[p] == 100 { + goto st179 + } + goto st0 + st179: + if p++; p == pe { + goto _test_eof179 + } + st_case_179: + if data[p] == 32 { + goto tr188 + } + goto st0 + tr188: +//line matcher.rl:45 + pos = p + goto st180 + st180: + if p++; p == pe { + goto _test_eof180 + } + st_case_180: +//line matcher.go:2514 + if data[p] == 109 { + goto st212 + } + if 48 <= data[p] && data[p] <= 57 { + goto tr189 + } + goto st0 + tr189: +//line matcher.rl:47 + stack = append(stack, current()) + goto st181 + st181: + if p++; p == pe { + goto _test_eof181 + } + st_case_181: +//line matcher.go:2531 + if data[p] == 32 { + goto st182 + } + if 48 <= data[p] && data[p] <= 57 { + goto tr189 + } + goto st0 + st182: + if p++; p == pe { + goto _test_eof182 + } + st_case_182: + if data[p] == 109 { + goto st183 + } + goto st0 + st183: + if p++; p == pe { + goto _test_eof183 + } + st_case_183: + if data[p] == 101 { + goto st184 + } + goto st0 + st184: + if p++; p == pe { + goto _test_eof184 + } + st_case_184: + if data[p] == 97 { + goto st185 + } + goto st0 + st185: + if p++; p == pe { + goto _test_eof185 + } + st_case_185: + if data[p] == 115 { + goto st186 + } + goto st0 + st186: + if p++; p == pe { + goto _test_eof186 + } + st_case_186: + if data[p] == 117 { + goto st187 + } + goto st0 + st187: + if p++; p == pe { + goto _test_eof187 + } + st_case_187: + if data[p] == 114 { + goto st188 + } + goto st0 + st188: + if p++; p == pe { + goto _test_eof188 + } + st_case_188: + if data[p] == 101 { + goto st189 + } + goto st0 + st189: + if p++; p == pe { + goto _test_eof189 + } + st_case_189: + if data[p] == 109 { + goto st190 + } + goto st0 + st190: + if p++; p == pe { + goto _test_eof190 + } + st_case_190: + if data[p] == 101 { + goto st191 + } + goto st0 + st191: + if p++; p == pe { + goto _test_eof191 + } + st_case_191: + if data[p] == 110 { + goto st192 + } + goto st0 + st192: + if p++; p == pe { + goto _test_eof192 + } + st_case_192: + if data[p] == 116 { + goto st193 + } + goto st0 + st193: + if p++; p == pe { + goto _test_eof193 + } + st_case_193: + if data[p] == 115 { + goto st194 + } + goto st0 + st194: + if p++; p == pe { + goto _test_eof194 + } + st_case_194: + if data[p] == 32 { + goto st195 + } + goto st0 + st195: + if p++; p == pe { + goto _test_eof195 + } + st_case_195: + if data[p] == 119 { + goto st196 + } + goto st0 + st196: + if p++; p == pe { + goto _test_eof196 + } + st_case_196: + if data[p] == 105 { + goto st197 + } + goto st0 + st197: + if p++; p == pe { + goto _test_eof197 + } + st_case_197: + if data[p] == 116 { + goto st198 + } + goto st0 + st198: + if p++; p == pe { + goto _test_eof198 + } + st_case_198: + if data[p] == 104 { + goto st199 + } + goto st0 + st199: + if p++; p == pe { + goto _test_eof199 + } + st_case_199: + if data[p] == 32 { + goto st200 + } + goto st0 + st200: + if p++; p == pe { + goto _test_eof200 + } + st_case_200: + if data[p] == 118 { + goto st201 + } + goto st0 + st201: + if p++; p == pe { + goto _test_eof201 + } + st_case_201: + if data[p] == 97 { + goto st202 + } + goto st0 + st202: + if p++; p == pe { + goto _test_eof202 + } + st_case_202: + if data[p] == 108 { + goto st203 + } + goto st0 + st203: + if p++; p == pe { + goto _test_eof203 + } + st_case_203: + if data[p] == 117 { + goto st204 + } + goto st0 + st204: + if p++; p == pe { + goto _test_eof204 + } + st_case_204: + if data[p] == 101 { + goto st205 + } + goto st0 + st205: + if p++; p == pe { + goto _test_eof205 + } + st_case_205: + if data[p] == 32 { + goto st206 + } + goto st0 + st206: + if p++; p == pe { + goto _test_eof206 + } + st_case_206: + if data[p] == 45 { + goto st207 + } + goto st0 + st207: + if p++; p == pe { + goto _test_eof207 + } + st_case_207: + if data[p] == 57 { + goto st208 + } + goto st0 + st208: + if p++; p == pe { + goto _test_eof208 + } + st_case_208: + if data[p] == 57 { + goto st209 + } + goto st0 + st209: + if p++; p == pe { + goto _test_eof209 + } + st_case_209: + if data[p] == 57 { + goto st210 + } + goto st0 + st210: + if p++; p == pe { + goto _test_eof210 + } + st_case_210: + if data[p] == 57 { + goto st211 + } + goto st0 + st211: + if p++; p == pe { + goto _test_eof211 + } + st_case_211: + if data[p] == 57 { + goto tr221 + } + goto st0 + st212: + if p++; p == pe { + goto _test_eof212 + } + st_case_212: + if data[p] == 101 { + goto st213 + } + goto st0 + st213: + if p++; p == pe { + goto _test_eof213 + } + st_case_213: + if data[p] == 115 { + goto st214 + } + goto st0 + st214: + if p++; p == pe { + goto _test_eof214 + } + st_case_214: + if data[p] == 115 { + goto st215 + } + goto st0 + st215: + if p++; p == pe { + goto _test_eof215 + } + st_case_215: + if data[p] == 97 { + goto st216 + } + goto st0 + st216: + if p++; p == pe { + goto _test_eof216 + } + st_case_216: + if data[p] == 103 { + goto st217 + } + goto st0 + st217: + if p++; p == pe { + goto _test_eof217 + } + st_case_217: + if data[p] == 101 { + goto st218 + } + goto st0 + st218: + if p++; p == pe { + goto _test_eof218 + } + st_case_218: + if data[p] == 32 { + goto st219 + } + goto st0 + st219: + if p++; p == pe { + goto _test_eof219 + } + st_case_219: + if data[p] == 119 { + goto st220 + } + goto st0 + st220: + if p++; p == pe { + goto _test_eof220 + } + st_case_220: + if data[p] == 105 { + goto st221 + } + goto st0 + st221: + if p++; p == pe { + goto _test_eof221 + } + st_case_221: + if data[p] == 116 { + goto st222 + } + goto st0 + st222: + if p++; p == pe { + goto _test_eof222 + } + st_case_222: + if data[p] == 104 { + goto st223 + } + goto st0 + st223: + if p++; p == pe { + goto _test_eof223 + } + st_case_223: + if data[p] == 32 { + goto st224 + } + goto st0 + st224: + if p++; p == pe { + goto _test_eof224 + } + st_case_224: + if data[p] == 109 { + goto st225 + } + goto st0 + st225: + if p++; p == pe { + goto _test_eof225 + } + st_case_225: + if data[p] == 101 { + goto st226 + } + goto st0 + st226: + if p++; p == pe { + goto _test_eof226 + } + st_case_226: + if data[p] == 97 { + goto st227 + } + goto st0 + st227: + if p++; p == pe { + goto _test_eof227 + } + st_case_227: + if data[p] == 115 { + goto st228 + } + goto st0 + st228: + if p++; p == pe { + goto _test_eof228 + } + st_case_228: + if data[p] == 117 { + goto st229 + } + goto st0 + st229: + if p++; p == pe { + goto _test_eof229 + } + st_case_229: + if data[p] == 114 { + goto st230 + } + goto st0 + st230: + if p++; p == pe { + goto _test_eof230 + } + st_case_230: + if data[p] == 101 { + goto st231 + } + goto st0 + st231: + if p++; p == pe { + goto _test_eof231 + } + st_case_231: + if data[p] == 95 { + goto st232 + } + goto st0 + st232: + if p++; p == pe { + goto _test_eof232 + } + st_case_232: + if data[p] == 99 { + goto st233 + } + goto st0 + st233: + if p++; p == pe { + goto _test_eof233 + } + st_case_233: + if data[p] == 111 { + goto st234 + } + goto st0 + st234: + if p++; p == pe { + goto _test_eof234 + } + st_case_234: + if data[p] == 100 { + goto st235 + } + goto st0 + st235: + if p++; p == pe { + goto _test_eof235 + } + st_case_235: + if data[p] == 101 { + goto st236 + } + goto st0 + st236: + if p++; p == pe { + goto _test_eof236 + } + st_case_236: + if data[p] == 32 { + goto tr246 + } + goto st0 + tr246: +//line matcher.rl:45 + pos = p + goto st237 + st237: + if p++; p == pe { + goto _test_eof237 + } + st_case_237: +//line matcher.go:3043 + goto tr247 + tr247: +//line matcher.rl:89 + + g = agg.find(agg.current) + g.ignMeasCodes = extend(g.ignMeasCodes, current()) + return true + + goto st409 + st409: + if p++; p == pe { + goto _test_eof409 + } + st_case_409: +//line matcher.go:3058 + goto tr247 + st238: + if p++; p == pe { + goto _test_eof238 + } + st_case_238: + if data[p] == 112 { + goto st239 + } + goto st0 + st239: + if p++; p == pe { + goto _test_eof239 + } + st_case_239: + if data[p] == 111 { + goto st240 + } + goto st0 + st240: + if p++; p == pe { + goto _test_eof240 + } + st_case_240: + if data[p] == 114 { + goto st241 + } + goto st0 + st241: + if p++; p == pe { + goto _test_eof241 + } + st_case_241: + if data[p] == 116 { + goto st242 + } + goto st0 + st242: + if p++; p == pe { + goto _test_eof242 + } + st_case_242: + if data[p] == 105 { + goto st243 + } + goto st0 + st243: + if p++; p == pe { + goto _test_eof243 + } + st_case_243: + if data[p] == 110 { + goto st244 + } + goto st0 + st244: + if p++; p == pe { + goto _test_eof244 + } + st_case_244: + if data[p] == 103 { + goto st245 + } + goto st0 + st245: + if p++; p == pe { + goto _test_eof245 + } + st_case_245: + if data[p] == 32 { + goto st246 + } + goto st0 + st246: + if p++; p == pe { + goto _test_eof246 + } + st_case_246: + if data[p] == 103 { + goto st247 + } + goto st0 + st247: + if p++; p == pe { + goto _test_eof247 + } + st_case_247: + if data[p] == 97 { + goto st248 + } + goto st0 + st248: + if p++; p == pe { + goto _test_eof248 + } + st_case_248: + if data[p] == 117 { + goto st249 + } + goto st0 + st249: + if p++; p == pe { + goto _test_eof249 + } + st_case_249: + if data[p] == 103 { + goto st250 + } + goto st0 + st250: + if p++; p == pe { + goto _test_eof250 + } + st_case_250: + if data[p] == 101 { + goto st251 + } + goto st0 + st251: + if p++; p == pe { + goto _test_eof251 + } + st_case_251: + if data[p] == 32 { + goto st252 + } + goto st0 + st252: + if p++; p == pe { + goto _test_eof252 + } + st_case_252: + if data[p] == 109 { + goto st253 + } + goto st0 + st253: + if p++; p == pe { + goto _test_eof253 + } + st_case_253: + if data[p] == 101 { + goto st254 + } + goto st0 + st254: + if p++; p == pe { + goto _test_eof254 + } + st_case_254: + if data[p] == 97 { + goto st255 + } + goto st0 + st255: + if p++; p == pe { + goto _test_eof255 + } + st_case_255: + if data[p] == 115 { + goto st256 + } + goto st0 + st256: + if p++; p == pe { + goto _test_eof256 + } + st_case_256: + if data[p] == 117 { + goto st257 + } + goto st0 + st257: + if p++; p == pe { + goto _test_eof257 + } + st_case_257: + if data[p] == 114 { + goto st258 + } + goto st0 + st258: + if p++; p == pe { + goto _test_eof258 + } + st_case_258: + if data[p] == 101 { + goto st259 + } + goto st0 + st259: + if p++; p == pe { + goto _test_eof259 + } + st_case_259: + if data[p] == 109 { + goto st260 + } + goto st0 + st260: + if p++; p == pe { + goto _test_eof260 + } + st_case_260: + if data[p] == 101 { + goto st261 + } + goto st0 + st261: + if p++; p == pe { + goto _test_eof261 + } + st_case_261: + if data[p] == 110 { + goto st262 + } + goto st0 + st262: + if p++; p == pe { + goto _test_eof262 + } + st_case_262: + if data[p] == 116 { + goto st263 + } + goto st0 + st263: + if p++; p == pe { + goto _test_eof263 + } + st_case_263: + if data[p] == 115 { + goto st264 + } + goto st0 + st264: + if p++; p == pe { + goto _test_eof264 + } + st_case_264: + if data[p] == 32 { + goto st265 + } + goto st0 + st265: + if p++; p == pe { + goto _test_eof265 + } + st_case_265: + if data[p] == 116 { + goto st266 + } + goto st0 + st266: + if p++; p == pe { + goto _test_eof266 + } + st_case_266: + if data[p] == 111 { + goto st267 + } + goto st0 + st267: + if p++; p == pe { + goto _test_eof267 + } + st_case_267: + if data[p] == 111 { + goto st268 + } + goto st0 + st268: + if p++; p == pe { + goto _test_eof268 + } + st_case_268: + if data[p] == 107 { + goto st269 + } + goto st0 + st269: + if p++; p == pe { + goto _test_eof269 + } + st_case_269: + if data[p] == 32 { + goto tr279 + } + goto st0 + st270: + if p++; p == pe { + goto _test_eof270 + } + st_case_270: + if data[p] == 115 { + goto st271 + } + goto st0 + st271: + if p++; p == pe { + goto _test_eof271 + } + st_case_271: + if data[p] == 101 { + goto st272 + } + goto st0 + st272: + if p++; p == pe { + goto _test_eof272 + } + st_case_272: + if data[p] == 114 { + goto st273 + } + goto st0 + st273: + if p++; p == pe { + goto _test_eof273 + } + st_case_273: + if data[p] == 116 { + goto st274 + } + goto st0 + st274: + if p++; p == pe { + goto _test_eof274 + } + st_case_274: + if data[p] == 101 { + goto st275 + } + goto st0 + st275: + if p++; p == pe { + goto _test_eof275 + } + st_case_275: + if data[p] == 100 { + goto st276 + } + goto st0 + st276: + if p++; p == pe { + goto _test_eof276 + } + st_case_276: + if data[p] == 32 { + goto tr286 + } + goto st0 + tr286: +//line matcher.rl:45 + pos = p + goto st277 + st277: + if p++; p == pe { + goto _test_eof277 + } + st_case_277: +//line matcher.go:3420 + if 48 <= data[p] && data[p] <= 57 { + goto tr287 + } + goto st0 + tr287: +//line matcher.rl:47 + stack = append(stack, current()) + goto st278 + st278: + if p++; p == pe { + goto _test_eof278 + } + st_case_278: +//line matcher.go:3434 + if data[p] == 32 { + goto st279 + } + if 48 <= data[p] && data[p] <= 57 { + goto tr287 + } + goto st0 + st279: + if p++; p == pe { + goto _test_eof279 + } + st_case_279: + switch data[p] { + case 109: + goto st280 + case 112: + goto st316 + } + goto st0 + st280: + if p++; p == pe { + goto _test_eof280 + } + st_case_280: + if data[p] == 101 { + goto st281 + } + goto st0 + st281: + if p++; p == pe { + goto _test_eof281 + } + st_case_281: + if data[p] == 97 { + goto st282 + } + goto st0 + st282: + if p++; p == pe { + goto _test_eof282 + } + st_case_282: + if data[p] == 115 { + goto st283 + } + goto st0 + st283: + if p++; p == pe { + goto _test_eof283 + } + st_case_283: + if data[p] == 117 { + goto st284 + } + goto st0 + st284: + if p++; p == pe { + goto _test_eof284 + } + st_case_284: + if data[p] == 114 { + goto st285 + } + goto st0 + st285: + if p++; p == pe { + goto _test_eof285 + } + st_case_285: + if data[p] == 101 { + goto st286 + } + goto st0 + st286: + if p++; p == pe { + goto _test_eof286 + } + st_case_286: + if data[p] == 109 { + goto st287 + } + goto st0 + st287: + if p++; p == pe { + goto _test_eof287 + } + st_case_287: + if data[p] == 101 { + goto st288 + } + goto st0 + st288: + if p++; p == pe { + goto _test_eof288 + } + st_case_288: + if data[p] == 110 { + goto st289 + } + goto st0 + st289: + if p++; p == pe { + goto _test_eof289 + } + st_case_289: + if data[p] == 116 { + goto st290 + } + goto st0 + st290: + if p++; p == pe { + goto _test_eof290 + } + st_case_290: + if data[p] == 115 { + goto st291 + } + goto st0 + st291: + if p++; p == pe { + goto _test_eof291 + } + st_case_291: + if data[p] == 32 { + goto st292 + } + goto st0 + st292: + if p++; p == pe { + goto _test_eof292 + } + st_case_292: + if data[p] == 102 { + goto st293 + } + goto st0 + st293: + if p++; p == pe { + goto _test_eof293 + } + st_case_293: + if data[p] == 111 { + goto st294 + } + goto st0 + st294: + if p++; p == pe { + goto _test_eof294 + } + st_case_294: + if data[p] == 114 { + goto st295 + } + goto st0 + st295: + if p++; p == pe { + goto _test_eof295 + } + st_case_295: + if data[p] == 32 { + goto tr306 + } + goto st0 + tr306: +//line matcher.rl:45 + pos = p + goto st296 + st296: + if p++; p == pe { + goto _test_eof296 + } + st_case_296: +//line matcher.go:3607 + goto st297 + st297: + if p++; p == pe { + goto _test_eof297 + } + st_case_297: + goto st298 + st298: + if p++; p == pe { + goto _test_eof298 + } + st_case_298: + goto st299 + st299: + if p++; p == pe { + goto _test_eof299 + } + st_case_299: + goto st300 + st300: + if p++; p == pe { + goto _test_eof300 + } + st_case_300: + goto st301 + st301: + if p++; p == pe { + goto _test_eof301 + } + st_case_301: + goto st302 + st302: + if p++; p == pe { + goto _test_eof302 + } + st_case_302: + goto st303 + st303: + if p++; p == pe { + goto _test_eof303 + } + st_case_303: + goto st304 + st304: + if p++; p == pe { + goto _test_eof304 + } + st_case_304: + goto st305 + st305: + if p++; p == pe { + goto _test_eof305 + } + st_case_305: + goto st306 + st306: + if p++; p == pe { + goto _test_eof306 + } + st_case_306: + goto st307 + st307: + if p++; p == pe { + goto _test_eof307 + } + st_case_307: + goto st308 + st308: + if p++; p == pe { + goto _test_eof308 + } + st_case_308: + goto st309 + st309: + if p++; p == pe { + goto _test_eof309 + } + st_case_309: + goto st310 + st310: + if p++; p == pe { + goto _test_eof310 + } + st_case_310: + goto st311 + st311: + if p++; p == pe { + goto _test_eof311 + } + st_case_311: + goto st312 + st312: + if p++; p == pe { + goto _test_eof312 + } + st_case_312: + goto st313 + st313: + if p++; p == pe { + goto _test_eof313 + } + st_case_313: + goto st314 + st314: + if p++; p == pe { + goto _test_eof314 + } + st_case_314: + goto st315 + st315: + if p++; p == pe { + goto _test_eof315 + } + st_case_315: + goto tr326 + st316: + if p++; p == pe { + goto _test_eof316 + } + st_case_316: + if data[p] == 114 { + goto st317 + } + goto st0 + st317: + if p++; p == pe { + goto _test_eof317 + } + st_case_317: + if data[p] == 101 { + goto st318 + } + goto st0 + st318: + if p++; p == pe { + goto _test_eof318 + } + st_case_318: + if data[p] == 100 { + goto st319 + } + goto st0 + st319: + if p++; p == pe { + goto _test_eof319 + } + st_case_319: + if data[p] == 105 { + goto st320 + } + goto st0 + st320: + if p++; p == pe { + goto _test_eof320 + } + st_case_320: + if data[p] == 99 { + goto st321 + } + goto st0 + st321: + if p++; p == pe { + goto _test_eof321 + } + st_case_321: + if data[p] == 116 { + goto st322 + } + goto st0 + st322: + if p++; p == pe { + goto _test_eof322 + } + st_case_322: + if data[p] == 105 { + goto st323 + } + goto st0 + st323: + if p++; p == pe { + goto _test_eof323 + } + st_case_323: + if data[p] == 111 { + goto st324 + } + goto st0 + st324: + if p++; p == pe { + goto _test_eof324 + } + st_case_324: + if data[p] == 110 { + goto st325 + } + goto st0 + st325: + if p++; p == pe { + goto _test_eof325 + } + st_case_325: + if data[p] == 115 { + goto st326 + } + goto st0 + st326: + if p++; p == pe { + goto _test_eof326 + } + st_case_326: + if data[p] == 32 { + goto st327 + } + goto st0 + st327: + if p++; p == pe { + goto _test_eof327 + } + st_case_327: + if data[p] == 102 { + goto st328 + } + goto st0 + st328: + if p++; p == pe { + goto _test_eof328 + } + st_case_328: + if data[p] == 111 { + goto st329 + } + goto st0 + st329: + if p++; p == pe { + goto _test_eof329 + } + st_case_329: + if data[p] == 114 { + goto st330 + } + goto st0 + st330: + if p++; p == pe { + goto _test_eof330 + } + st_case_330: + if data[p] == 32 { + goto tr341 + } + goto st0 + tr341: +//line matcher.rl:45 + pos = p + goto st331 + st331: + if p++; p == pe { + goto _test_eof331 + } + st_case_331: +//line matcher.go:3867 + goto st332 + st332: + if p++; p == pe { + goto _test_eof332 + } + st_case_332: + goto st333 + st333: + if p++; p == pe { + goto _test_eof333 + } + st_case_333: + goto st334 + st334: + if p++; p == pe { + goto _test_eof334 + } + st_case_334: + goto st335 + st335: + if p++; p == pe { + goto _test_eof335 + } + st_case_335: + goto st336 + st336: + if p++; p == pe { + goto _test_eof336 + } + st_case_336: + goto st337 + st337: + if p++; p == pe { + goto _test_eof337 + } + st_case_337: + goto st338 + st338: + if p++; p == pe { + goto _test_eof338 + } + st_case_338: + goto st339 + st339: + if p++; p == pe { + goto _test_eof339 + } + st_case_339: + goto st340 + st340: + if p++; p == pe { + goto _test_eof340 + } + st_case_340: + goto st341 + st341: + if p++; p == pe { + goto _test_eof341 + } + st_case_341: + goto st342 + st342: + if p++; p == pe { + goto _test_eof342 + } + st_case_342: + goto st343 + st343: + if p++; p == pe { + goto _test_eof343 + } + st_case_343: + goto st344 + st344: + if p++; p == pe { + goto _test_eof344 + } + st_case_344: + goto st345 + st345: + if p++; p == pe { + goto _test_eof345 + } + st_case_345: + goto st346 + st346: + if p++; p == pe { + goto _test_eof346 + } + st_case_346: + goto st347 + st347: + if p++; p == pe { + goto _test_eof347 + } + st_case_347: + goto st348 + st348: + if p++; p == pe { + goto _test_eof348 + } + st_case_348: + goto st349 + st349: + if p++; p == pe { + goto _test_eof349 + } + st_case_349: + goto st350 + st350: + if p++; p == pe { + goto _test_eof350 + } + st_case_350: + goto tr361 + st351: + if p++; p == pe { + goto _test_eof351 + } + st_case_351: + if data[p] == 105 { + goto st352 + } + goto st0 + st352: + if p++; p == pe { + goto _test_eof352 + } + st_case_352: + if data[p] == 115 { + goto st353 + } + goto st0 + st353: + if p++; p == pe { + goto _test_eof353 + } + st_case_353: + if data[p] == 115 { + goto st354 + } + goto st0 + st354: + if p++; p == pe { + goto _test_eof354 + } + st_case_354: + if data[p] == 105 { + goto st355 + } + goto st0 + st355: + if p++; p == pe { + goto _test_eof355 + } + st_case_355: + if data[p] == 110 { + goto st356 + } + goto st0 + st356: + if p++; p == pe { + goto _test_eof356 + } + st_case_356: + if data[p] == 103 { + goto st357 + } + goto st0 + st357: + if p++; p == pe { + goto _test_eof357 + } + st_case_357: + if data[p] == 32 { + goto st358 + } + goto st0 + st358: + if p++; p == pe { + goto _test_eof358 + } + st_case_358: + if data[p] == 109 { + goto st359 + } + goto st0 + st359: + if p++; p == pe { + goto _test_eof359 + } + st_case_359: + if data[p] == 97 { + goto st360 + } + goto st0 + st360: + if p++; p == pe { + goto _test_eof360 + } + st_case_360: + if data[p] == 110 { + goto st361 + } + goto st0 + st361: + if p++; p == pe { + goto _test_eof361 + } + st_case_361: + if data[p] == 100 { + goto st362 + } + goto st0 + st362: + if p++; p == pe { + goto _test_eof362 + } + st_case_362: + if data[p] == 97 { + goto st363 + } + goto st0 + st363: + if p++; p == pe { + goto _test_eof363 + } + st_case_363: + if data[p] == 116 { + goto st364 + } + goto st0 + st364: + if p++; p == pe { + goto _test_eof364 + } + st_case_364: + if data[p] == 111 { + goto st365 + } + goto st0 + st365: + if p++; p == pe { + goto _test_eof365 + } + st_case_365: + if data[p] == 114 { + goto st366 + } + goto st0 + st366: + if p++; p == pe { + goto _test_eof366 + } + st_case_366: + if data[p] == 121 { + goto st367 + } + goto st0 + st367: + if p++; p == pe { + goto _test_eof367 + } + st_case_367: + if data[p] == 32 { + goto st368 + } + goto st0 + st368: + if p++; p == pe { + goto _test_eof368 + } + st_case_368: + if data[p] == 118 { + goto st369 + } + goto st0 + st369: + if p++; p == pe { + goto _test_eof369 + } + st_case_369: + if data[p] == 97 { + goto st370 + } + goto st0 + st370: + if p++; p == pe { + goto _test_eof370 + } + st_case_370: + if data[p] == 108 { + goto st371 + } + goto st0 + st371: + if p++; p == pe { + goto _test_eof371 + } + st_case_371: + if data[p] == 117 { + goto st372 + } + goto st0 + st372: + if p++; p == pe { + goto _test_eof372 + } + st_case_372: + if data[p] == 101 { + goto st373 + } + goto st0 + st373: + if p++; p == pe { + goto _test_eof373 + } + st_case_373: + if data[p] == 32 { + goto st374 + } + goto st0 + st374: + if p++; p == pe { + goto _test_eof374 + } + st_case_374: + if data[p] == 97 { + goto st375 + } + goto st0 + st375: + if p++; p == pe { + goto _test_eof375 + } + st_case_375: + if data[p] == 116 { + goto st376 + } + goto st0 + st376: + if p++; p == pe { + goto _test_eof376 + } + st_case_376: + if data[p] == 32 { + goto tr387 + } + goto st0 + tr387: +//line matcher.rl:45 + pos = p + goto st377 + st377: + if p++; p == pe { + goto _test_eof377 + } + st_case_377: +//line matcher.go:4226 + if data[p] == 46 { + goto st0 + } + goto tr388 + tr388: +//line matcher.rl:47 + stack = append(stack, current()) + goto st378 + st378: + if p++; p == pe { + goto _test_eof378 + } + st_case_378: +//line matcher.go:4240 + if data[p] == 46 { + goto tr389 + } + goto tr388 + st379: + if p++; p == pe { + goto _test_eof379 + } + st_case_379: + if data[p] == 114 { + goto st380 + } + goto st0 + st380: + if p++; p == pe { + goto _test_eof380 + } + st_case_380: + if data[p] == 114 { + goto st381 + } + goto st0 + st381: + if p++; p == pe { + goto _test_eof381 + } + st_case_381: + if data[p] == 111 { + goto st382 + } + goto st0 + st382: + if p++; p == pe { + goto _test_eof382 + } + st_case_382: + if data[p] == 114 { + goto st383 + } + goto st0 + st383: + if p++; p == pe { + goto _test_eof383 + } + st_case_383: + if data[p] == 32 { + goto st384 + } + goto st0 + st384: + if p++; p == pe { + goto _test_eof384 + } + st_case_384: + if data[p] == 105 { + goto st385 + } + goto st0 + st385: + if p++; p == pe { + goto _test_eof385 + } + st_case_385: + if data[p] == 110 { + goto st386 + } + goto st0 + st386: + if p++; p == pe { + goto _test_eof386 + } + st_case_386: + if data[p] == 32 { + goto st387 + } + goto st0 + st387: + if p++; p == pe { + goto _test_eof387 + } + st_case_387: + if data[p] == 105 { + goto st388 + } + goto st0 + st388: + if p++; p == pe { + goto _test_eof388 + } + st_case_388: + if data[p] == 109 { + goto st389 + } + goto st0 + st389: + if p++; p == pe { + goto _test_eof389 + } + st_case_389: + if data[p] == 112 { + goto st390 + } + goto st0 + st390: + if p++; p == pe { + goto _test_eof390 + } + st_case_390: + if data[p] == 111 { + goto st391 + } + goto st0 + st391: + if p++; p == pe { + goto _test_eof391 + } + st_case_391: + if data[p] == 114 { + goto st392 + } + goto st0 + st392: + if p++; p == pe { + goto _test_eof392 + } + st_case_392: + if data[p] == 116 { + goto st393 + } + goto st0 + st393: + if p++; p == pe { + goto _test_eof393 + } + st_case_393: + if data[p] == 58 { + goto st269 + } + goto st0 + st394: + if p++; p == pe { + goto _test_eof394 + } + st_case_394: + if data[p] == 110 { + goto st395 + } + goto st0 + st395: + if p++; p == pe { + goto _test_eof395 + } + st_case_395: + if data[p] == 107 { + goto st396 + } + goto st0 + st396: + if p++; p == pe { + goto _test_eof396 + } + st_case_396: + if data[p] == 110 { + goto st397 + } + goto st0 + st397: + if p++; p == pe { + goto _test_eof397 + } + st_case_397: + if data[p] == 111 { + goto st398 + } + goto st0 + st398: + if p++; p == pe { + goto _test_eof398 + } + st_case_398: + if data[p] == 119 { + goto st399 + } + goto st0 + st399: + if p++; p == pe { + goto _test_eof399 + } + st_case_399: + if data[p] == 110 { + goto st400 + } + goto st0 + st400: + if p++; p == pe { + goto _test_eof400 + } + st_case_400: + if data[p] == 32 { + goto st401 + } + goto st0 + st401: + if p++; p == pe { + goto _test_eof401 + } + st_case_401: + if data[p] == 117 { + goto st402 + } + goto st0 + st402: + if p++; p == pe { + goto _test_eof402 + } + st_case_402: + if data[p] == 110 { + goto st403 + } + goto st0 + st403: + if p++; p == pe { + goto _test_eof403 + } + st_case_403: + if data[p] == 105 { + goto st404 + } + goto st0 + st404: + if p++; p == pe { + goto _test_eof404 + } + st_case_404: + if data[p] == 116 { + goto st405 + } + goto st0 + st405: + if p++; p == pe { + goto _test_eof405 + } + st_case_405: + if data[p] == 32 { + goto st406 + } + goto st0 + st406: + if p++; p == pe { + goto _test_eof406 + } + st_case_406: + if data[p] == 39 { + goto tr416 + } + goto st0 + tr416: +//line matcher.rl:45 + pos = p + goto st407 + tr417: +//line matcher.rl:47 + stack = append(stack, current()) + goto st407 + st407: + if p++; p == pe { + goto _test_eof407 + } + st_case_407: +//line matcher.go:4510 + if data[p] == 39 { + goto tr418 + } + goto tr417 + st_out: + _test_eof2: + cs = 2 + goto _test_eof + _test_eof3: + cs = 3 + goto _test_eof + _test_eof4: + cs = 4 + goto _test_eof + _test_eof5: + cs = 5 + goto _test_eof + _test_eof6: + cs = 6 + goto _test_eof + _test_eof7: + cs = 7 + goto _test_eof + _test_eof8: + cs = 8 + goto _test_eof + _test_eof9: + cs = 9 + goto _test_eof + _test_eof10: + cs = 10 + goto _test_eof + _test_eof11: + cs = 11 + goto _test_eof + _test_eof12: + cs = 12 + goto _test_eof + _test_eof13: + cs = 13 + goto _test_eof + _test_eof14: + cs = 14 + goto _test_eof + _test_eof15: + cs = 15 + goto _test_eof + _test_eof16: + cs = 16 + goto _test_eof + _test_eof17: + cs = 17 + goto _test_eof + _test_eof18: + cs = 18 + goto _test_eof + _test_eof19: + cs = 19 + goto _test_eof + _test_eof20: + cs = 20 + goto _test_eof + _test_eof21: + cs = 21 + goto _test_eof + _test_eof22: + cs = 22 + goto _test_eof + _test_eof23: + cs = 23 + goto _test_eof + _test_eof24: + cs = 24 + goto _test_eof + _test_eof25: + cs = 25 + goto _test_eof + _test_eof26: + cs = 26 + goto _test_eof + _test_eof27: + cs = 27 + goto _test_eof + _test_eof28: + cs = 28 + goto _test_eof + _test_eof29: + cs = 29 + goto _test_eof + _test_eof30: + cs = 30 + goto _test_eof + _test_eof31: + cs = 31 + goto _test_eof + _test_eof32: + cs = 32 + goto _test_eof + _test_eof33: + cs = 33 + goto _test_eof + _test_eof34: + cs = 34 + goto _test_eof + _test_eof35: + cs = 35 + goto _test_eof + _test_eof36: + cs = 36 + goto _test_eof + _test_eof37: + cs = 37 + goto _test_eof + _test_eof38: + cs = 38 + goto _test_eof + _test_eof39: + cs = 39 + goto _test_eof + _test_eof40: + cs = 40 + goto _test_eof + _test_eof41: + cs = 41 + goto _test_eof + _test_eof42: + cs = 42 + goto _test_eof + _test_eof43: + cs = 43 + goto _test_eof + _test_eof44: + cs = 44 + goto _test_eof + _test_eof45: + cs = 45 + goto _test_eof + _test_eof46: + cs = 46 + goto _test_eof + _test_eof408: + cs = 408 + goto _test_eof + _test_eof47: + cs = 47 + goto _test_eof + _test_eof48: + cs = 48 + goto _test_eof + _test_eof49: + cs = 49 + goto _test_eof + _test_eof50: + cs = 50 + goto _test_eof + _test_eof51: + cs = 51 + goto _test_eof + _test_eof52: + cs = 52 + goto _test_eof + _test_eof53: + cs = 53 + goto _test_eof + _test_eof54: + cs = 54 + goto _test_eof + _test_eof55: + cs = 55 + goto _test_eof + _test_eof56: + cs = 56 + goto _test_eof + _test_eof57: + cs = 57 + goto _test_eof + _test_eof58: + cs = 58 + goto _test_eof + _test_eof59: + cs = 59 + goto _test_eof + _test_eof60: + cs = 60 + goto _test_eof + _test_eof61: + cs = 61 + goto _test_eof + _test_eof62: + cs = 62 + goto _test_eof + _test_eof63: + cs = 63 + goto _test_eof + _test_eof64: + cs = 64 + goto _test_eof + _test_eof65: + cs = 65 + goto _test_eof + _test_eof66: + cs = 66 + goto _test_eof + _test_eof67: + cs = 67 + goto _test_eof + _test_eof68: + cs = 68 + goto _test_eof + _test_eof69: + cs = 69 + goto _test_eof + _test_eof70: + cs = 70 + goto _test_eof + _test_eof71: + cs = 71 + goto _test_eof + _test_eof72: + cs = 72 + goto _test_eof + _test_eof73: + cs = 73 + goto _test_eof + _test_eof74: + cs = 74 + goto _test_eof + _test_eof75: + cs = 75 + goto _test_eof + _test_eof76: + cs = 76 + goto _test_eof + _test_eof77: + cs = 77 + goto _test_eof + _test_eof78: + cs = 78 + goto _test_eof + _test_eof79: + cs = 79 + goto _test_eof + _test_eof80: + cs = 80 + goto _test_eof + _test_eof81: + cs = 81 + goto _test_eof + _test_eof82: + cs = 82 + goto _test_eof + _test_eof83: + cs = 83 + goto _test_eof + _test_eof84: + cs = 84 + goto _test_eof + _test_eof85: + cs = 85 + goto _test_eof + _test_eof86: + cs = 86 + goto _test_eof + _test_eof87: + cs = 87 + goto _test_eof + _test_eof88: + cs = 88 + goto _test_eof + _test_eof89: + cs = 89 + goto _test_eof + _test_eof90: + cs = 90 + goto _test_eof + _test_eof91: + cs = 91 + goto _test_eof + _test_eof92: + cs = 92 + goto _test_eof + _test_eof93: + cs = 93 + goto _test_eof + _test_eof94: + cs = 94 + goto _test_eof + _test_eof95: + cs = 95 + goto _test_eof + _test_eof96: + cs = 96 + goto _test_eof + _test_eof97: + cs = 97 + goto _test_eof + _test_eof98: + cs = 98 + goto _test_eof + _test_eof99: + cs = 99 + goto _test_eof + _test_eof100: + cs = 100 + goto _test_eof + _test_eof101: + cs = 101 + goto _test_eof + _test_eof102: + cs = 102 + goto _test_eof + _test_eof103: + cs = 103 + goto _test_eof + _test_eof104: + cs = 104 + goto _test_eof + _test_eof105: + cs = 105 + goto _test_eof + _test_eof106: + cs = 106 + goto _test_eof + _test_eof107: + cs = 107 + goto _test_eof + _test_eof108: + cs = 108 + goto _test_eof + _test_eof109: + cs = 109 + goto _test_eof + _test_eof110: + cs = 110 + goto _test_eof + _test_eof111: + cs = 111 + goto _test_eof + _test_eof112: + cs = 112 + goto _test_eof + _test_eof113: + cs = 113 + goto _test_eof + _test_eof114: + cs = 114 + goto _test_eof + _test_eof115: + cs = 115 + goto _test_eof + _test_eof116: + cs = 116 + goto _test_eof + _test_eof117: + cs = 117 + goto _test_eof + _test_eof118: + cs = 118 + goto _test_eof + _test_eof119: + cs = 119 + goto _test_eof + _test_eof120: + cs = 120 + goto _test_eof + _test_eof121: + cs = 121 + goto _test_eof + _test_eof122: + cs = 122 + goto _test_eof + _test_eof123: + cs = 123 + goto _test_eof + _test_eof124: + cs = 124 + goto _test_eof + _test_eof125: + cs = 125 + goto _test_eof + _test_eof126: + cs = 126 + goto _test_eof + _test_eof127: + cs = 127 + goto _test_eof + _test_eof128: + cs = 128 + goto _test_eof + _test_eof129: + cs = 129 + goto _test_eof + _test_eof130: + cs = 130 + goto _test_eof + _test_eof131: + cs = 131 + goto _test_eof + _test_eof132: + cs = 132 + goto _test_eof + _test_eof133: + cs = 133 + goto _test_eof + _test_eof134: + cs = 134 + goto _test_eof + _test_eof135: + cs = 135 + goto _test_eof + _test_eof136: + cs = 136 + goto _test_eof + _test_eof137: + cs = 137 + goto _test_eof + _test_eof138: + cs = 138 + goto _test_eof + _test_eof139: + cs = 139 + goto _test_eof + _test_eof140: + cs = 140 + goto _test_eof + _test_eof141: + cs = 141 + goto _test_eof + _test_eof142: + cs = 142 + goto _test_eof + _test_eof143: + cs = 143 + goto _test_eof + _test_eof144: + cs = 144 + goto _test_eof + _test_eof145: + cs = 145 + goto _test_eof + _test_eof146: + cs = 146 + goto _test_eof + _test_eof147: + cs = 147 + goto _test_eof + _test_eof148: + cs = 148 + goto _test_eof + _test_eof149: + cs = 149 + goto _test_eof + _test_eof150: + cs = 150 + goto _test_eof + _test_eof151: + cs = 151 + goto _test_eof + _test_eof152: + cs = 152 + goto _test_eof + _test_eof153: + cs = 153 + goto _test_eof + _test_eof154: + cs = 154 + goto _test_eof + _test_eof155: + cs = 155 + goto _test_eof + _test_eof156: + cs = 156 + goto _test_eof + _test_eof157: + cs = 157 + goto _test_eof + _test_eof158: + cs = 158 + goto _test_eof + _test_eof159: + cs = 159 + goto _test_eof + _test_eof160: + cs = 160 + goto _test_eof + _test_eof161: + cs = 161 + goto _test_eof + _test_eof162: + cs = 162 + goto _test_eof + _test_eof163: + cs = 163 + goto _test_eof + _test_eof164: + cs = 164 + goto _test_eof + _test_eof165: + cs = 165 + goto _test_eof + _test_eof166: + cs = 166 + goto _test_eof + _test_eof167: + cs = 167 + goto _test_eof + _test_eof168: + cs = 168 + goto _test_eof + _test_eof169: + cs = 169 + goto _test_eof + _test_eof170: + cs = 170 + goto _test_eof + _test_eof171: + cs = 171 + goto _test_eof + _test_eof172: + cs = 172 + goto _test_eof + _test_eof173: + cs = 173 + goto _test_eof + _test_eof174: + cs = 174 + goto _test_eof + _test_eof175: + cs = 175 + goto _test_eof + _test_eof176: + cs = 176 + goto _test_eof + _test_eof177: + cs = 177 + goto _test_eof + _test_eof178: + cs = 178 + goto _test_eof + _test_eof179: + cs = 179 + goto _test_eof + _test_eof180: + cs = 180 + goto _test_eof + _test_eof181: + cs = 181 + goto _test_eof + _test_eof182: + cs = 182 + goto _test_eof + _test_eof183: + cs = 183 + goto _test_eof + _test_eof184: + cs = 184 + goto _test_eof + _test_eof185: + cs = 185 + goto _test_eof + _test_eof186: + cs = 186 + goto _test_eof + _test_eof187: + cs = 187 + goto _test_eof + _test_eof188: + cs = 188 + goto _test_eof + _test_eof189: + cs = 189 + goto _test_eof + _test_eof190: + cs = 190 + goto _test_eof + _test_eof191: + cs = 191 + goto _test_eof + _test_eof192: + cs = 192 + goto _test_eof + _test_eof193: + cs = 193 + goto _test_eof + _test_eof194: + cs = 194 + goto _test_eof + _test_eof195: + cs = 195 + goto _test_eof + _test_eof196: + cs = 196 + goto _test_eof + _test_eof197: + cs = 197 + goto _test_eof + _test_eof198: + cs = 198 + goto _test_eof + _test_eof199: + cs = 199 + goto _test_eof + _test_eof200: + cs = 200 + goto _test_eof + _test_eof201: + cs = 201 + goto _test_eof + _test_eof202: + cs = 202 + goto _test_eof + _test_eof203: + cs = 203 + goto _test_eof + _test_eof204: + cs = 204 + goto _test_eof + _test_eof205: + cs = 205 + goto _test_eof + _test_eof206: + cs = 206 + goto _test_eof + _test_eof207: + cs = 207 + goto _test_eof + _test_eof208: + cs = 208 + goto _test_eof + _test_eof209: + cs = 209 + goto _test_eof + _test_eof210: + cs = 210 + goto _test_eof + _test_eof211: + cs = 211 + goto _test_eof + _test_eof212: + cs = 212 + goto _test_eof + _test_eof213: + cs = 213 + goto _test_eof + _test_eof214: + cs = 214 + goto _test_eof + _test_eof215: + cs = 215 + goto _test_eof + _test_eof216: + cs = 216 + goto _test_eof + _test_eof217: + cs = 217 + goto _test_eof + _test_eof218: + cs = 218 + goto _test_eof + _test_eof219: + cs = 219 + goto _test_eof + _test_eof220: + cs = 220 + goto _test_eof + _test_eof221: + cs = 221 + goto _test_eof + _test_eof222: + cs = 222 + goto _test_eof + _test_eof223: + cs = 223 + goto _test_eof + _test_eof224: + cs = 224 + goto _test_eof + _test_eof225: + cs = 225 + goto _test_eof + _test_eof226: + cs = 226 + goto _test_eof + _test_eof227: + cs = 227 + goto _test_eof + _test_eof228: + cs = 228 + goto _test_eof + _test_eof229: + cs = 229 + goto _test_eof + _test_eof230: + cs = 230 + goto _test_eof + _test_eof231: + cs = 231 + goto _test_eof + _test_eof232: + cs = 232 + goto _test_eof + _test_eof233: + cs = 233 + goto _test_eof + _test_eof234: + cs = 234 + goto _test_eof + _test_eof235: + cs = 235 + goto _test_eof + _test_eof236: + cs = 236 + goto _test_eof + _test_eof237: + cs = 237 + goto _test_eof + _test_eof409: + cs = 409 + goto _test_eof + _test_eof238: + cs = 238 + goto _test_eof + _test_eof239: + cs = 239 + goto _test_eof + _test_eof240: + cs = 240 + goto _test_eof + _test_eof241: + cs = 241 + goto _test_eof + _test_eof242: + cs = 242 + goto _test_eof + _test_eof243: + cs = 243 + goto _test_eof + _test_eof244: + cs = 244 + goto _test_eof + _test_eof245: + cs = 245 + goto _test_eof + _test_eof246: + cs = 246 + goto _test_eof + _test_eof247: + cs = 247 + goto _test_eof + _test_eof248: + cs = 248 + goto _test_eof + _test_eof249: + cs = 249 + goto _test_eof + _test_eof250: + cs = 250 + goto _test_eof + _test_eof251: + cs = 251 + goto _test_eof + _test_eof252: + cs = 252 + goto _test_eof + _test_eof253: + cs = 253 + goto _test_eof + _test_eof254: + cs = 254 + goto _test_eof + _test_eof255: + cs = 255 + goto _test_eof + _test_eof256: + cs = 256 + goto _test_eof + _test_eof257: + cs = 257 + goto _test_eof + _test_eof258: + cs = 258 + goto _test_eof + _test_eof259: + cs = 259 + goto _test_eof + _test_eof260: + cs = 260 + goto _test_eof + _test_eof261: + cs = 261 + goto _test_eof + _test_eof262: + cs = 262 + goto _test_eof + _test_eof263: + cs = 263 + goto _test_eof + _test_eof264: + cs = 264 + goto _test_eof + _test_eof265: + cs = 265 + goto _test_eof + _test_eof266: + cs = 266 + goto _test_eof + _test_eof267: + cs = 267 + goto _test_eof + _test_eof268: + cs = 268 + goto _test_eof + _test_eof269: + cs = 269 + goto _test_eof + _test_eof270: + cs = 270 + goto _test_eof + _test_eof271: + cs = 271 + goto _test_eof + _test_eof272: + cs = 272 + goto _test_eof + _test_eof273: + cs = 273 + goto _test_eof + _test_eof274: + cs = 274 + goto _test_eof + _test_eof275: + cs = 275 + goto _test_eof + _test_eof276: + cs = 276 + goto _test_eof + _test_eof277: + cs = 277 + goto _test_eof + _test_eof278: + cs = 278 + goto _test_eof + _test_eof279: + cs = 279 + goto _test_eof + _test_eof280: + cs = 280 + goto _test_eof + _test_eof281: + cs = 281 + goto _test_eof + _test_eof282: + cs = 282 + goto _test_eof + _test_eof283: + cs = 283 + goto _test_eof + _test_eof284: + cs = 284 + goto _test_eof + _test_eof285: + cs = 285 + goto _test_eof + _test_eof286: + cs = 286 + goto _test_eof + _test_eof287: + cs = 287 + goto _test_eof + _test_eof288: + cs = 288 + goto _test_eof + _test_eof289: + cs = 289 + goto _test_eof + _test_eof290: + cs = 290 + goto _test_eof + _test_eof291: + cs = 291 + goto _test_eof + _test_eof292: + cs = 292 + goto _test_eof + _test_eof293: + cs = 293 + goto _test_eof + _test_eof294: + cs = 294 + goto _test_eof + _test_eof295: + cs = 295 + goto _test_eof + _test_eof296: + cs = 296 + goto _test_eof + _test_eof297: + cs = 297 + goto _test_eof + _test_eof298: + cs = 298 + goto _test_eof + _test_eof299: + cs = 299 + goto _test_eof + _test_eof300: + cs = 300 + goto _test_eof + _test_eof301: + cs = 301 + goto _test_eof + _test_eof302: + cs = 302 + goto _test_eof + _test_eof303: + cs = 303 + goto _test_eof + _test_eof304: + cs = 304 + goto _test_eof + _test_eof305: + cs = 305 + goto _test_eof + _test_eof306: + cs = 306 + goto _test_eof + _test_eof307: + cs = 307 + goto _test_eof + _test_eof308: + cs = 308 + goto _test_eof + _test_eof309: + cs = 309 + goto _test_eof + _test_eof310: + cs = 310 + goto _test_eof + _test_eof311: + cs = 311 + goto _test_eof + _test_eof312: + cs = 312 + goto _test_eof + _test_eof313: + cs = 313 + goto _test_eof + _test_eof314: + cs = 314 + goto _test_eof + _test_eof315: + cs = 315 + goto _test_eof + _test_eof316: + cs = 316 + goto _test_eof + _test_eof317: + cs = 317 + goto _test_eof + _test_eof318: + cs = 318 + goto _test_eof + _test_eof319: + cs = 319 + goto _test_eof + _test_eof320: + cs = 320 + goto _test_eof + _test_eof321: + cs = 321 + goto _test_eof + _test_eof322: + cs = 322 + goto _test_eof + _test_eof323: + cs = 323 + goto _test_eof + _test_eof324: + cs = 324 + goto _test_eof + _test_eof325: + cs = 325 + goto _test_eof + _test_eof326: + cs = 326 + goto _test_eof + _test_eof327: + cs = 327 + goto _test_eof + _test_eof328: + cs = 328 + goto _test_eof + _test_eof329: + cs = 329 + goto _test_eof + _test_eof330: + cs = 330 + goto _test_eof + _test_eof331: + cs = 331 + goto _test_eof + _test_eof332: + cs = 332 + goto _test_eof + _test_eof333: + cs = 333 + goto _test_eof + _test_eof334: + cs = 334 + goto _test_eof + _test_eof335: + cs = 335 + goto _test_eof + _test_eof336: + cs = 336 + goto _test_eof + _test_eof337: + cs = 337 + goto _test_eof + _test_eof338: + cs = 338 + goto _test_eof + _test_eof339: + cs = 339 + goto _test_eof + _test_eof340: + cs = 340 + goto _test_eof + _test_eof341: + cs = 341 + goto _test_eof + _test_eof342: + cs = 342 + goto _test_eof + _test_eof343: + cs = 343 + goto _test_eof + _test_eof344: + cs = 344 + goto _test_eof + _test_eof345: + cs = 345 + goto _test_eof + _test_eof346: + cs = 346 + goto _test_eof + _test_eof347: + cs = 347 + goto _test_eof + _test_eof348: + cs = 348 + goto _test_eof + _test_eof349: + cs = 349 + goto _test_eof + _test_eof350: + cs = 350 + goto _test_eof + _test_eof351: + cs = 351 + goto _test_eof + _test_eof352: + cs = 352 + goto _test_eof + _test_eof353: + cs = 353 + goto _test_eof + _test_eof354: + cs = 354 + goto _test_eof + _test_eof355: + cs = 355 + goto _test_eof + _test_eof356: + cs = 356 + goto _test_eof + _test_eof357: + cs = 357 + goto _test_eof + _test_eof358: + cs = 358 + goto _test_eof + _test_eof359: + cs = 359 + goto _test_eof + _test_eof360: + cs = 360 + goto _test_eof + _test_eof361: + cs = 361 + goto _test_eof + _test_eof362: + cs = 362 + goto _test_eof + _test_eof363: + cs = 363 + goto _test_eof + _test_eof364: + cs = 364 + goto _test_eof + _test_eof365: + cs = 365 + goto _test_eof + _test_eof366: + cs = 366 + goto _test_eof + _test_eof367: + cs = 367 + goto _test_eof + _test_eof368: + cs = 368 + goto _test_eof + _test_eof369: + cs = 369 + goto _test_eof + _test_eof370: + cs = 370 + goto _test_eof + _test_eof371: + cs = 371 + goto _test_eof + _test_eof372: + cs = 372 + goto _test_eof + _test_eof373: + cs = 373 + goto _test_eof + _test_eof374: + cs = 374 + goto _test_eof + _test_eof375: + cs = 375 + goto _test_eof + _test_eof376: + cs = 376 + goto _test_eof + _test_eof377: + cs = 377 + goto _test_eof + _test_eof378: + cs = 378 + goto _test_eof + _test_eof379: + cs = 379 + goto _test_eof + _test_eof380: + cs = 380 + goto _test_eof + _test_eof381: + cs = 381 + goto _test_eof + _test_eof382: + cs = 382 + goto _test_eof + _test_eof383: + cs = 383 + goto _test_eof + _test_eof384: + cs = 384 + goto _test_eof + _test_eof385: + cs = 385 + goto _test_eof + _test_eof386: + cs = 386 + goto _test_eof + _test_eof387: + cs = 387 + goto _test_eof + _test_eof388: + cs = 388 + goto _test_eof + _test_eof389: + cs = 389 + goto _test_eof + _test_eof390: + cs = 390 + goto _test_eof + _test_eof391: + cs = 391 + goto _test_eof + _test_eof392: + cs = 392 + goto _test_eof + _test_eof393: + cs = 393 + goto _test_eof + _test_eof394: + cs = 394 + goto _test_eof + _test_eof395: + cs = 395 + goto _test_eof + _test_eof396: + cs = 396 + goto _test_eof + _test_eof397: + cs = 397 + goto _test_eof + _test_eof398: + cs = 398 + goto _test_eof + _test_eof399: + cs = 399 + goto _test_eof + _test_eof400: + cs = 400 + goto _test_eof + _test_eof401: + cs = 401 + goto _test_eof + _test_eof402: + cs = 402 + goto _test_eof + _test_eof403: + cs = 403 + goto _test_eof + _test_eof404: + cs = 404 + goto _test_eof + _test_eof405: + cs = 405 + goto _test_eof + _test_eof406: + cs = 406 + goto _test_eof + _test_eof407: + cs = 407 + goto _test_eof + + _test_eof: + { + } + _out: + { + } + } + +//line matcher.rl:142 + + return false +} diff -r f8c370af9e6f -r 02c2d0edeb2a contrib/gmaggregate/matcher.rl --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/contrib/gmaggregate/matcher.rl Fri Nov 05 01:12:48 2021 +0100 @@ -0,0 +1,144 @@ +// This is Free Software under GNU Affero General Public License v >= 3.0 +// without warranty, see README.md and license for details. +// +// SPDX-License-Identifier: AGPL-3.0-or-later +// License-Filename: LICENSE +// +// Copyright (C) 2021 by via donau +// - Österreichische Wasserstraßen-Gesellschaft mbH +// Software engineering by Intevation GmbH +// +// Author(s): +// * Sascha L. Teichmann +package main + +import "strconv" + +%%{ + machine expression; + write data; +}%% + +func (agg *aggregator) match(data string, l *line) bool { + + // data := []rune(line) + + var cs int + + p, pe := 0, len(data) + + stack := agg.stack[:0] + var pos int + + var g *gauge + var v int + + current := func() string { return string(data[pos+1:p+1]) } + + pop := func() string { + s := stack[len(stack)-1] + stack = stack[:len(stack)-1] + return s + } + +%%{ + action mark { pos = p } + + action push { stack = append(stack, current()) } + + action foundMeasure { + agg.current = current() + return true + } + + action insertedMeas { + g = agg.find(current()) + v, _ = strconv.Atoi(pop()) + g.measurements += v + return true + } + + action insertedPreds { + g = agg.find(current()) + v , _ = strconv.Atoi(pop()) + g.predictions += v + return true + } + + action referenceCodeNotSpecified { + agg.find(agg.current).assumeZPG = true + return true + } + + action ignoredMeassurements { + v, _ = strconv.Atoi(pop()) + agg.find(agg.current).badValues += v + return true + } + + action cannotFindGauge { + agg.find(pop()).unknown = true + return true + } + + action unitNotSpecified { + agg.find(agg.current).assumeCM++ + return true + } + + action ignoredMessage { + g = agg.find(agg.current) + g.ignMeasCodes = extend(g.ignMeasCodes, current()) + return true + } + + action missingMandatoryValue { + g = agg.find(agg.current) + g.missingValues = extend(g.missingValues, pop()) + return true + } + + action unknownUnit { + g = agg.find(agg.current) + g.rescaleErrors = extend(g.rescaleErrors, pop()) + return true + } + + action holdBack { + agg.hold = l + return true + } + + expr := + 'Found measurements/predictions for ' @mark any{20} + @foundMeasure + | 'Inserted ' @mark digit+ @push ' measurements for ' @mark any{20} + @insertedMeas + | 'Inserted ' @mark digit+ @push ' predictions for ' @mark any{20} + @insertedPreds + | '\'Reference_code\' not specified. Assuming \'ZPG\'' + @referenceCodeNotSpecified + | 'Ignored ' @mark digit+ @push ' measurements with value -99999' + @ignoredMeassurements + | 'Cannot find gauge "' @mark any{20} @push '"' + @cannotFindGauge + | '\'Unit\' not specified. Assuming \'cm\'' + @unitNotSpecified + | 'Ignored message with measure_code ' @mark any+ + @ignoredMessage + | 'Missing mandatory value at ' @mark [^.]+ @push '.' + @missingMandatoryValue + | 'unknown unit \'' @mark [^']* @push '\'' + @unknownUnit + | 'Importing gauge measurements took ' + @holdBack + | 'error in import: ' + @holdBack + ; +}%% + + %% write init; + %% write exec; + + return false +}