Skip to content

Commit

Permalink
promql正则修改
Browse files Browse the repository at this point in the history
  • Loading branch information
少卿 committed Mar 3, 2022
1 parent 5393665 commit b6cf2aa
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/prediction/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ const (

// following is node exporter metric for node cpu/memory usage
// NodeCpuUsagePromQLFmtStr is used to query node cpu usage by promql, param is node name which prometheus scrape, duration str
NodeCpuUsagePromQLFmtStr = `sum(count(node_cpu_seconds_total{mode="idle",instance="%s"}) by (mode, cpu)) - sum(irate(node_cpu_seconds_total{mode="idle",instance="%s"}[%s]))`
NodeCpuUsagePromQLFmtStr = `sum(count(node_cpu_seconds_total{mode="idle",instance=~"(%s)(:\\d+)?"}) by (mode, cpu)) - sum(irate(node_cpu_seconds_total{mode="idle",instance=~"(%s)(:\\d+)?"}[%s]))`
// NodeMemUsagePromQLFmtStr is used to query node cpu memory by promql, param is node name, node name which prometheus scrape
NodeMemUsagePromQLFmtStr = `sum(node_memory_MemTotal_bytes{instance="%s"} - node_memory_MemAvailable_bytes{instance="%s"})`
NodeMemUsagePromQLFmtStr = `sum(node_memory_MemTotal_bytes{instance=~"(%s)(:\\d+)?"} - node_memory_MemAvailable_bytes{instance=~"(%s)(:\\d+)?"})`
)

var UpdateEventBroadcaster Broadcaster = NewBroadcaster()
Expand Down

0 comments on commit b6cf2aa

Please sign in to comment.