Skip to content
This repository was archived by the owner on Jul 21, 2021. It is now read-only.

Commit

Permalink
fix time unix setting
Browse files Browse the repository at this point in the history
  • Loading branch information
neuron committed Mar 7, 2020
1 parent b82a494 commit d7dcbe5
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions zk/flw.go
Original file line number Diff line number Diff line change
Expand Up @@ -228,8 +228,8 @@ func FLWCons(servers []string, timeout time.Duration) ([]*ServerClients, bool) {
MinLatency: int32(minlat),
AvgLatency: int32(avglat),
MaxLatency: int32(maxlat),
Established: time.Unix(est/1000, est%1000),
LastResponse: time.Unix(lresp/1000, lresp%1000),
Established: time.Unix(est/1000, (est%1000)*1e6),
LastResponse: time.Unix(lresp/1000, (lresp%1000)*1e6),
Addr: match[0],
LastOperation: match[6],
})
Expand Down
16 changes: 8 additions & 8 deletions zk/flw_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -162,11 +162,11 @@ func TestFLWCons(t *testing.T) {
Sent: 9457,
SessionID: 669956116721374901,
LastOperation: "PING",
Established: time.Unix(1427238717, 217),
Established: time.Unix(1427238717, 217*1e6),
Timeout: 20001,
Lcxid: 1427245333,
Lzxid: -1,
LastResponse: time.Unix(1427259255, 908),
LastResponse: time.Unix(1427259255, 908*1e6),
LastLatency: 0,
MinLatency: 0,
AvgLatency: 1,
Expand All @@ -179,11 +179,11 @@ func TestFLWCons(t *testing.T) {
Sent: 9350,
SessionID: 669956116721375025,
LastOperation: "PING",
Established: time.Unix(1427238849, 319),
Established: time.Unix(1427238849, 319*1e6),
Timeout: 20001,
Lcxid: 1427245380,
Lzxid: -1,
LastResponse: time.Unix(1427259252, 294),
LastResponse: time.Unix(1427259252, 294*1e6),
LastLatency: 0,
MinLatency: 0,
AvgLatency: 1,
Expand All @@ -196,11 +196,11 @@ func TestFLWCons(t *testing.T) {
Sent: 109617,
SessionID: 669956116721374985,
LastOperation: "DELE",
Established: time.Unix(1427238791, 305),
Established: time.Unix(1427238791, 305*1e6),
Timeout: 20001,
Lcxid: 1427346968,
Lzxid: 73190283389,
LastResponse: time.Unix(1427259257, 423),
LastResponse: time.Unix(1427259257, 423*1e6),
LastLatency: 2,
MinLatency: 0,
AvgLatency: 1,
Expand All @@ -213,11 +213,11 @@ func TestFLWCons(t *testing.T) {
Sent: 314041,
SessionID: 103737561100976129,
LastOperation: "SETA",
Established: time.Unix(1582909574, 451),
Established: time.Unix(1582909574, 451*1e6),
Timeout: 10000,
Lcxid: 1216878,
Lzxid: 944893463581,
LastResponse: time.Unix(1583583401, 593),
LastResponse: time.Unix(1583583401, 593*1e6),
LastLatency: 0,
MinLatency: 0,
AvgLatency: 0,
Expand Down

0 comments on commit d7dcbe5

Please sign in to comment.