Skip to content
This repository was archived by the owner on Jun 16, 2026. It is now read-only.

Commit ebe7ea5

Browse files
committed
feat: add pipeline_resolver_execution_paths
1 parent 09b0b4d commit ebe7ea5

4 files changed

Lines changed: 447 additions & 35 deletions

File tree

README.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,26 @@ patterner metrics
8080

8181
The metrics command outputs detailed JSON data about your workspace resources.
8282

83+
#### Available Metrics
84+
85+
The following metrics are collected and displayed:
86+
87+
**Pipeline Metrics:**
88+
- `pipelines_total` - Total number of pipelines
89+
- `pipeline_resolvers_total` - Total number of pipeline resolvers
90+
- `pipeline_resolver_steps_total` - Total number of pipeline resolver steps
91+
- `pipeline_resolver_execution_paths_total` - Total number of pipeline resolver execution paths
92+
- Calculated based on the number of steps and tests in each resolver (steps^tests)
93+
- Used to understand the total number of execution paths based on testable step combinations
94+
95+
**TailorDB Metrics:**
96+
- `tailordbs_total` - Total number of TailorDBs
97+
- `tailordb_types_total` - Total number of TailorDB types
98+
- `tailordb_type_fields_total` - Total number of TailorDB type fields
99+
100+
**StateFlow Metrics:**
101+
- `stateflows_total` - Total number of StateFlows
102+
83103
## Configuration
84104

85105
Patterner uses a `.patterner.yml` file for configuration. The configuration includes various lint rules for different Tailor Platform components:

tailor/metrics.go

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
package tailor
22

3+
import "math"
4+
35
const (
46
pageSize = 100
57
)
@@ -21,10 +23,18 @@ func (c *Client) Metrics(resources *Resources) ([]Metric, error) {
2123
})
2224
resolversTotal := 0
2325
stepsTotal := 0
26+
executionPathsTotal := 0
2427
for _, p := range resources.Pipelines {
2528
resolversTotal += len(p.Resolvers)
2629
for _, r := range p.Resolvers {
30+
testsCount := 0
2731
stepsTotal += len(r.Steps)
32+
for _, s := range r.Steps {
33+
if s.Operation.Test != "" {
34+
testsCount++
35+
}
36+
}
37+
executionPathsTotal += int(math.Pow(float64(len(r.Steps)), float64(testsCount)))
2838
}
2939
}
3040
metrics = append(metrics, Metric{
@@ -37,6 +47,11 @@ func (c *Client) Metrics(resources *Resources) ([]Metric, error) {
3747
Description: "Total number of pipeline resolver steps",
3848
Value: float64(stepsTotal),
3949
})
50+
metrics = append(metrics, Metric{
51+
Name: "pipeline_resolver_execution_paths_total",
52+
Description: "Total number of pipeline resolver execution paths",
53+
Value: float64(executionPathsTotal),
54+
})
4055

4156
// TailorDB Metrics
4257
metrics = append(metrics, Metric{

0 commit comments

Comments
 (0)