Commit Graph

8 Commits

Author SHA1 Message Date
Will Beason 3be1d08b87 Change check-lint to use golangci-lint (#3465)
golint is deprecated. The author of the code no longer supports the
codebase. golangci-lint is faster than golint, and is in use by other
opa repositories (e.g. Gatekeeper).

This commit changes tools.go to reference golangci (so it ends up in
vendor) and modifies check-lint to use golangci instead.

Breaking API Changes:

- plugins/rest/rest.go: Fix typo "AllowInsureTLS" -> "AllowInsecureTLS"
- storage/errors.go: Removed unused IndexingNotSupportedErr

Signed-off-by: Will Beason <willbeason@google.com>
2021-05-19 07:52:02 +02:00
Patrick East b45ab28375 rego: Plumb the newer QueryTracer through Rego API's
This will deprecate the older API's that used the `topdown.Tracer` in
favor of the newer `topdown.QueryTracer` interface. Usages of the old
API have been swapped, although some of the testing is left with them
to ensure we still support them (until we remove the deprecated API).

Signed-off-by: Patrick East <east.patrick@gmail.com>
2020-07-15 12:01:12 -07:00
Patrick East a233a316da profiler: Update Profiler tracer to be a QueryTracer
Using the newer `topdown.QueryTracer` interface yields a significant
performance improvement for the tracer (up to ~10% for relevant
 benchmarks).

Signed-off-by: Patrick East <east.patrick@gmail.com>
2020-06-08 10:04:34 -04:00
Patrick East 837011c5bc profiler: Disable local var plugging on trace
This adds support for the `topdown.CustomTracer` to the `Profiler` so
that we can signal via config to not plug local vars on trace events.

This improves the performance substantially in cases where there are
many/large local variables.

Fixes: #2245
Signed-off-by: Patrick East <east.patrick@gmail.com>
2020-05-21 15:11:11 -07:00
Ashutosh Narkar 4e5f791673 profiler: Group expressions with missing locations
Previously the profiler would panic if it encountered an expression with no location info. This change groups such expressions by giving them a fake location so that their evaluation results can be captured.

Signed-off-by: Ashutosh Narkar <anarkar4387@gmail.com>
2020-04-08 11:30:08 -07:00
Ashutosh Narkar eb5e5b243f Add profiler to OPA eval command
Signed-off-by: Ashutosh Narkar <anarkar4387@gmail.com>
2018-07-20 16:00:05 -07:00
Ashutosh Narkar 45f589b2a7 Sort profiler result based on criteria to return top N results
Signed-off-by: Ashutosh Narkar <anarkar4387@gmail.com>
2018-07-03 10:34:04 -07:00
Ashutosh Narkar e85546d1b6 Add Rego profiler
Signed-off-by: Ashutosh Narkar <anarkar4387@gmail.com>
2018-07-03 10:34:04 -07:00