mirror of
https://github.com/ClusterCockpit/cc-metric-collector.git
synced 2025-04-08 22:45:55 +02:00
Rename measure
This commit is contained in:
parent
b37daef4eb
commit
8d2cc79b99
@ -14,8 +14,8 @@ const (
|
|||||||
Rotation
|
Rotation
|
||||||
Hertz
|
Hertz
|
||||||
Time
|
Time
|
||||||
Power
|
Watt
|
||||||
Energy
|
Joule
|
||||||
Cycles
|
Cycles
|
||||||
Requests
|
Requests
|
||||||
Packets
|
Packets
|
||||||
@ -40,9 +40,9 @@ func (m *Measure) String() string {
|
|||||||
return "Hertz"
|
return "Hertz"
|
||||||
case Time:
|
case Time:
|
||||||
return "Seconds"
|
return "Seconds"
|
||||||
case Power:
|
case Watt:
|
||||||
return "Watts"
|
return "Watts"
|
||||||
case Energy:
|
case Joule:
|
||||||
return "Joules"
|
return "Joules"
|
||||||
case Cycles:
|
case Cycles:
|
||||||
return "Cycles"
|
return "Cycles"
|
||||||
@ -75,9 +75,9 @@ func (m *Measure) Short() string {
|
|||||||
return "Hz"
|
return "Hz"
|
||||||
case Time:
|
case Time:
|
||||||
return "s"
|
return "s"
|
||||||
case Power:
|
case Watt:
|
||||||
return "W"
|
return "W"
|
||||||
case Energy:
|
case Joule:
|
||||||
return "J"
|
return "J"
|
||||||
case Cycles:
|
case Cycles:
|
||||||
return "cyc"
|
return "cyc"
|
||||||
@ -100,8 +100,8 @@ const degreeFRegexStr = `^(deg[fF]|°[fF])`
|
|||||||
const rpmRegexStr = `^([rR][pP][mM])`
|
const rpmRegexStr = `^([rR][pP][mM])`
|
||||||
const hertzRegexStr = `^([hH][eE]?[rR]?[tT]?[zZ])`
|
const hertzRegexStr = `^([hH][eE]?[rR]?[tT]?[zZ])`
|
||||||
const timeRegexStr = `^([sS][eE]?[cC]?[oO]?[nN]?[dD]?[sS]?)`
|
const timeRegexStr = `^([sS][eE]?[cC]?[oO]?[nN]?[dD]?[sS]?)`
|
||||||
const powerRegexStr = `^([wW][aA]?[tT]?[tT]?[sS]?)`
|
const wattRegexStr = `^([wW][aA]?[tT]?[tT]?[sS]?)`
|
||||||
const energyRegexStr = `^([jJ][oO]?[uU]?[lL]?[eE]?[sS]?)`
|
const jouleRegexStr = `^([jJ][oO]?[uU]?[lL]?[eE]?[sS]?)`
|
||||||
const cyclesRegexStr = `^([cC][yY][cC]?[lL]?[eE]?[sS]?)`
|
const cyclesRegexStr = `^([cC][yY][cC]?[lL]?[eE]?[sS]?)`
|
||||||
const requestsRegexStr = `^([rR][eE][qQ][uU]?[eE]?[sS]?[tT]?[sS]?)`
|
const requestsRegexStr = `^([rR][eE][qQ][uU]?[eE]?[sS]?[tT]?[sS]?)`
|
||||||
const packetsRegexStr = `^([pP][aA]?[cC]?[kK][eE]?[tT][sS]?)`
|
const packetsRegexStr = `^([pP][aA]?[cC]?[kK][eE]?[tT][sS]?)`
|
||||||
@ -115,8 +115,8 @@ var degreeFRegex = regexp.MustCompile(degreeFRegexStr)
|
|||||||
var rpmRegex = regexp.MustCompile(rpmRegexStr)
|
var rpmRegex = regexp.MustCompile(rpmRegexStr)
|
||||||
var hertzRegex = regexp.MustCompile(hertzRegexStr)
|
var hertzRegex = regexp.MustCompile(hertzRegexStr)
|
||||||
var timeRegex = regexp.MustCompile(timeRegexStr)
|
var timeRegex = regexp.MustCompile(timeRegexStr)
|
||||||
var powerRegex = regexp.MustCompile(powerRegexStr)
|
var wattRegex = regexp.MustCompile(wattRegexStr)
|
||||||
var energyRegex = regexp.MustCompile(energyRegexStr)
|
var jouleRegex = regexp.MustCompile(jouleRegexStr)
|
||||||
var cyclesRegex = regexp.MustCompile(cyclesRegexStr)
|
var cyclesRegex = regexp.MustCompile(cyclesRegexStr)
|
||||||
var requestsRegex = regexp.MustCompile(requestsRegexStr)
|
var requestsRegex = regexp.MustCompile(requestsRegexStr)
|
||||||
var packetsRegex = regexp.MustCompile(packetsRegexStr)
|
var packetsRegex = regexp.MustCompile(packetsRegexStr)
|
||||||
@ -160,13 +160,13 @@ func NewMeasure(unit string) Measure {
|
|||||||
if match != nil {
|
if match != nil {
|
||||||
return Cycles
|
return Cycles
|
||||||
}
|
}
|
||||||
match = powerRegex.FindStringSubmatch(unit)
|
match = wattRegex.FindStringSubmatch(unit)
|
||||||
if match != nil {
|
if match != nil {
|
||||||
return Power
|
return Watt
|
||||||
}
|
}
|
||||||
match = energyRegex.FindStringSubmatch(unit)
|
match = jouleRegex.FindStringSubmatch(unit)
|
||||||
if match != nil {
|
if match != nil {
|
||||||
return Energy
|
return Joule
|
||||||
}
|
}
|
||||||
match = requestsRegex.FindStringSubmatch(unit)
|
match = requestsRegex.FindStringSubmatch(unit)
|
||||||
if match != nil {
|
if match != nil {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user