Skip to content

Commit

Permalink
Merge branch 'develop_custom_models' of github.com:lcrownover/prometh…
Browse files Browse the repository at this point in the history
…eus-slurm-exporter into develop_custom_models
  • Loading branch information
freddy-lopez01 committed Dec 24, 2024
2 parents 71f2ba2 + a41ac46 commit 7c88840
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
3 changes: 3 additions & 0 deletions internal/api/models.go
Original file line number Diff line number Diff line change
Expand Up @@ -359,6 +359,7 @@ func (n *NodeData) SetNodeStates(states []string) error {
notresp := regexp.MustCompile(`^not_responding`)
invalid := regexp.MustCompile(`^invalid`)
invalidreg := regexp.MustCompile(`^invalid_reg`)
dynnorm := regexp.MustCompile(`^dynamic_norm`)

var stateUnit types.NodeState

Expand Down Expand Up @@ -391,6 +392,8 @@ func (n *NodeData) SetNodeStates(states []string) error {
stateUnit = types.NodeStateInvalid
case invalidreg.MatchString(state):
stateUnit = types.NodeStateInvalidReg
case dynnorm.MatchString(state):
stateUnit = types.NodeStateDynamicNorm
default:
return fmt.Errorf("failed to match cpu state against known states: %v", state)
}
Expand Down
1 change: 1 addition & 0 deletions internal/types/nodes.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,5 @@ const (
NodeStateNotResponding NodeState = "not_responding"
NodeStateInvalid NodeState = "invalid"
NodeStateInvalidReg NodeState = "invalid_reg"
NodeStateDynamicNorm NodeState = "dynamic_norm"
)

0 comments on commit 7c88840

Please sign in to comment.