summaryrefslogtreecommitdiff
path: root/internal/rpn/operations.go
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2026-05-22 13:16:48 +0300
committerPaul Buetow <paul@buetow.org>2026-05-22 13:16:48 +0300
commitbbefcf38c5391c8338bb2edf205ab775e3a38f74 (patch)
treef03f45a71308c0d47c052a3afee7cccfef42656e /internal/rpn/operations.go
parent7078e12d89b13ee5858b9ade1ad63b23e7903dbc (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.go4
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.