diff options
| author | Paul Buetow <paul@buetow.org> | 2026-05-22 13:16:48 +0300 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2026-05-22 13:16:48 +0300 |
| commit | bbefcf38c5391c8338bb2edf205ab775e3a38f74 (patch) | |
| tree | f03f45a71308c0d47c052a3afee7cccfef42656e /internal/rpn/operations.go | |
| parent | 7078e12d89b13ee5858b9ade1ad63b23e7903dbc (diff) | |
feat: implement custom metric commands (define, undefine, list, show)
- Add Unregister() to MetricRegistry for removing custom metrics
- Handle 'custom show', 'custom list', 'custom define', 'custom undefine' in rpn_parse.go evaluate()
- Add CustomList, CustomDefine, CustomUndefine methods to Operations
- Update Operator interface with new custom metric methods
- Add comprehensive tests for all custom metric operations
Diffstat (limited to 'internal/rpn/operations.go')
| -rw-r--r-- | internal/rpn/operations.go | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/internal/rpn/operations.go b/internal/rpn/operations.go index d45ffd1..9e5bbca 100644 --- a/internal/rpn/operations.go +++ b/internal/rpn/operations.go @@ -165,6 +165,10 @@ type Operator interface { MetricList(stack *Stack) (string, error) MetricCategory(stack *Stack, categoryName string) (string, error) MetricCompatible(stack *Stack) (string, error) + // Custom metric commands + CustomList(stack *Stack) (string, error) + CustomDefine(name string, factor float64, category string) error + CustomUndefine(name string) error } // Operations provides operator implementations and stack manipulation. |
