diff --git a/Gopkg.lock b/Gopkg.lock index 3e8ff750..88d568b2 100644 --- a/Gopkg.lock +++ b/Gopkg.lock @@ -2,6 +2,7 @@ [[projects]] + digest = "1:7b7e60450e2e781c29b78dfca177a672f69ebb36744cf63edb9f8ebc872f6365" name = "cloud.google.com/go" packages = [ "compute/metadata", @@ -12,60 +13,78 @@ "pubsub", "pubsub/apiv1", "pubsub/internal/distribution", - "pubsub/pstest" + "pubsub/pstest", ] + pruneopts = "UT" revision = "28a4bc8c44b3acbcc482cff0cdf7de29a4688b61" version = "v0.35.1" [[projects]] + digest = "1:bd285ec20a7450d2272631284de698f2d76e923a458fee90e99cc1db4b97708d" name = "github.com/DataDog/datadog-go" packages = ["statsd"] + pruneopts = "UT" revision = "e67964b4021ad3a334e748e8811eb3cd6becbc6e" version = "2.1.0" [[projects]] + digest = "1:d1665c44bd5db19aaee18d1b6233c99b0b9a986e8bccb24ef54747547a48027f" name = "github.com/PuerkitoBio/purell" packages = ["."] + pruneopts = "UT" revision = "0bcb03f4b4d0a9428594752bd2a3b9aa0a9d4bd4" version = "v1.1.0" [[projects]] branch = "master" + digest = "1:c739832d67eb1e9cc478a19cc1a1ccd78df0397bf8a32978b759152e205f644b" name = "github.com/PuerkitoBio/urlesc" packages = ["."] + pruneopts = "UT" revision = "de5bf2ad457846296e2031421a34e2568e304e35" [[projects]] + digest = "1:aef23e9ea9f154b965b9792e32c86f315c2c689883ead4eeca8a182f6edfdfbc" name = "github.com/Shopify/sarama" packages = ["."] + pruneopts = "UT" revision = "a6144ae922fd99dd0ea5046c8137acfb7fab0914" version = "v1.18.0" [[projects]] branch = "master" + digest = "1:50ac4d5b9246111765c661e5fda807ae955bf333da331db2afe81eecafc3ccba" name = "github.com/a8m/kinesis-producer" packages = ["."] + pruneopts = "UT" revision = "03228a9f79b384e1a25260f342a77c4dcdb9671b" [[projects]] + digest = "1:320e7ead93de9fd2b0e59b50fd92a4d50c1f8ab455d96bc2eb083267453a9709" name = "github.com/asaskevich/govalidator" packages = ["."] + pruneopts = "UT" revision = "ccb8e960c48f04d6935e72476ae4a51028f9e22f" version = "v9" [[projects]] branch = "master" + digest = "1:e4fd8a4041e47ec6cb6c38ad4baf4f1f37278c7ba23625905147a5823885787a" name = "github.com/auth0/go-jwt-middleware" packages = ["."] + pruneopts = "UT" revision = "5493cabe49f7bfa6e2ec444a09d334d90cd4e2bd" [[projects]] + digest = "1:1c9dffe45896d21dc8e183fdc3cdb405249e6c7dd3d00792e534af3597d5e4fc" name = "github.com/avast/retry-go" packages = ["."] + pruneopts = "UT" revision = "08d411bf8302219fe47ca04dbdf9de892010c5e5" version = "v2.2.0" [[projects]] + digest = "1:cf3aa97d961afe84ca9a934ffcbd1709385251336890fb6cc591bc15815224ff" name = "github.com/aws/aws-sdk-go" packages = [ "aws", @@ -97,145 +116,189 @@ "private/protocol/rest", "private/protocol/xml/xmlutil", "service/kinesis", - "service/sts" + "service/sts", ] + pruneopts = "UT" revision = "71a2a92b0063297b055b6f5a014d441c142da2ce" version = "v1.15.32" [[projects]] + digest = "1:d8abdc866ebbe05fa3bce50863e23afd4c73c804b90c908caa864e86df1db8a1" name = "github.com/bouk/monkey" packages = ["."] + pruneopts = "UT" revision = "5df1f207ff77e025801505ae4d903133a0b4353f" version = "v1.0.0" [[projects]] branch = "master" + digest = "1:a2b3fb724251a4237e10b520bfbf1a39d9acde5ae31a28c43b3920289d119836" name = "github.com/brandur/simplebox" packages = ["."] + pruneopts = "UT" revision = "84e9865bb03ad38c464043bf5382ce8c68ca5f0c" [[projects]] + digest = "1:6022450ef27def275cce67b2b2144ca65ab8f752e3bb3de0b251aab8b522780f" name = "github.com/bsm/ratelimit" packages = ["."] + pruneopts = "UT" revision = "4a38dca83ebadb017e83301642fab61b1c17edb7" version = "v2.0.0" [[projects]] + digest = "1:e361cb646a33874cf6521b5c4e77c9208b4b58c7fd3893b8c87f61f49b19d991" name = "github.com/caarlos0/env" packages = ["."] + pruneopts = "UT" revision = "1cddc31c48c56ecd700d873edb9fd5b6f5df922a" version = "v3.3.0" [[projects]] + digest = "1:fed1f537c2f1269fe475a8556c393fe466641682d73ef8fd0491cd3aa1e47bad" name = "github.com/certifi/gocertifi" packages = ["."] + pruneopts = "UT" revision = "deb3ae2ef2610fde3330947281941c562861188b" version = "2018.01.18" [[projects]] + digest = "1:ffe9824d294da03b391f44e1ae8281281b4afc1bdaa9588c9097785e3af10cec" name = "github.com/davecgh/go-spew" packages = ["spew"] + pruneopts = "UT" revision = "8991bc29aa16c548c550c7ff78260e27b9ab7c73" version = "v1.1.1" [[projects]] branch = "master" + digest = "1:fdae1c338ec6667687fb3fdbde842b3c421c930163981b5d441502b240b7f50b" name = "github.com/dchest/uniuri" packages = ["."] + pruneopts = "UT" revision = "8902c56451e9b58ff940bbe5fec35d5f9c04584a" [[projects]] + digest = "1:76dc72490af7174349349838f2fe118996381b31ea83243812a97e5a0fd5ed55" name = "github.com/dgrijalva/jwt-go" packages = ["."] + pruneopts = "UT" revision = "06ea1031745cb8b3dab3f6a236daf2b0aa468b7e" version = "v3.2.0" [[projects]] + digest = "1:6f82cacd0af5921e99bf3f46748705239b36489464f4529a1589bc895764fb18" name = "github.com/docker/go-units" packages = ["."] + pruneopts = "UT" revision = "47565b4f722fb6ceae66b95f853feed578a4a51c" version = "v0.3.3" [[projects]] + digest = "1:1f0c7ab489b407a7f8f9ad16c25a504d28ab461517a971d341388a56156c1bd7" name = "github.com/eapache/go-resiliency" packages = ["breaker"] + pruneopts = "UT" revision = "ea41b0fad31007accc7f806884dcdf3da98b79ce" version = "v1.1.0" [[projects]] branch = "master" + digest = "1:79f16588b5576b1b3cd90e48d2374cc9a1a8776862d28d8fd0f23b0e15534967" name = "github.com/eapache/go-xerial-snappy" packages = ["."] + pruneopts = "UT" revision = "776d5712da21bc4762676d614db1d8a64f4238b0" [[projects]] + digest = "1:444b82bfe35c83bbcaf84e310fb81a1f9ece03edfed586483c869e2c046aef69" name = "github.com/eapache/queue" packages = ["."] + pruneopts = "UT" revision = "44cc805cf13205b55f69e14bcb69867d1ae92f98" version = "v1.1.0" [[projects]] + digest = "1:25889b062fa78bfd05d9c9eb3a4d0fc23cc11d2ba7cf40b5e96eb3498dd1d891" name = "github.com/evalphobia/logrus_sentry" packages = ["."] + pruneopts = "UT" revision = "b78b27461c8163c45abf4ab3a8330d2b1ee9456a" version = "v0.4.6" [[projects]] branch = "master" + digest = "1:64ef2c2f0f508690f06c1b009e1e3103441ce60c2db0323ff94d8d1c560ec10b" name = "github.com/getsentry/raven-go" packages = ["."] + pruneopts = "UT" revision = "084a9de9eb0361fbd5ded14b55c84e5493a5d7f6" [[projects]] branch = "master" + digest = "1:7fb51688eadf38272411852d7a2b3538c7caff53309abee6c0964a83c00fe69e" name = "github.com/globalsign/mgo" packages = [ "bson", - "internal/json" + "internal/json", ] + pruneopts = "UT" revision = "1ca0a4f7cbcbe61c005d1bd43fdd8bb8b71df6bc" [[projects]] + digest = "1:5abd6a22805b1919f6a6bca0ae58b13cef1f3412812f38569978f43ef02743d4" name = "github.com/go-ini/ini" packages = ["."] + pruneopts = "UT" revision = "5cf292cae48347c2490ac1a58fe36735fb78df7e" version = "v1.38.2" [[projects]] + digest = "1:50d6bc4aa3e70803230bb98a4b0e0f1331fefc2eb324e087adf7e986b8da082e" name = "github.com/go-openapi/analysis" packages = [ ".", - "internal" + "internal", ] + pruneopts = "UT" revision = "7c1bef8f6d9fa6148ce0d8a0ebf5339a084a6639" version = "0.16.0" [[projects]] branch = "master" + digest = "1:14ebaa1c8c615cdaaf9bbd18842ffe20722ffafa62f30cf072529f4590d36940" name = "github.com/go-openapi/errors" packages = ["."] + pruneopts = "UT" revision = "87bb653288778f8b0d922c5c3fb8b3f00a47ff28" [[projects]] + digest = "1:2997679181d901ac8aaf4330d11138ecf3974c6d3334995ff36f20cbd597daf8" name = "github.com/go-openapi/jsonpointer" packages = ["."] + pruneopts = "UT" revision = "3a0015ad55fa9873f41605d3e8f28cd279c32ab2" version = "0.16.0" [[projects]] + digest = "1:1ae3f233d75a731b164ca9feafd8ed646cbedf1784095876ed6988ce8aa88b1f" name = "github.com/go-openapi/jsonreference" packages = ["."] + pruneopts = "UT" revision = "3fb327e6747da3043567ee86abd02bb6376b6be2" version = "0.16.0" [[projects]] branch = "master" + digest = "1:7204d50f94cd2e5ada07eb0f9daaa4b811252b6ecec867e3232ddb3a8603402b" name = "github.com/go-openapi/loads" packages = ["."] + pruneopts = "UT" revision = "fd899182a268dcf25de088722375311d9dee2662" [[projects]] branch = "master" + digest = "1:d87c9d59f871025d6cfdb56d3bb6aa6bf5fc90c119804276746edc379f7c9c48" name = "github.com/go-openapi/runtime" packages = [ ".", @@ -245,47 +308,61 @@ "middleware/denco", "middleware/header", "middleware/untyped", - "security" + "security", ] + pruneopts = "UT" revision = "41cb9a631c39f00f50d1a34b5ef0dd1fac745c15" [[projects]] branch = "master" + digest = "1:d538832fc6033760440c9b7058504c495542905c83925f5d846bc954ff899a3b" name = "github.com/go-openapi/spec" packages = ["."] + pruneopts = "UT" revision = "f1468acb3b29cdd5c5f6fa29435d2d2d6e6c9ff1" [[projects]] branch = "master" + digest = "1:b92f042d3cdb08ba62dc301877d7af8d3fa316d68c10c1ec0d469ce8fde3328e" name = "github.com/go-openapi/strfmt" packages = ["."] + pruneopts = "UT" revision = "776114108ccc228238641096ea5be3d24842d4ea" [[projects]] branch = "master" + digest = "1:e8e34b49eb622556a775ca4b10d76f665c1a7d94a1c94370ff0d40dbe62f45e1" name = "github.com/go-openapi/swag" packages = ["."] + pruneopts = "UT" revision = "dd0dad036e67ae93c27dc64337b3f76296f3a5f0" [[projects]] branch = "master" + digest = "1:77ec92386c588ace52208dc2df27c59c45db2a74bca03d6cb653ac4376363102" name = "github.com/go-openapi/validate" packages = ["."] + pruneopts = "UT" revision = "e0648ff405079d973622f8b2bf739ed3a1c5cd9b" [[projects]] + digest = "1:adea5a94903eb4384abef30f3d878dc9ff6b6b5b0722da25b82e5169216dfb61" name = "github.com/go-sql-driver/mysql" packages = ["."] + pruneopts = "UT" revision = "d523deb1b23d913de5bdada721a6071e71283618" version = "v1.4.0" [[projects]] branch = "master" + digest = "1:6e2ab78d30f5f8167c8bda32a17c231b07af6ca508811cb0124a4da43733ed2c" name = "github.com/gohttp/pprof" packages = ["."] + pruneopts = "UT" revision = "c9d246cbb3ba6407f8b1decdfff558f0fe8f07e8" [[projects]] + digest = "1:19e1717be26f549febea402e08b46db7919d164324a24ff67e0c81dfb11316b8" name = "github.com/golang/protobuf" packages = [ "proto", @@ -294,107 +371,135 @@ "ptypes/any", "ptypes/duration", "ptypes/empty", - "ptypes/timestamp" + "ptypes/timestamp", ] + pruneopts = "UT" revision = "aa810b61a9c79d51363740d207bb46cf8e620ed5" version = "v1.2.0" [[projects]] branch = "master" + digest = "1:4a0c6bb4805508a6287675fac876be2ac1182539ca8a32468d8128882e9d5009" name = "github.com/golang/snappy" packages = ["."] + pruneopts = "UT" revision = "2e65f85255dbc3072edf28d6b5b8efc472979f5a" [[projects]] + digest = "1:2e3c336fc7fde5c984d2841455a658a6d626450b1754a854b3b32e7a8f49a07a" name = "github.com/google/go-cmp" packages = [ "cmp", "cmp/internal/diff", "cmp/internal/function", - "cmp/internal/value" + "cmp/internal/value", ] + pruneopts = "UT" revision = "3af367b6b30c263d47e8895973edcca9a49cf029" version = "v0.2.0" [[projects]] + digest = "1:856bd1e35f6da8ce5671a5df09d0e89bf01e9b74b3dabb6d097d39b3813801e1" name = "github.com/googleapis/gax-go" packages = ["v2"] + pruneopts = "UT" revision = "c8a15bac9b9fe955bd9f900272f9a306465d28cf" version = "v2.0.3" [[projects]] + digest = "1:a2cff208d4759f6ba1b1cd228587b0a1869f95f22542ec9cd17fff64430113c7" name = "github.com/jessevdk/go-flags" packages = ["."] + pruneopts = "UT" revision = "c6ca198ec95c841fdb89fc0de7496fed11ab854e" version = "v1.4.0" [[projects]] branch = "master" + digest = "1:e36c0264435e199d2fc32d15d249ee51188bc974cdaf0918acb16d9c297ab97e" name = "github.com/jinzhu/gorm" packages = [ ".", "dialects/mysql", "dialects/postgres", - "dialects/sqlite" + "dialects/sqlite", ] + pruneopts = "UT" revision = "123d4f50ef8a8209ee8434daa41c6045a9111864" [[projects]] branch = "master" + digest = "1:fd97437fbb6b7dce04132cf06775bd258cce305c44add58eb55ca86c6c325160" name = "github.com/jinzhu/inflection" packages = ["."] + pruneopts = "UT" revision = "04140366298a54a039076d798123ffa108fff46c" [[projects]] + digest = "1:e22af8c7518e1eab6f2eab2b7d7558927f816262586cd6ed9f349c97a6c285c4" name = "github.com/jmespath/go-jmespath" packages = ["."] + pruneopts = "UT" revision = "0b12d6b5" [[projects]] + digest = "1:b6bbd2f9e0724bd81890c8644259f920c6d61c08453978faff0bebd25f3e7d3e" name = "github.com/jpillora/backoff" packages = ["."] + pruneopts = "UT" revision = "8eab2debe79d12b7bd3d10653910df25fa9552ba" version = "1.0.0" [[projects]] + digest = "1:b18ffc558326ebaed3b4a175617f1e12ed4e3f53d6ebfe5ba372a3de16d22278" name = "github.com/lib/pq" packages = [ ".", "hstore", - "oid" + "oid", ] + pruneopts = "UT" revision = "4ded0e9383f75c197b3a2aaa6d590ac52df6fd79" version = "v1.0.0" [[projects]] branch = "master" + digest = "1:84a5a2b67486d5d67060ac393aa255d05d24ed5ee41daecd5635ec22657b6492" name = "github.com/mailru/easyjson" packages = [ "buffer", "jlexer", - "jwriter" + "jwriter", ] + pruneopts = "UT" revision = "60711f1a8329503b04e1c88535f419d0bb440bff" [[projects]] + digest = "1:3cafc6a5a1b8269605d9df4c6956d43d8011fc57f266ca6b9d04da6c09dee548" name = "github.com/mattn/go-sqlite3" packages = ["."] + pruneopts = "UT" revision = "25ecb14adfc7543176f7d85291ec7dba82c6f7e4" version = "v1.9.0" [[projects]] branch = "master" + digest = "1:757ea7d08e5b49d8a6f240597e1158130e5988b891433e9b941e11d39d9fc29d" name = "github.com/meatballhat/negroni-logrus" packages = ["."] + pruneopts = "UT" revision = "31067281800f66f57548a7a32d9c6c5f963fef83" [[projects]] + digest = "1:645110e089152bd0f4a011a2648fbb0e4df5977be73ca605781157ac297f50c4" name = "github.com/mitchellh/mapstructure" packages = ["."] + pruneopts = "UT" revision = "fa473d140ef3c6adf42d6b391fe76707f1f243c8" version = "v1.0.0" [[projects]] + digest = "1:01f60ec456e70c9be269902c08fa189a9d47056a419c4a91a02f19df5e36ab59" name = "github.com/newrelic/go-agent" packages = [ ".", @@ -403,105 +508,137 @@ "internal/jsonx", "internal/logger", "internal/sysinfo", - "internal/utilization" + "internal/utilization", ] + pruneopts = "UT" revision = "46d73e6be8b4faeee70850d0df829e4fe00d6819" version = "v2.1.0" [[projects]] + digest = "1:5e73b34a27d827212102605789de00bd411b2e434812133c83935fe9897c75e1" name = "github.com/philhofer/fwd" packages = ["."] + pruneopts = "UT" revision = "bb6d471dc95d4fe11e432687f8b70ff496cf3136" version = "v1.0.0" [[projects]] branch = "master" + digest = "1:b904229c9c8922ab8aaa80538c2e9099021bd00d846e6845828872f8107e6e45" name = "github.com/phyber/negroni-gzip" packages = ["gzip"] + pruneopts = "UT" revision = "ef6356a5d02936b65ca8e60b604ed6b078aac8d3" [[projects]] + digest = "1:4f0885b3f0dba96128a09a6f4b4231c42688fbd05f323224c6aa5adc9f4e87bf" name = "github.com/pierrec/lz4" packages = [ ".", - "internal/xxh32" + "internal/xxh32", ] + pruneopts = "UT" revision = "bb6bfd13c6a262f1943c0446eb25b7f54c1fb9a2" version = "v2.0.6" [[projects]] + digest = "1:40e195917a951a8bf867cd05de2a46aaf1806c50cf92eebf4c16f78cd196f747" name = "github.com/pkg/errors" packages = ["."] + pruneopts = "UT" revision = "645ef00459ed84a119197bfb8d8205042c6df63d" version = "v0.8.0" [[projects]] + digest = "1:0028cb19b2e4c3112225cd871870f2d9cf49b9b4276531f03438a88e94be86fe" name = "github.com/pmezard/go-difflib" packages = ["difflib"] + pruneopts = "UT" revision = "792786c7400a136282c1664665ae0a8db921c6c2" version = "v1.0.0" [[projects]] branch = "master" + digest = "1:3dbfe6a3038d5a3792990b79719c0d7dff4fcd8e81dabdf70743e327e1bb9e7b" name = "github.com/prashantv/gostub" packages = ["."] + pruneopts = "UT" revision = "5c68b99bb08825598e70739c40603c901ee58dba" [[projects]] branch = "master" + digest = "1:c4556a44e350b50a490544d9b06e9fba9c286c21d6c0e47f54f3a9214597298c" name = "github.com/rcrowley/go-metrics" packages = ["."] + pruneopts = "UT" revision = "e2704e165165ec55d062f5919b4b29494e9fa790" [[projects]] + digest = "1:0b8dd7447e420afff0260179dc892711e837edd1d446bc78dab924624a3c3c81" name = "github.com/rs/cors" packages = ["."] + pruneopts = "UT" revision = "3fb1b69b103a84de38a19c3c6ec073dd6caa4d3f" version = "v1.5.0" [[projects]] + digest = "1:d867dfa6751c8d7a435821ad3b736310c2ed68945d05b50fb9d23aee0540c8cc" name = "github.com/sirupsen/logrus" packages = ["."] + pruneopts = "UT" revision = "3e01752db0189b9157070a0e1668a620f9a85da2" version = "v1.0.6" [[projects]] + digest = "1:516e71bed754268937f57d4ecb190e01958452336fa73dbac880894164e91c1f" name = "github.com/spf13/cast" packages = ["."] + pruneopts = "UT" revision = "8965335b8c7107321228e3e3702cab9832751bac" version = "v1.2.0" [[projects]] + digest = "1:18752d0b95816a1b777505a97f71c7467a8445b8ffb55631a7bf779f6ba4fa83" name = "github.com/stretchr/testify" packages = ["assert"] + pruneopts = "UT" revision = "f35b8ab0b5a2cef36673838d662e249dd9c94686" version = "v1.2.2" [[projects]] + digest = "1:c97e8a5e5c435c3287f581cdb4441ba34577ec6ead8422bfedafa6269af7abf6" name = "github.com/tinylib/msgp" packages = ["msgp"] + pruneopts = "UT" revision = "af6442a0fcf6e2a1b824f70dd0c734f01e817751" version = "v1.1.0" [[projects]] + digest = "1:606d068450c82b9ddaa21de992f73563754077f0f411235cdfe71d0903a268c3" name = "github.com/urfave/negroni" packages = ["."] + pruneopts = "UT" revision = "5dbbc83f748fc3ad38585842b0aedab546d0ea1e" version = "v0.3.0" [[projects]] branch = "master" + digest = "1:c02228c8277c87a92908ec3dae5df7915a04193aee97723eb5b985ef80cfcf0d" name = "github.com/yadvendar/negroni-newrelic-go-agent" packages = ["."] + pruneopts = "UT" revision = "3dc58758cb67abc45ae91e8e7bb3d90bdc254dfb" [[projects]] - branch = "master" + digest = "1:59752f14c8c4309d59e41e66fb2fa57091636d6f26862718f8cebbe419956b73" name = "github.com/zhouzhuojie/conditions" packages = ["."] - revision = "34882afc2ef77651b9e10ec8148ac7f95887f822" + pruneopts = "UT" + revision = "7de314ba1d596c8ffbb61340bb97bdda799c665e" + version = "0.2.2" [[projects]] + digest = "1:5baa1a55624558e55a544de8b81542193852b0d607a9e21d9296e82d3e698918" name = "go.opencensus.io" packages = [ ".", @@ -518,25 +655,29 @@ "trace", "trace/internal", "trace/propagation", - "trace/tracestate" + "trace/tracestate", ] + pruneopts = "UT" revision = "2b5032d79456124f42db6b7eb19ac6c155449dc2" version = "v0.19.0" [[projects]] branch = "master" + digest = "1:207d2e280e7a43845b12d07437538d22d02dbd4c274b49f3940bb3dce2ed70d7" name = "golang.org/x/crypto" packages = [ "internal/subtle", "nacl/secretbox", "poly1305", "salsa20/salsa", - "ssh/terminal" + "ssh/terminal", ] + pruneopts = "UT" revision = "0e37d006457bf46f9e6692014ba72ef82c33022c" [[projects]] branch = "master" + digest = "1:b8e0e65aab2fbd7cf974186c516417134dd1346217011ed0333518c99e7ef092" name = "golang.org/x/net" packages = [ "context", @@ -547,41 +688,49 @@ "idna", "internal/timeseries", "netutil", - "trace" + "trace", ] + pruneopts = "UT" revision = "161cd47e91fd58ac17490ef4d742dc98bb4cf60e" [[projects]] branch = "master" + digest = "1:511a6232760c10dcb1ebf1ab83ef0291e2baf801f203ca6314759c5458b73a6a" name = "golang.org/x/oauth2" packages = [ ".", "google", "internal", "jws", - "jwt" + "jwt", ] + pruneopts = "UT" revision = "99b60b757ec124ebb7d6b7e97f153b19c10ce163" [[projects]] branch = "master" + digest = "1:04a5b0e4138f98eef79ce12a955a420ee358e9f787044cc3a553ac3c3ade997e" name = "golang.org/x/sync" packages = [ "errgroup", - "semaphore" + "semaphore", ] + pruneopts = "UT" revision = "37e7f081c4d4c64e13b10787722085407fe5d15f" [[projects]] branch = "master" + digest = "1:374fc90fcb026e9a367e3fad29e988e5dd944b68ca3f24a184d77abc5307dda4" name = "golang.org/x/sys" packages = [ "unix", - "windows" + "windows", ] + pruneopts = "UT" revision = "d0be0721c37eeb5299f245a996a483160fc36940" [[projects]] + digest = "1:0c56024909189aee3364b7f21a95a27459f718aa7c199a5c111c36cfffd9eaef" name = "golang.org/x/text" packages = [ "collate", @@ -598,12 +747,14 @@ "unicode/cldr", "unicode/norm", "unicode/rangetable", - "width" + "width", ] + pruneopts = "UT" revision = "f21a4dfb5e38f5895301dc265a8def02365cc3d0" version = "v0.3.0" [[projects]] + digest = "1:2e81813e8e072aa700e101369890e55539729d817d32dbc3fab228d6b40c4d83" name = "google.golang.org/api" packages = [ "googleapi/transport", @@ -614,12 +765,14 @@ "transport", "transport/grpc", "transport/http", - "transport/http/internal/propagation" + "transport/http/internal/propagation", ] + pruneopts = "UT" revision = "19e022d8cf43ce81f046bae8cc18c5397cc7732f" version = "v0.1.0" [[projects]] + digest = "1:0e781d9592d20f30c4280da30f27b448b4815215f9b43b5258b763a79fb98e98" name = "google.golang.org/appengine" packages = [ ".", @@ -634,24 +787,28 @@ "internal/socket", "internal/urlfetch", "socket", - "urlfetch" + "urlfetch", ] + pruneopts = "UT" revision = "b1f26356af11148e710935ed1ac8a7f5702c7612" version = "v1.1.0" [[projects]] branch = "master" + digest = "1:df108397c1d0e0b8d079c8f21c5a10b5596f416d446e32da59c16a268658fd85" name = "google.golang.org/genproto" packages = [ "googleapis/api/annotations", "googleapis/iam/v1", "googleapis/pubsub/v1", "googleapis/rpc/status", - "protobuf/field_mask" + "protobuf/field_mask", ] + pruneopts = "UT" revision = "8ac453e89fca495c0d17f98932642f392e2a11f3" [[projects]] + digest = "1:2bfad918329beeeeb3433da4745d4283f75c911352af2fc13cf23e294bff18d1" name = "google.golang.org/grpc" packages = [ ".", @@ -685,31 +842,87 @@ "resolver/passthrough", "stats", "status", - "tap" + "tap", ] + pruneopts = "UT" revision = "a02b0774206b209466313a0b525d2c738fe407eb" version = "v1.18.0" [[projects]] + digest = "1:4ba35041e89aa22fdf8d66c6765ca69633cba305e04dd519eae4b8e40235075e" name = "gopkg.in/DataDog/dd-trace-go.v1" packages = [ "ddtrace", "ddtrace/ext", "ddtrace/internal", - "ddtrace/tracer" + "ddtrace/tracer", ] + pruneopts = "UT" revision = "823d51722f66a748804943f6fa6be18776073b82" version = "v1.9.0" [[projects]] + digest = "1:342378ac4dcb378a5448dd723f0784ae519383532f5e70ade24132c4c8693202" name = "gopkg.in/yaml.v2" packages = ["."] + pruneopts = "UT" revision = "5420a8b6744d3b0345ab293f6fcba19c978f1183" version = "v2.2.1" [solve-meta] analyzer-name = "dep" analyzer-version = 1 - inputs-digest = "b0841aee54affbdbade4cec32b085332646dec0e4170928a674d03d8e97c0f91" + input-imports = [ + "cloud.google.com/go/pubsub", + "cloud.google.com/go/pubsub/pstest", + "github.com/DataDog/datadog-go/statsd", + "github.com/Shopify/sarama", + "github.com/a8m/kinesis-producer", + "github.com/auth0/go-jwt-middleware", + "github.com/avast/retry-go", + "github.com/aws/aws-sdk-go/aws", + "github.com/aws/aws-sdk-go/aws/session", + "github.com/aws/aws-sdk-go/service/kinesis", + "github.com/bouk/monkey", + "github.com/brandur/simplebox", + "github.com/bsm/ratelimit", + "github.com/caarlos0/env", + "github.com/davecgh/go-spew/spew", + "github.com/dchest/uniuri", + "github.com/dgrijalva/jwt-go", + "github.com/evalphobia/logrus_sentry", + "github.com/getsentry/raven-go", + "github.com/go-openapi/errors", + "github.com/go-openapi/loads", + "github.com/go-openapi/runtime", + "github.com/go-openapi/runtime/flagext", + "github.com/go-openapi/runtime/middleware", + "github.com/go-openapi/runtime/security", + "github.com/go-openapi/spec", + "github.com/go-openapi/strfmt", + "github.com/go-openapi/swag", + "github.com/go-openapi/validate", + "github.com/gohttp/pprof", + "github.com/jessevdk/go-flags", + "github.com/jinzhu/gorm", + "github.com/jinzhu/gorm/dialects/mysql", + "github.com/jinzhu/gorm/dialects/postgres", + "github.com/jinzhu/gorm/dialects/sqlite", + "github.com/meatballhat/negroni-logrus", + "github.com/newrelic/go-agent", + "github.com/phyber/negroni-gzip/gzip", + "github.com/prashantv/gostub", + "github.com/rs/cors", + "github.com/sirupsen/logrus", + "github.com/spf13/cast", + "github.com/stretchr/testify/assert", + "github.com/urfave/negroni", + "github.com/yadvendar/negroni-newrelic-go-agent", + "github.com/zhouzhuojie/conditions", + "golang.org/x/net/netutil", + "google.golang.org/api/option", + "google.golang.org/grpc", + "gopkg.in/DataDog/dd-trace-go.v1/ddtrace/tracer", + ] solver-name = "gps-cdcl" solver-version = 1 diff --git a/Gopkg.toml b/Gopkg.toml index e1efee2e..82cf68c7 100644 --- a/Gopkg.toml +++ b/Gopkg.toml @@ -142,8 +142,8 @@ name = "github.com/yadvendar/negroni-newrelic-go-agent" [[constraint]] - branch = "master" name = "github.com/zhouzhuojie/conditions" + version = "0.2.2" [[constraint]] branch = "master" @@ -157,11 +157,11 @@ name = "github.com/avast/retry-go" version = "2.2.0" +[[constraint]] + name = "cloud.google.com/go" + version = "0.35.1" + [prune] go-tests = true unused-packages = true - -[[constraint]] - name = "cloud.google.com/go" - version = "0.35.1" diff --git a/benchmark/README.md b/benchmark/README.md index 2ce146b2..662f530a 100644 --- a/benchmark/README.md +++ b/benchmark/README.md @@ -2,7 +2,7 @@ ``` go get -u github.com/tsenart/vegeta -vegeta attack -targets ./postEvaluation.target -body ./postEvaluation.json -output ./postEvaluation.output -workers 1000 +vegeta attack -targets ./postEvaluation.target -body ./postEvaluation.json -output ./postEvaluation.output -workers 100 -rate 2000 ``` ``` @@ -16,10 +16,11 @@ Status Codes [code:count] 200:56521 Error Set: ``` -## Getting the flamegraph from go-torch +## Getting the flamegraph from go tool ``` -go-torch -u http://localhost:18000/ +curl http://localhost:18000/debug/pprof/profile -o /tmp/flagr_profile +go tool pprof -http=":8081" /tmp/flagr_profile ``` -![torch.svg](./torch.svg) +![torch.png](./torch.png) diff --git a/benchmark/postEvaluation.json b/benchmark/postEvaluation.json index 1982a01d..9dfe7780 100644 --- a/benchmark/postEvaluation.json +++ b/benchmark/postEvaluation.json @@ -2,8 +2,7 @@ "entityID": "123", "entityType": "report", "entityContext": { - "dl_state": "CA" + "state": "CA" }, - "flagID": 2, - "enableDebug": true + "flagID": 1 } diff --git a/benchmark/postEvaluation.output b/benchmark/postEvaluation.output index c4aa5e50..a67ee96e 100644 Binary files a/benchmark/postEvaluation.output and b/benchmark/postEvaluation.output differ diff --git a/benchmark/postEvaluation.target b/benchmark/postEvaluation.target index da51fa06..b1acc035 100644 --- a/benchmark/postEvaluation.target +++ b/benchmark/postEvaluation.target @@ -1,2 +1,2 @@ -POST http://localhost:18000/api/evaluation +POST http://localhost:18000/api/v1/evaluation Content-Type: application/json diff --git a/benchmark/torch.png b/benchmark/torch.png new file mode 100644 index 00000000..89b0d5ad Binary files /dev/null and b/benchmark/torch.png differ diff --git a/benchmark/torch.svg b/benchmark/torch.svg deleted file mode 100644 index 73310121..00000000 --- a/benchmark/torch.svg +++ /dev/null @@ -1,1122 +0,0 @@ - - - - - - - - - - - - - - -Flame Graph - -Reset Zoom -Search - - -net/http.(*conn).serve (76 samples, 69.09%) -net/http.(*conn).serve - - -runtime.semasleep.func1 (6 samples, 5.45%) -runtime.. - - -runtime.goready (10 samples, 9.09%) -runtime.goready - - -runtime.notewakeup (3 samples, 2.73%) -ru.. - - -syscall.Read (6 samples, 5.45%) -syscall.. - - -runtime.systemstack (6 samples, 5.45%) -runtime.. - - -runtime.startm (11 samples, 10.00%) -runtime.startm - - -runtime.mach_semaphore_signal (7 samples, 6.36%) -runtime... - - -internal/poll.(*FD).Write (25 samples, 22.73%) -internal/poll.(*FD).Write - - -runtime.mach_semaphore_wait (6 samples, 5.45%) -runtime.. - - -runtime.notewakeup (1 samples, 0.91%) - - - -bufio.(*Reader).Peek (10 samples, 9.09%) -bufio.(*Reade.. - - -syscall.Syscall (1 samples, 0.91%) - - - -runtime.systemstack (2 samples, 1.82%) -r.. - - -runtime.reentersyscall (3 samples, 2.73%) -ru.. - - -runtime.ready (10 samples, 9.09%) -runtime.ready - - -runtime.semawakeup (7 samples, 6.36%) -runtime... - - -github.com/checkr/flagr/vendor/github.com/urfave/negroni.middleware.ServeHTTP (14 samples, 12.73%) -github.com/checkr/f.. - - -runtime.mach_semaphore_signal (10 samples, 9.09%) -runtime.mach_.. - - -runtime.semawakeup (11 samples, 10.00%) -runtime.semawa.. - - -runtime.mach_semaphore_signal (1 samples, 0.91%) - - - -runtime.startm (7 samples, 6.36%) -runtime... - - -runtime.heapBitsForObject (1 samples, 0.91%) - - - -runtime.usleep (2 samples, 1.82%) -r.. - - -net/http.(*conn).setState (10 samples, 9.09%) -net/http.(*co.. - - -internal/poll.(*FD).Read (1 samples, 0.91%) - - - -github.com/checkr/flagr/pkg/entity.DistributionQuerySet.All (3 samples, 2.73%) -gi.. - - -runtime.mach_semrelease (7 samples, 6.36%) -runtime... - - -github.com/checkr/flagr/vendor/github.com/tylerb/graceful.(*Server).Serve.func1 (10 samples, 9.09%) -github.com/ch.. - - -encoding/json.(*decodeState).scanWhile (1 samples, 0.91%) - - - -runtime.goready.func1 (7 samples, 6.36%) -runtime... - - -github.com/checkr/flagr/vendor/github.com/jinzhu/gorm.(*Scope).CombinedConditionSql (1 samples, 0.91%) - - - -runtime.mach_semrelease (10 samples, 9.09%) -runtime.mach_.. - - -runtime.gcBgMarkWorker.func2 (1 samples, 0.91%) - - - -runtime.notewakeup (7 samples, 6.36%) -runtime... - - -encoding/json.(*Decoder).Decode (12 samples, 10.91%) -encoding/json.(*.. - - -runtime.systemstack (3 samples, 2.73%) -ru.. - - -github.com/checkr/flagr/vendor/github.com/urfave/negroni.Wrap.func1 (14 samples, 12.73%) -github.com/checkr/f.. - - -os.(*File).Write (25 samples, 22.73%) -os.(*File).Write - - -reflect.typedmemmove (1 samples, 0.91%) - - - -runtime.wakep (7 samples, 6.36%) -runtime... - - -github.com/checkr/flagr/swagger_gen/restapi/operations/evaluation.(*PostEvaluationParams).BindRequest (12 samples, 10.91%) -github.com/check.. - - -runtime.selectgo (1 samples, 0.91%) - - - -runtime.resetspinning (1 samples, 0.91%) - - - -regexp.(*Regexp).doMatch (1 samples, 0.91%) - - - -runtime.findrunnable (13 samples, 11.82%) -runtime.findrunna.. - - -net/http.(*body).Read (11 samples, 10.00%) -net/http.(*bod.. - - -runtime.wakep (11 samples, 10.00%) -runtime.wakep - - -syscall.write (25 samples, 22.73%) -syscall.write - - -internal/poll.(*FD).Read (10 samples, 9.09%) -internal/poll.. - - -encoding/json.(*decodeState).object (1 samples, 0.91%) - - - -github.com/checkr/flagr/vendor/github.com/urfave/negroni.(*Negroni).ServeHTTP (39 samples, 35.45%) -github.com/checkr/flagr/vendor/github.com/urfave/negroni... - - -runtime.systemstack (7 samples, 6.36%) -runtime... - - -github.com/checkr/flagr/vendor/github.com/jinzhu/gorm.(*DB).Find (3 samples, 2.73%) -gi.. - - -github.com/checkr/flagr/vendor/github.com/urfave/negroni.(*Logger).ServeHTTP (39 samples, 35.45%) -github.com/checkr/flagr/vendor/github.com/urfave/negroni... - - -all (110 samples, 100%) - - - -runtime.mach_semaphore_timedwait (2 samples, 1.82%) -r.. - - -runtime.semasleep1 (2 samples, 1.82%) -r.. - - -regexp.(*Regexp).doExecute (1 samples, 0.91%) - - - -runtime.newproc1 (11 samples, 10.00%) -runtime.newproc1 - - -runtime.mach_semrelease (11 samples, 10.00%) -runtime.mach_s.. - - -github.com/checkr/flagr/swagger_gen/restapi/operations/evaluation.(*PostEvaluation).ServeHTTP (13 samples, 11.82%) -github.com/checkr.. - - -runtime.notetsleep_internal (2 samples, 1.82%) -r.. - - -syscall.read (6 samples, 5.45%) -syscall.. - - -syscall.Read (1 samples, 0.91%) - - - -github.com/checkr/flagr/vendor/github.com/go-openapi/runtime/middleware.(*Context).LookupRoute (1 samples, 0.91%) - - - -net/http.HandlerFunc.ServeHTTP (14 samples, 12.73%) -net/http.HandlerFun.. - - -github.com/checkr/flagr/pkg/handler.(*EvalCache).reloadMapCache (3 samples, 2.73%) -gi.. - - -syscall.Write (25 samples, 22.73%) -syscall.Write - - -runtime.stopm (6 samples, 5.45%) -runtime.. - - -runtime.mach_semaphore_signal (3 samples, 2.73%) -ru.. - - -github.com/checkr/flagr/vendor/github.com/urfave/negroni.(middleware).ServeHTTP-fm (14 samples, 12.73%) -github.com/checkr/f.. - - -github.com/checkr/flagr/vendor/github.com/jinzhu/gorm.(*Scope).prepareQuerySQL (1 samples, 0.91%) - - - -syscall.write (8 samples, 7.27%) -syscall.wr.. - - -runtime.newproc.func1 (11 samples, 10.00%) -runtime.newpro.. - - -github.com/checkr/flagr/vendor/github.com/jinzhu/gorm.(*Scope).callCallbacks (3 samples, 2.73%) -gi.. - - -internal/poll.runtime_pollSetDeadline (7 samples, 6.36%) -internal.. - - -syscall.Syscall (25 samples, 22.73%) -syscall.Syscall - - -bufio.(*Reader).fill (10 samples, 9.09%) -bufio.(*Reade.. - - -github.com/checkr/flagr/vendor/github.com/jinzhu/gorm.(*Scope).quoteIfPossible (1 samples, 0.91%) - - - -internal/poll.setDeadlineImpl (7 samples, 6.36%) -internal.. - - -encoding/json.(*decodeState).value (1 samples, 0.91%) - - - -runtime.wakep (10 samples, 9.09%) -runtime.wakep - - -os.(*File).write (25 samples, 22.73%) -os.(*File).write - - -net.(*netFD).Read (10 samples, 9.09%) -net.(*netFD)... - - -net/http.(*connReader).(net/http.startBackgroundRead)-fm (11 samples, 10.00%) -net/http.(*con.. - - -log.(*Logger).Printf (25 samples, 22.73%) -log.(*Logger).Printf - - -runtime.mach_semrelease (3 samples, 2.73%) -ru.. - - -runtime.usleep (11 samples, 10.00%) -runtime.usleep - - -runtime.semasleep1 (6 samples, 5.45%) -runtime.. - - -net/http.(*connReader).Read (10 samples, 9.09%) -net/http.(*co.. - - -github.com/checkr/flagr/vendor/github.com/urfave/negroni.middleware.ServeHTTP (14 samples, 12.73%) -github.com/checkr/f.. - - -runtime.netpoll (5 samples, 4.55%) -runti.. - - -runtime.chansend (10 samples, 9.09%) -runtime.chans.. - - -runtime.typedmemmove (1 samples, 0.91%) - - - -github.com/checkr/flagr/vendor/github.com/jinzhu/gorm.(*Scope).orderSQL (1 samples, 0.91%) - - - -github.com/checkr/flagr/vendor/github.com/urfave/negroni.HandlerFunc.ServeHTTP (14 samples, 12.73%) -github.com/checkr/f.. - - -github.com/checkr/flagr/vendor/github.com/jinzhu/gorm.queryCallback (3 samples, 2.73%) -gi.. - - -syscall.read (1 samples, 0.91%) - - - -runtime.netpollgoready (7 samples, 6.36%) -runtime... - - -net.(*conn).Read (1 samples, 0.91%) - - - -runtime.semawakeup (3 samples, 2.73%) -ru.. - - -runtime.notesleep (6 samples, 5.45%) -runtime.. - - -runtime.runqgrab (2 samples, 1.82%) -r.. - - -encoding/json.(*decodeState).unmarshal (1 samples, 0.91%) - - - -runtime.duffcopy (1 samples, 0.91%) - - - -net.(*conn).SetReadDeadline (7 samples, 6.36%) -net.(*co.. - - -net/http.HandlerFunc.ServeHTTP (13 samples, 11.82%) -net/http.HandlerF.. - - -log.(*Logger).Output (25 samples, 22.73%) -log.(*Logger).Output - - -runtime.notewakeup (10 samples, 9.09%) -runtime.notew.. - - -github.com/checkr/flagr/vendor/github.com/urfave/negroni.(*Static).ServeHTTP (14 samples, 12.73%) -github.com/checkr/f.. - - -encoding/json.(*Decoder).readValue (11 samples, 10.00%) -encoding/json... - - -net/http.HandlerFunc.ServeHTTP (14 samples, 12.73%) -net/http.HandlerFun.. - - -net/http.(*response).finishRequest (17 samples, 15.45%) -net/http.(*response).fi.. - - -net/http.HandlerFunc.ServeHTTP (14 samples, 12.73%) -net/http.HandlerFun.. - - -runtime.freedefer (2 samples, 1.82%) -r.. - - -runtime.newproc (11 samples, 10.00%) -runtime.newproc - - -regexp.(*Regexp).MatchString (1 samples, 0.91%) - - - -syscall.Syscall (8 samples, 7.27%) -syscall.Sy.. - - -runtime.semasleep (2 samples, 1.82%) -r.. - - -runtime.schedule (14 samples, 12.73%) -runtime.schedule - - -github.com/checkr/flagr/vendor/github.com/go-openapi/runtime/middleware.Spec.func1 (14 samples, 12.73%) -github.com/checkr/f.. - - -runtime.goready.func1 (10 samples, 9.09%) -runtime.gorea.. - - -runtime.ready (7 samples, 6.36%) -runtime... - - -github.com/checkr/flagr/pkg/handler.(*EvalCache).Start.func1 (3 samples, 2.73%) -gi.. - - -net/http.HandlerFunc.ServeHTTP (14 samples, 12.73%) -net/http.HandlerFun.. - - -runtime.runqsteal (2 samples, 1.82%) -r.. - - -net/http.(*connReader).abortPendingRead (7 samples, 6.36%) -net/http.. - - -runtime.scanobject (1 samples, 0.91%) - - - -github.com/checkr/flagr/vendor/github.com/jinzhu/gorm.(*Scope).scan (1 samples, 0.91%) - - - -runtime.chansend1 (10 samples, 9.09%) -runtime.chans.. - - -runtime.startm (10 samples, 9.09%) -runtime.startm - - -encoding/json.(*Decoder).refill (11 samples, 10.00%) -encoding/json... - - -syscall.Syscall (6 samples, 5.45%) -syscall.. - - -runtime.goready (7 samples, 6.36%) -runtime... - - -runtime.wakep (1 samples, 0.91%) - - - -runtime.deferreturn (2 samples, 1.82%) -r.. - - -net.(*netFD).Read (1 samples, 0.91%) - - - -github.com/checkr/flagr/vendor/github.com/go-openapi/runtime.JSONConsumer.func1 (12 samples, 10.91%) -github.com/check.. - - -net.(*netFD).Write (10 samples, 9.09%) -net.(*netFD)... - - -regexp.(*machine).onepass (1 samples, 0.91%) - - - -runtime.semawakeup (1 samples, 0.91%) - - - -database/sql.(*Rows).awaitDone (1 samples, 0.91%) - - - -encoding/json.(*decodeState).value (1 samples, 0.91%) - - - -github.com/checkr/flagr/pkg/entity.(*Segment).Preload (3 samples, 2.73%) -gi.. - - -runtime.entersyscall_sysmon (3 samples, 2.73%) -ru.. - - -runtime.freedefer (4 samples, 3.64%) -runt.. - - -github.com/checkr/flagr/vendor/github.com/rs/cors.(*Cors).Handler.func1 (14 samples, 12.73%) -github.com/checkr/f.. - - -runtime.mach_semrelease (1 samples, 0.91%) - - - -runtime.systemstack (11 samples, 10.00%) -runtime.system.. - - -runtime.mstart1 (13 samples, 11.82%) -runtime.mstart1 - - -runtime.gcDrain (1 samples, 0.91%) - - - -net/http.serverHandler.ServeHTTP (39 samples, 35.45%) -net/http.serverHandler.ServeHTTP - - -runtime.systemstack (1 samples, 0.91%) - - - -github.com/checkr/flagr/vendor/github.com/urfave/negroni.middleware.ServeHTTP (39 samples, 35.45%) -github.com/checkr/flagr/vendor/github.com/urfave/negroni... - - -runtime.park_m (14 samples, 12.73%) -runtime.park_m - - -runtime.gcBgMarkWorker (1 samples, 0.91%) - - - -bufio.(*Writer).Flush (10 samples, 9.09%) -bufio.(*Write.. - - -runtime.mach_semaphore_signal (11 samples, 10.00%) -runtime.mach_s.. - - -github.com/checkr/flagr/pkg/entity.(*Flag).Preload (3 samples, 2.73%) -gi.. - - -github.com/checkr/flagr/vendor/github.com/go-openapi/runtime/middleware.(*defaultRouter).Lookup (1 samples, 0.91%) - - - -internal/poll.(*FD).Write (10 samples, 9.09%) -internal/poll.. - - -runtime.notetsleep (2 samples, 1.82%) -r.. - - -github.com/checkr/flagr/vendor/github.com/go-openapi/runtime/middleware.Redoc.func1 (14 samples, 12.73%) -github.com/checkr/f.. - - -github.com/checkr/flagr/vendor/github.com/go-openapi/runtime/middleware.NewOperationExecutor.func1 (13 samples, 11.82%) -github.com/checkr.. - - -github.com/checkr/flagr/vendor/github.com/gohttp/pprof.New.func1.1 (14 samples, 12.73%) -github.com/checkr/f.. - - -github.com/checkr/flagr/vendor/github.com/go-openapi/runtime/middleware.(*Context).BindValidRequest (12 samples, 10.91%) -github.com/check.. - - -github.com/checkr/flagr/vendor/github.com/urfave/negroni.(middleware).ServeHTTP-fm (14 samples, 12.73%) -github.com/checkr/f.. - - -github.com/checkr/flagr/vendor/github.com/go-openapi/runtime/middleware.(*Context).RouteInfo (1 samples, 0.91%) - - - -net.(*conn).Read (10 samples, 9.09%) -net.(*conn).R.. - - -encoding/json.(*decodeState).literal (1 samples, 0.91%) - - - -runtime.semasleep (6 samples, 5.45%) -runtime.. - - -encoding/json.stateInString (1 samples, 0.91%) - - - -net/http.(*body).readLocked (11 samples, 10.00%) -net/http.(*bod.. - - -runtime.notewakeup (11 samples, 10.00%) -runtime.notewa.. - - -syscall.Write (8 samples, 7.27%) -syscall.Wr.. - - -runtime.deferreturn (4 samples, 3.64%) -runt.. - - -runtime.semawakeup (10 samples, 9.09%) -runtime.semaw.. - - -net/http.HandlerFunc.ServeHTTP (14 samples, 12.73%) -net/http.HandlerFun.. - - -runtime.kevent (5 samples, 4.55%) -runti.. - - -runtime.sysmon (13 samples, 11.82%) -runtime.sysmon - - -reflect.Value.Set (1 samples, 0.91%) - - - -internal/poll.(*FD).SetReadDeadline (7 samples, 6.36%) -internal.. - - -net/http.(*connReader).startBackgroundRead (11 samples, 10.00%) -net/http.(*con.. - - -github.com/checkr/flagr/vendor/github.com/go-openapi/runtime.ConsumerFunc.Consume (12 samples, 10.91%) -github.com/check.. - - -runtime.systemstack (10 samples, 9.09%) -runtime.syste.. - - -runtime.send (10 samples, 9.09%) -runtime.send - - -net/http.(*connReader).backgroundRead (2 samples, 1.82%) -n.. - - -runtime.entersyscall (3 samples, 2.73%) -ru.. - - -net.(*conn).Write (10 samples, 9.09%) -net.(*conn).W.. - - -runtime.startm (1 samples, 0.91%) - - - -runtime.mstart (13 samples, 11.82%) -runtime.mstart - - -runtime.mcall (14 samples, 12.73%) -runtime.mcall - - -runtime.semasleep.func1 (2 samples, 1.82%) -r.. - - -github.com/checkr/flagr/vendor/github.com/go-openapi/runtime/middleware.NewRouter.func1 (14 samples, 12.73%) -github.com/checkr/f.. - - -net/http.checkConnErrorWriter.Write (10 samples, 9.09%) -net/http.chec.. - - diff --git a/pkg/handler/eval.go b/pkg/handler/eval.go index 47c6e63c..5c73234f 100644 --- a/pkg/handler/eval.go +++ b/pkg/handler/eval.go @@ -229,7 +229,7 @@ var evalSegment = func( } if !match { log = &models.SegmentDebugLog{ - Msg: debugConstraintMsg(expr, m), + Msg: debugConstraintMsg(evalContext.EnableDebug, expr, m), SegmentID: int64(segment.ID), } return nil, log, true @@ -252,7 +252,10 @@ var evalSegment = func( return vID, log, false } -func debugConstraintMsg(expr conditions.Expr, m map[string]interface{}) string { +func debugConstraintMsg(enableDebug bool, expr conditions.Expr, m map[string]interface{}) string { + if !enableDebug { + return "" + } return fmt.Sprintf("constraint not match. constraint: %s, entity_context: %+v.", expr, m) } diff --git a/vendor/github.com/zhouzhuojie/conditions/ast.go b/vendor/github.com/zhouzhuojie/conditions/ast.go index a7393b28..db3aa919 100644 --- a/vendor/github.com/zhouzhuojie/conditions/ast.go +++ b/vendor/github.com/zhouzhuojie/conditions/ast.go @@ -98,8 +98,19 @@ func (n *NumberLiteral) Args() []string { return args } +func NewSliceStringLiteral(val []string) *SliceStringLiteral { + ssl := &SliceStringLiteral{} + ssl.Val = val + ssl.m = make(map[string]struct{}) + for _, item := range ssl.Val { + ssl.m[item] = struct{}{} + } + return ssl +} + type SliceStringLiteral struct { Val []string + m map[string]struct{} } // String returns a string representation of the literal. diff --git a/vendor/github.com/zhouzhuojie/conditions/evaluator.go b/vendor/github.com/zhouzhuojie/conditions/evaluator.go index afb50219..908aae0e 100644 --- a/vendor/github.com/zhouzhuojie/conditions/evaluator.go +++ b/vendor/github.com/zhouzhuojie/conditions/evaluator.go @@ -99,7 +99,8 @@ func evaluateSubtree(expr Expr, args map[string]interface{}) (Expr, error) { case reflect.Slice: switch args[index].(type) { case []string: - return &SliceStringLiteral{Val: args[index].([]string)}, nil + ssl := NewSliceStringLiteral(args[index].([]string)) + return ssl, nil case []int: snl := &SliceNumberLiteral{} for _, v := range args[index].([]int) { @@ -143,11 +144,12 @@ func evaluateSubtree(expr Expr, args map[string]interface{}) (Expr, error) { item := items[0] switch item.(type) { case string: - snl := &SliceStringLiteral{} + val := []string{} for _, v := range items { - snl.Val = append(snl.Val, v.(string)) + val = append(val, v.(string)) } - return snl, nil + ssl := NewSliceStringLiteral(val) + return ssl, nil case float64: snl := &SliceNumberLiteral{} for _, v := range items { @@ -261,24 +263,18 @@ func applyIN(l, r Expr) (*BooleanLiteral, error) { switch t := l.(type) { case *StringLiteral: var a string - var b []string + var b map[string]struct{} + a, err = getString(l) if err != nil { return nil, err } - b, err = getSliceString(r) - + b, err = getMapString(r) if err != nil { return nil, err } - - found = false - for _, e := range b { - if a == e { - found = true - } - } + _, found = b[a] case *NumberLiteral: var a float64 var b []float64 @@ -532,13 +528,13 @@ func getSliceNumber(e Expr) ([]float64, error) { } } -// getSliceString performs type assertion and returns []string value or error -func getSliceString(e Expr) ([]string, error) { +// getMapString performs type assertion and returns map[string]struct{} value or error +func getMapString(e Expr) (map[string]struct{}, error) { switch n := e.(type) { case *SliceStringLiteral: - return n.Val, nil + return n.m, nil default: - return []string{}, fmt.Errorf("Literal is not a slice of string: %v", n) + return nil, fmt.Errorf("Literal is not a slice of string: %v", n) } } diff --git a/vendor/github.com/zhouzhuojie/conditions/parser.go b/vendor/github.com/zhouzhuojie/conditions/parser.go index ccbd2a4c..a31f1dea 100644 --- a/vendor/github.com/zhouzhuojie/conditions/parser.go +++ b/vendor/github.com/zhouzhuojie/conditions/parser.go @@ -302,7 +302,8 @@ func (p *Parser) parseUnaryExpr() (Expr, error) { } values = append(values, str) } - return &SliceStringLiteral{Val: values}, err + ssl := NewSliceStringLiteral(values) + return ssl, err case float64: values := []float64{} for _, v := range mapVal {