forked from open-policy-agent/opa
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathprofiler.go
35 lines (26 loc) · 1.02 KB
/
profiler.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
// Copyright 2018 The OPA Authors. All rights reserved.
// Use of this source code is governed by an Apache2
// license that can be found in the LICENSE file.
// Package profiler computes and reports on the time spent on expressions.
package profiler
import (
v1 "github.com/open-policy-agent/opa/v1/profiler"
)
// Profiler computes and reports on the time spent on expressions.
type Profiler = v1.Profiler
// New returns a new Profiler object.
func New() *Profiler {
return v1.New()
}
// ExprStats represents the result of profiling an expression.
type ExprStats = v1.ExprStats
// ExprStatsAggregated represents the result of profiling an expression
// by aggregating `n` profiles.
type ExprStatsAggregated = v1.ExprStatsAggregated
func AggregateProfiles(profiles ...[]ExprStats) []ExprStatsAggregated {
return v1.AggregateProfiles(profiles...)
}
// Report represents the profiler report for a set of files.
type Report = v1.Report
// FileReport represents a profiler report for a single file.
type FileReport = v1.FileReport