Initial commit

This commit is contained in:
Donny
2019-04-22 20:46:32 +08:00
commit 49ab8aadd1
25441 changed files with 4055000 additions and 0 deletions

View File

@@ -0,0 +1,29 @@
package prom
import (
"fmt"
)
const (
RouteNormalMode = "normal_mode"
RouteCodeMode = "code_mode"
RouteUpFrom = "upfrom_"
RouteNumFormatVids = "%s_%dp"
RouteStrFormatVids = "%s_%sp"
RouteDmIndexTry = "dm_index_retry"
RouteDatabusTry = "databus_retry"
)
// FormatVideoKey format videos prom key
func FormatVideoKey(count int, tp string) (key string) {
if count >= 0 && count <= 5 {
key = fmt.Sprintf(RouteNumFormatVids, tp, count)
} else if count >= 6 && count <= 10 {
key = fmt.Sprintf(RouteStrFormatVids, tp, "6_10")
} else {
key = fmt.Sprintf(RouteStrFormatVids, tp, "above_10")
}
return
}