Merge pull request #8 from alibaba/inner_push_github

Inner push GitHub
v4
Vinllen Chen 6 years ago committed by GitHub
commit 8b41f8140b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 5
      src/redis-shake/common/common.go
  2. 1
      src/redis-shake/main/main.go
  3. 3
      src/redis-shake/metric/variables.go

@ -6,8 +6,8 @@ import(
)
const(
// GolangSecurityTime = "2006-01-02T15:04:05Z"
GolangSecurityTime = "2006-01-02 15:04:05"
GolangSecurityTime = "2006-01-02T15:04:05Z"
// GolangSecurityTime = "2006-01-02 15:04:05"
ReaderBufferSize = bytesize.MB * 32
WriterBufferSize = bytesize.MB * 8
)
@ -15,4 +15,5 @@ const(
var(
Version = "$"
LogRotater *logRotate.Logger
StartTime string
)

@ -81,6 +81,7 @@ func main() {
initFreeOS()
nimo.Profiling(int(conf.Options.SystemProfile))
utils.Welcome()
utils.StartTime = fmt.Sprintf("%v", time.Now().Format(utils.GolangSecurityTime))
if err = utils.WritePidById(conf.Options.Id); err != nil {
crash(fmt.Sprintf("write pid failed. %v", err), -5)

@ -3,9 +3,11 @@ package metric
import(
"fmt"
"redis-shake/base"
"redis-shake/common"
)
type MetricRest struct {
StartTime interface{}
PullCmdCount interface{}
PullCmdCountTotal interface{}
BypassCmdCount interface{}
@ -39,6 +41,7 @@ func NewMetricRest() *MetricRest {
sourceDbOffset := detailedInfo[3]
return &MetricRest{
StartTime: utils.StartTime,
PullCmdCount: MetricVar.GetPullCmdCount(),
PullCmdCountTotal: MetricVar.GetPullCmdCountTotal(),
BypassCmdCount: MetricVar.GetBypassCmdCount(),

Loading…
Cancel
Save