Merge pull request #369 from stevvooe/heartbeat-should-be-duration

swarm: clarify meaning of time related fields
This commit is contained in:
Vincent Demeester 2016-08-30 22:34:53 +02:00 коммит произвёл GitHub
Родитель 003df11958 c46dfa1e6d
Коммит f52a1ff447
1 изменённых файлов: 17 добавлений и 3 удалений

Просмотреть файл

@ -54,13 +54,27 @@ type RaftConfig struct {
SnapshotInterval uint64 `json:",omitempty"` SnapshotInterval uint64 `json:",omitempty"`
KeepOldSnapshots uint64 `json:",omitempty"` KeepOldSnapshots uint64 `json:",omitempty"`
LogEntriesForSlowFollowers uint64 `json:",omitempty"` LogEntriesForSlowFollowers uint64 `json:",omitempty"`
HeartbeatTick uint32 `json:",omitempty"`
ElectionTick uint32 `json:",omitempty"` // ElectionTick is the number of ticks that a follower will wait for a message
// from the leader before becoming a candidate and starting an election.
// ElectionTick must be greater than HeartbeatTick.
//
// A tick currently defaults to one second, so these translate directly to
// seconds currently, but this is NOT guaranteed.
ElectionTick int
// HeartbeatTick is the number of ticks between heartbeats. Every
// HeartbeatTick ticks, the leader will send a heartbeat to the
// followers.
//
// A tick currently defaults to one second, so these translate directly to
// seconds currently, but this is NOT guaranteed.
HeartbeatTick int
} }
// DispatcherConfig represents dispatcher configuration. // DispatcherConfig represents dispatcher configuration.
type DispatcherConfig struct { type DispatcherConfig struct {
HeartbeatPeriod uint64 `json:",omitempty"` HeartbeatPeriod time.Duration `json:",omitempty"`
} }
// CAConfig represents CA configuration. // CAConfig represents CA configuration.